/* Product page. Tokens only; mobile-first. */

.product { display: grid; gap: var(--space-6); margin-bottom: var(--space-10); }
@media (min-width: 64rem) {
  .product { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-12); align-items: start; }
  .product__gallery { position: sticky; top: calc(var(--header-h) + var(--space-4)); }
}
.product__buy { min-width: 0; }
.product__head { display: grid; gap: var(--space-3); }
.product__head .eyebrow a { color: inherit; text-decoration: none; }
.product__title { font-size: var(--fs-h2); line-height: 1.08; }
.product__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); list-style: none; padding: 0; }
.product__sku { font-size: var(--text-sm); color: var(--color-muted-text); overflow-wrap: anywhere; }
.product__sku span { font-weight: 600; color: var(--color-text); }
.product__rating { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); font-size: var(--text-sm); font-weight: 600; color: var(--color-text-strong); text-decoration: none; }
.product__short { color: var(--color-muted-text); max-width: 52ch; }
.product__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin: var(--space-5) 0 var(--space-5); }
.product__price-note { font-size: var(--text-sm); color: var(--color-muted-text); }

/* ---------- buy form ---------- */
.buy { display: grid; gap: var(--space-5); }
.buy__qty { display: grid; gap: var(--space-2); justify-items: start; }
.buy__total { display: flex; align-items: baseline; justify-content: space-between; margin: 0; font-weight: 600; }
.buy__verify { display: flex; align-items: center; gap: 0.375rem; margin: calc(var(--space-2) * -1) 0 0; font-size: var(--text-sm); color: var(--color-muted-text); }
.buy__verify .icon { width: 1rem; height: 1rem; color: var(--color-success); }
.buy__note { margin: 0; color: var(--color-muted-text); }

/* ---------- options ---------- */
.options { display: grid; gap: var(--space-5); }
.option-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.option-group__title { padding: 0; margin-bottom: var(--space-2); font-size: var(--text-sm); font-weight: 600; color: var(--color-text-strong); }
.option-group__req { margin-left: 0.5rem; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted-text); }
.option {
  align-items: center; margin-bottom: var(--space-2); padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-background);
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.option .check__box { margin-top: 0; }
.option:has(input:checked) { border-color: var(--btn-primary-bg); background: color-mix(in srgb, var(--btn-primary-bg) 6%, var(--color-background)); }
.option__text { display: flex; flex: 1; align-items: baseline; justify-content: space-between; gap: var(--space-3); min-width: 0; }
.option__label { line-height: 1.35; overflow-wrap: anywhere; }
.option__price { flex: none; font-size: var(--text-sm); font-weight: 600; color: var(--color-muted-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.option.is-hidden, .option-group.is-hidden { display: none; }
@media (hover: hover) { .option:hover { border-color: var(--color-muted-text); } .option:has(input:checked):hover { border-color: var(--btn-primary-bg); } }
.options__notice { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-surface); font-size: var(--text-sm); }

/* ---------- gallery ---------- */
.gallery { display: grid; gap: var(--space-3); min-width: 0; }
.gallery__stage { position: relative; overflow: hidden; background: var(--color-surface); border-radius: var(--radius-lg); }
.gallery__track { display: flex; margin: 0; padding: 0; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.gallery__open { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; padding: 0; cursor: zoom-in; }
.gallery__open img { width: 100%; height: 100%; object-fit: contain; padding: var(--space-4); mix-blend-mode: multiply; }
.gallery__count {
  position: absolute; left: var(--space-3); bottom: var(--space-3); margin: 0; padding: 0.25rem 0.625rem; border-radius: var(--radius-pill);
  background: var(--color-background); font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums;
}
.gallery__nav { display: none; }
.gallery__btn { background: var(--color-background); box-shadow: var(--shadow-sm); }
.gallery__zoom {
  position: absolute; right: var(--space-3); bottom: var(--space-3); display: inline-flex; align-items: center; gap: 0.375rem; min-height: var(--tap); padding: 0 var(--space-4);
  border-radius: var(--radius-pill); background: var(--color-background); box-shadow: var(--shadow-sm); font-size: var(--text-sm); font-weight: 600;
}
.gallery__zoom .icon { width: 1.125rem; height: 1.125rem; }
.gallery__empty { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--color-subtle-text); }
.gallery__empty .icon { width: 3rem; height: 3rem; }
@media (min-width: 48rem) {
  .gallery__nav { position: absolute; inset-inline: var(--space-3); top: 50%; translate: 0 -50%; display: flex; justify-content: space-between; pointer-events: none; }
  .gallery__btn { pointer-events: auto; }
}
.gallery__thumbs { display: flex; gap: var(--space-2); margin: 0; padding: 0 0 var(--space-1); list-style: none; overflow-x: auto; scrollbar-width: none; }
.gallery__thumbs::-webkit-scrollbar { display: none; }
.gallery__thumb { display: block; flex: none; width: 5rem; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid transparent; border-radius: var(--radius-md); background: var(--color-surface); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 0.25rem; mix-blend-mode: multiply; }
.gallery__thumb[aria-current="true"] { border-color: var(--color-text-strong); }
@media (hover: hover) { .gallery__thumb:not([aria-current="true"]):hover { border-color: var(--color-muted-text); } }

/* ---------- zoom viewer ---------- */
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--color-background); z-index: var(--z-dialog); }
.lightbox[open] { display: flex; flex-direction: column; animation: fade-in var(--dur) var(--ease); }
.lightbox__bar { display: flex; flex: none; align-items: center; justify-content: space-between; padding: var(--space-2) var(--space-3) var(--space-2) var(--space-5); border-bottom: 1px solid var(--color-border); }
.lightbox__count { margin: 0; font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.lightbox__tools { display: flex; align-items: center; gap: var(--space-2); }
.lightbox__zoom .icon { width: 1.125rem; height: 1.125rem; }
.lightbox__stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; background: var(--color-surface); overscroll-behavior: contain; }
.lightbox__img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; cursor: zoom-in; }
.lightbox__stage.is-zoomed { display: block; cursor: zoom-out; }
.lightbox__stage.is-zoomed .lightbox__img { max-width: none; max-height: none; width: 220%; height: auto; cursor: zoom-out; }
.lightbox__prev, .lightbox__next { position: absolute; top: 50%; translate: 0 -50%; background: var(--color-background); box-shadow: var(--shadow-md); z-index: 2; }
.lightbox__prev { left: var(--space-3); }
.lightbox__next { right: var(--space-3); }

