/* cart.css - cart page for Bongo Shi */

.cart { padding: 14px 9px 0; }
.cart__title { margin: 0 0 14px; font-size: 24px; font-weight: 600; color: #111; }
.cart__count { font-size: 16px; font-weight: 500; color: var(--grey); }
.cart__loading { padding: 40px 12px; text-align: center; color: var(--grey); font-size: 15px; }

.cart__note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fff8f0; color: #8a4b00; font-size: 13px; line-height: 1.4; }

/* items */
.cart__list { list-style: none; display: grid; gap: 12px; margin: 0 0 16px; }
.cart__item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #f0e9dc;
  border-radius: 14px;
}
.cart__item.is-gone { opacity: 0.6; }
.cart__main { min-width: 0; }
.cart__all { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 10px 12px; background: #fff; border: 1px solid #f0e9dc; border-radius: 14px; font-size: 14px; font-weight: 600; color: #111; }
.cart__all em { margin-left: auto; font-style: normal; font-weight: 400; font-size: 12px; color: var(--grey); }
.cart__all input, .cart__pick input { -webkit-appearance: none; appearance: none; display: grid; place-content: center; width: 24px; height: 24px; margin: 0; flex: none; border: 2px solid #c9bfae; border-radius: 7px; background: #fff; }
.cart__all input:checked, .cart__pick input:checked { background: var(--orange); border-color: var(--orange); }
.cart__all input:checked::after, .cart__pick input:checked::after { content: ""; width: 6px; height: 12px; margin-top: -2px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.cart__all input:focus-visible, .cart__pick input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.cart__pick { display: flex; align-items: center; flex: none; }
.cart__item.is-off .cart__img, .cart__item.is-off .cart__info { opacity: 0.55; }
.cart__opt { margin-top: 2px; font-size: 13px; color: #333; font-weight: 500; }
.cart__dc { margin-top: 2px; font-size: 12px; color: var(--grey); }
.cart__row + .cart__row { margin-top: 8px; }
.cart__row--total { margin-top: 12px !important; padding-top: 12px; border-top: 1px solid #f0e9dc; }
.cart__img {
  position: relative;
  flex: none;
  width: 78px;
  height: 98px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #f0e9dc;
  border-radius: 10px;
  background: #fff;
}
.cart__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cart__img .card__ph svg { width: 30px; height: 30px; }

.cart__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: #111;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.cart__price { margin-top: 4px; font-size: 14px; color: var(--grey); }
.cart__gone { margin-top: 4px; font-size: 13px; font-weight: 600; color: #b3261e; }

.cart__ctl { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.cart__qty { display: inline-flex; align-items: center; border: 1px solid #e7dfd0; border-radius: 10px; overflow: hidden; }
.cart__qty button { width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; line-height: 1; color: #222; }
.cart__qty button:disabled { opacity: 0.35; cursor: default; }
.cart__qty button:not(:disabled):active { background: #fff1e6; }
.cart__qty output { min-width: 34px; text-align: center; font-size: 15px; font-weight: 600; color: #111; }
.cart__rm { padding: 6px 4px; font-size: 13px; font-weight: 600; color: #b3261e; }
.cart__lt { margin-left: auto; font-size: 16px; font-weight: 600; color: var(--orange); }
.cart__item.is-gone .cart__lt { display: none; }

/* summary */
.cart__sum { padding: 18px; background: #fff; border: 1px solid #f0e9dc; border-radius: 14px; }
.cart__sum h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: #111; }
.cart__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--grey); }
.cart__row b { font-size: 20px; font-weight: 600; color: #111; }
.cart__hint { margin: 8px 0 16px; font-size: 12px; color: #888; }
.cart__go {
  display: block;
  width: 100%;
  padding: 15px 10px;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.cart__go:active { opacity: 0.85; }
.cart__go[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.cart__more { display: block; margin-top: 12px; text-align: center; font-size: 14px; font-weight: 600; color: var(--orange); text-decoration: none; }

/* empty */
.cart__empty { padding: 56px 12px; text-align: center; color: var(--grey); font-size: 15px; }
.cart__empty svg { width: 56px; height: 56px; margin-bottom: 12px; fill: none; stroke: #c9bfae; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cart__empty .cart__go { display: inline-block; width: auto; margin-top: 18px; padding: 12px 24px; font-size: 15px; }

.cart a:focus-visible, .cart button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* dark mode */
html[data-theme="dark"] .cart__title,
html[data-theme="dark"] .cart__name,
html[data-theme="dark"] .cart__qty output,
html[data-theme="dark"] .cart__sum h2,
html[data-theme="dark"] .cart__row b { color: #f5f5f5; }
html[data-theme="dark"] .cart__note { background: #3a2a1d; color: #f2b787; }
html[data-theme="dark"] .cart__all input:not(:checked), html[data-theme="dark"] .cart__pick input:not(:checked) { background: #262422; border-color: #6b655c; }
html[data-theme="dark"] .cart__all { background: #262422; border-color: #3a3836; color: #f5f5f5; }
html[data-theme="dark"] .cart__opt { color: #d6d1ca; }
html[data-theme="dark"] .cart__row--total { border-top-color: #3a3836; }
html[data-theme="dark"] .cart__item,
html[data-theme="dark"] .cart__sum { background: #262422; border-color: #3a3836; }
html[data-theme="dark"] .cart__img { border-color: #3a3836; }
html[data-theme="dark"] .cart__qty { border-color: #3a3836; }
html[data-theme="dark"] .cart__qty button { color: #eee; }
html[data-theme="dark"] .cart__qty button:not(:disabled):active { background: #3a2a1d; }
html[data-theme="dark"] .cart__rm,
html[data-theme="dark"] .cart__gone { color: #ff9c94; }
html[data-theme="dark"] .cart__hint { color: #8d8882; }
html[data-theme="dark"] .cart__empty svg { stroke: #5a554f; }

/* desktop (also "Desktop site" mode on phones) */
@media (min-width: 900px) {
  .cart { padding: 0; }
  .cart__title { margin-bottom: 20px; font-size: 30px; }
  .cart__layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
  .cart__list { margin: 0; }
  .cart__sum { position: sticky; top: calc(var(--header-h) + 24px); }
  .cart__item { padding: 16px; gap: 16px; }
  .cart__img { width: 96px; height: 120px; }
  .cart__name { font-size: 16px; }
  .cart__rm, .cart__go, .cart__more, .cart__qty button:not(:disabled) { cursor: pointer; }
  .cart__go:hover { opacity: 0.9; }
  .cart__rm:hover, .cart__more:hover { text-decoration: underline; }
  .cart__qty button:not(:disabled):hover { background: #fff1e6; }
  html[data-theme="dark"] .cart__qty button:not(:disabled):hover { background: #3a2a1d; }
}
