/* Mirapages — /shop/ v2: the grid card's cover link and photo count, and the product sheet (gallery,
   option chips, description, detail images, qty and Add to cart). The sheet frame is booking.css.
   Spec: docs/shop-v2-contract.md; tokens in docs/design-tokens.md. */

/* Grid card: the cover and the name open the product sheet */
.product__frame { position: relative; display: block; }
.product__count { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(248, 242, 234, .92); color: var(--ink); font-size: .75rem; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums; }
.product__link { color: inherit; text-decoration: none; transition: color .2s; }
.product__link:hover { color: var(--accent-text); }
a.product__add { text-decoration: none; }

/* The sheet: wider on desktop, gallery beside the details */
.psheet__head { padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.psheet__title { font-size: clamp(1.25rem, 3.6vw, 1.75rem); text-wrap: balance; overflow-wrap: anywhere; }
:lang(zh) .psheet__title { font-size: 1.25rem; line-height: 1.3; }
.psheet .sheet__step:empty { display: none; }
@media (min-width: 900px) {
  .psheet__panel { width: min(calc(100% - 64px), 1040px); height: min(90svh, 900px); }
  .psheet__body { padding: 28px 44px 40px; }
  .psheet__foot { padding-inline: 44px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 40px; }
  .psheet__foot .sheet__summary { text-align: left; }
}

.pview { display: grid; gap: 22px; }
@media (min-width: 900px) {
  .pview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .pview__media { position: sticky; top: 0; }
}
.pview__info { display: grid; gap: 20px; align-content: start; min-width: 0; }
.pview__price { font: 700 1.75rem/1 var(--sans); letter-spacing: -.01em; color: var(--copper-deep); font-variant-numeric: tabular-nums; }
.pview__sold { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(29, 26, 20, .08); color: var(--muted); font-size: .875rem; font-weight: 600; letter-spacing: 0; }
.pview__desc { color: var(--muted); white-space: pre-line; text-wrap: pretty; }
.pview__details { display: grid; gap: 12px; padding-top: 20px; border-top: 1px solid var(--hair); }
.pview__h { font: italic 600 1.375rem/1.1 var(--serif); color: var(--accent-text); }
:lang(zh) .pview__h { font: 700 1.0625rem/1.3 var(--sans); }
.pview__detail-list { display: grid; overflow: hidden; border-radius: 16px; background: #fff; }
.pview__detail { display: block; width: 100%; height: auto; }

/* Gallery: a scroll-snap strip in a soft arch, dots and arrows over the photo */
.gallery { position: relative; }
.gallery__track {
  display: flex; aspect-ratio: 4 / 5; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  border-radius: 50% 50% 18px 18px / 22% 22% 18px 18px; background: #fff;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline: 2px solid var(--copper-hi); outline-offset: 3px; }
.gallery__slide { flex: 0 0 100%; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.gallery__img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; }
.gallery__arrow {
  position: absolute; top: 50%; z-index: 1; width: 44px; height: 44px; margin-top: -22px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255, 251, 245, .92); color: var(--ink); cursor: pointer;
  transition: opacity .25s, background-color .2s, transform .2s var(--ease);
}
.gallery__arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gallery__arrow:hover { background: var(--card); border-color: var(--accent-text); }
.gallery__arrow:active { transform: scale(.94); }
.gallery__arrow:disabled { opacity: 0; pointer-events: none; }
.gallery__arrow--prev { left: 10px; }
.gallery__arrow--next { right: 10px; }
.gallery__dots { position: absolute; left: 50%; bottom: 12px; z-index: 1; display: flex; max-width: calc(100% - 24px); padding: 2px 6px; border-radius: 999px; background: rgba(29, 26, 20, .45); transform: translateX(-50%); }
.gallery__dot { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.gallery__dot::before { content: ""; width: 7px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .6); transition: width .3s var(--ease), background-color .3s; }
.gallery__dot[aria-current="true"]::before { width: 16px; background: #fff; }
.gallery__dot:focus-visible { outline-offset: -2px; }

/* Option chips: a size or a shade; sold-out ones dashed, struck through and disabled */
.pchips { min-width: 0; margin: 0; padding: 0; border: 0; }
.pchips legend { padding: 0; margin-bottom: 10px; }
.pchips__row { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; max-width: 100%;
  padding: 6px 18px; border-radius: 999px; border: 1.5px solid rgba(29, 26, 20, .15); background: #fff8ef;
  cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.pchip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.pchip:hover { border-color: var(--copper); }
.pchip:has(input:checked) { border-color: var(--copper); background: rgba(196, 131, 90, .16); box-shadow: inset 0 0 0 1px var(--copper); }
.pchip:has(input:focus-visible) { outline: 2px solid var(--copper-hi); outline-offset: 2px; }
.pchip__img { width: 36px; height: 36px; flex: none; margin-left: -12px; border-radius: 50%; object-fit: cover; background: var(--sand-2); }
.pchip__text { display: grid; min-width: 0; line-height: 1.2; }
.pchip__name { font-size: .9375rem; font-weight: 600; overflow-wrap: anywhere; }
.pchip__note { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pchip.is-sold { cursor: not-allowed; border-style: dashed; background: transparent; }
.pchip.is-sold:hover { border-color: rgba(29, 26, 20, .15); }
.pchip.is-sold .pchip__name { color: rgba(29, 26, 20, .5); text-decoration: line-through; }
.pchip.is-sold .pchip__img { filter: grayscale(1); opacity: .5; }

/* Footer: what you're adding, qty and Add to cart */
.psheet__buy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.psheet__add { flex: 1 1 auto; min-width: 0; }
.psheet__foot .sheet__need { color: var(--copper-deep); font-weight: 600; }
.psheet__foot .sheet__summary:empty { display: none; }

/* Checkout lines: the option after the name */
.coline__opt { font-weight: 600; color: var(--accent-text); }

/* An order's lines, receipt-style: "qty × name · option" on the left, the line's price on the right */
.order-items__line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
.order-items__name { min-width: 0; overflow-wrap: anywhere; }
.order-items__price { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.done__when .order-items { justify-items: stretch; width: min(100%, 380px); margin-inline: auto; text-align: left; }
.done__when .done__total { text-align: center; }
/* Narrow phones: the pay summary's items take the full width under their label */
@media (max-width: 420px) { .pay-summary .pay-summary__items { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
/* Long names in the sheet header stay to two lines on small phones */
@media (max-width: 400px) { .psheet__title { font-size: 1.25rem; } :lang(zh) .psheet__title { font-size: 1.0625rem; } }