/* ---------- tabs ---------- */
.product-tabs { margin-block: var(--space-12); }
.product-tabs .tabs__list { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.product-tabs .tabs__list::-webkit-scrollbar { display: none; }
.product-tabs .tabs__tab { flex: none; white-space: nowrap; }
.product-tabs .tabs__panel { padding-top: var(--space-6); }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--space-4); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose h2, .prose h3, .prose h4 { margin-top: var(--space-6); }
.prose table { width: 100%; border-collapse: collapse; }
.prose td, .prose th { padding: var(--space-2); border: 1px solid var(--color-border); text-align: left; }
.specs { display: grid; max-width: 44rem; margin: 0; }
.specs__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.specs__row dt { color: var(--color-muted-text); }
.specs__row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.downloads { display: grid; gap: var(--space-2); max-width: 36rem; margin: 0; padding: 0; list-style: none; }
.downloads__link { display: flex; align-items: center; gap: var(--space-3); min-height: 3.5rem; padding: var(--space-3) var(--space-4); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text-strong); text-decoration: none; font-weight: 600; }
.downloads__name { flex: 1; min-width: 0; }
.downloads__meta { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted-text); }
@media (hover: hover) { .downloads__link:hover { border-color: var(--color-text-strong); } }

/* ---------- reviews ---------- */
.reviews { display: grid; gap: var(--space-8); }
.reviews__list .grid { gap: var(--space-4); margin-top: var(--space-4); }
.reviews .review { background: var(--color-surface); }
.review-form { display: grid; align-content: start; gap: var(--space-4); padding: var(--space-6); background: var(--color-surface); border-radius: var(--radius-lg); }
.review-form__title { font-size: var(--text-xl); }
.review-form .input, .review-form .textarea { background: var(--color-background); }
.rating-input { min-width: 0; margin: 0; padding: 0; border: 0; }
.rating-input__stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input__stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input__stars label { display: grid; place-items: center; width: var(--tap); height: var(--tap); cursor: pointer; color: var(--color-subtle-text); }
.rating-input__stars label .icon { width: 1.75rem; height: 1.75rem; }
.rating-input__stars input:checked ~ label { color: var(--color-text-strong); }
.rating-input__stars input:focus-visible + label { outline: 3px solid var(--color-primary); outline-offset: -2px; border-radius: var(--radius-sm); }
@media (hover: hover) { .rating-input__stars label:hover, .rating-input__stars label:hover ~ label { color: var(--color-text-strong); } }
@media (min-width: 64rem) { .reviews { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--space-12); } }

/* ---------- previous / next, related ---------- */
.pager { display: grid; gap: var(--space-3); margin-bottom: var(--space-12); }
.pager__link { display: grid; gap: 0.25rem; min-height: var(--tap); padding: var(--space-4) var(--space-5); border: 1.5px solid var(--color-border); border-radius: var(--radius-lg); text-decoration: none; min-width: 0; }
.pager__link--next { text-align: right; }
.pager__dir { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted-text); }
.pager__link--next .pager__dir { justify-content: flex-end; }
.pager__dir .icon { width: 1rem; height: 1rem; }
.pager__name { font-weight: 600; color: var(--color-text-strong); overflow-wrap: anywhere; }
@media (hover: hover) { .pager__link:hover { border-color: var(--color-text-strong); } }
@media (min-width: 48rem) { .pager { grid-template-columns: 1fr 1fr; } }
.related { margin-bottom: var(--space-8); }
.buy-bar .btn { flex: 1; }
