/* =====================================================================
   ROCCO · product.css  (single product page)
   Spec: clothing-store-product-page-spec.md. Tokens, buttons, card and
   carousel come from main.css; header, footer and accordions from inner.css.
   Zero radius on this page except the carousel card tiles.
   ===================================================================== */

/* Breadcrumb styles (.crumb) are shared with the shop pages and live in inner.css */

/* ---------- Top: gallery + sticky summary (spec 1, 4, 5) ---------- */
.pdp-top {
  display: grid; grid-template-columns: minmax(0, 748px) minmax(300px, 354px); gap: 12px;
  padding: 0 12px; align-items: start;
}
.gimg { position: relative; aspect-ratio: 2 / 3; background: var(--c-accent-2); overflow: hidden; cursor: zoom-in; }
.gimg > .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.gimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gimg .badge { top: 16px; left: 16px; right: auto; }
.pdp-gallery:not(.is-slider) .swiper-wrapper { display: block; transform: none !important; }
.pdp-gallery:not(.is-slider) .gallery__dots { display: none; }
.gallery__dots { position: static; margin-top: 4px; display: flex; justify-content: center; gap: 4px; }
/* 6px dots drawn inside a 24px tap target */
.gallery__dots .swiper-pagination-bullet { position: relative; width: 24px; height: 24px; margin: 0 !important; background: none; opacity: 1; border-radius: 50%; }
.gallery__dots .swiper-pagination-bullet::after { content: ""; position: absolute; left: 9px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--c-accent-4); }
.gallery__dots .swiper-pagination-bullet-active::after { background: var(--c-accent-6); }

.summary { position: sticky; top: 90px; padding-top: 48px; }
.summary__title { font-size: 20px; font-weight: 400; line-height: 28px; text-transform: uppercase; }
.summary__rating { margin-top: 10px; display: flex; align-items: center; gap: 8px; min-height: 16px; }
.summary__rating .stars { color: var(--c-accent-1); }
.rev-link { font-size: 12px; line-height: 1.33; color: var(--c-muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 24px; transition: color var(--t); }
.rev-link:hover { color: var(--c-accent-6); }
.summary__price { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; line-height: 1.4; }
.summary__price .old { opacity: .6; text-decoration: line-through; }
.summary__rule { margin-top: 24px; }

/* Variation select */
.field { margin-top: 24px; }
.field[hidden] { display: none; }
.field__label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 500; line-height: 1.3; text-transform: uppercase; }
.select-wrap { position: relative; }
.select {
  width: 100%; height: 47px; padding: 6px 42px 6px 20px;
  border: 1px solid var(--c-line); border-radius: 0; background: var(--c-bg);
  font-size: 14px; line-height: 1.4; color: var(--c-accent-6); cursor: pointer;
  appearance: none; -webkit-appearance: none; transition: border-color var(--t), transform .1s;
}
.select:focus-visible { outline: none; border-color: var(--c-accent-6); }
.select-wrap > svg { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--c-accent-6); }
.field__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; margin-top: 8px; }
.field__note { font-size: 14px; line-height: 1.4; color: var(--c-muted); }
.field__note.is-error { font-size: 12px; }
.field__clear { margin-left: auto; min-height: 24px; padding: 0 4px; background: none; border: 0; cursor: pointer; font-size: 10px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; color: var(--c-muted); transition: color var(--t); }
.field__clear:hover { color: var(--c-accent-6); }
.field.is-shake .select { animation: shake .3s ease; }
.field + .field { margin-top: 18px; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Quantity + add to cart */
.buyrow { margin-top: 24px; display: flex; gap: 14px; height: 58px; }
.wa-order { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; margin-top: 12px; }
.wa-order[hidden] { display: none; }
.qty { position: relative; flex: 0 0 110px; width: 110px; height: 58px; border: 1px solid var(--c-line); }
.qty__input {
  width: 100%; height: 100%; padding: 0 28px; border: 0; background: none; outline: none;
  text-align: center; font-size: 12px; font-weight: 500; -moz-appearance: textfield; appearance: textfield;
}
.qty__input::-webkit-inner-spin-button, .qty__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty__btn {
  position: absolute; top: 0; bottom: 0; width: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--c-accent-6);
  opacity: 0; transition: opacity var(--t), color var(--t);
}
.qty__btn--minus { left: 0; }
.qty__btn--plus { right: 0; }
.qty:hover .qty__btn, .qty:focus-within .qty__btn { opacity: 1; }
@media (hover: none) { .qty__btn { opacity: 1; } }
.atc { flex: 1 1 auto; height: 58px; padding: 20px 0; background: var(--c-accent-1); border-color: var(--c-accent-6); }
.atc:hover { background: var(--c-accent-5); color: var(--c-accent-6); }
.atc[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.atc[aria-disabled="true"]:hover { background: var(--c-accent-1); color: var(--c-accent-5); }
.atc.is-busy { cursor: progress; }

/* Text buttons: wishlist, size guide */
.tbtn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; min-height: 24px; padding: 0;
  background: none; border: 0; cursor: pointer; text-decoration: none;
  font-size: 10px; font-weight: 500; line-height: 1.4; letter-spacing: .8px; text-transform: uppercase; color: var(--c-accent-1);
  transition: color var(--t);
}
.tbtn:hover { color: var(--c-muted); }
.tbtn svg { flex: 0 0 14px; width: 14px; height: 14px; }
.tbtn .ico-heart-fill { display: none; }
.tbtn.is-active .ico-heart { display: none; }
.tbtn.is-active .ico-heart-fill { display: block; }
.tbtn--guide { display: flex; margin-top: 18px; font-weight: 400; color: var(--c-accent-6); }
.rule--acc { margin-top: 28px; }
.summary .acc__body a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- SHOP THE LOOK (spec 6) ---------- */
.look { width: 748px; max-width: calc(100% - 24px); margin: 100px auto 0; }
.look__title { font-size: 30px; font-weight: 400; line-height: 1.3; text-transform: uppercase; margin-bottom: 24px; }
.look__grid { display: grid; grid-template-columns: minmax(0, 446fr) minmax(0, 265fr); gap: 12px; align-items: start; }
/* Left column (heading + main image) pins under the header while the look items scroll, released at the end of the section */
.look__left { position: sticky; top: 90px; }
.look__img { aspect-ratio: 2 / 3; background: var(--c-accent-2); cursor: zoom-in; }
.look__img .img-slot__shade { align-items: center; justify-content: center; }
.look__img img { object-position: center; }
.look__list { display: flex; flex-direction: column; gap: 32px; }
.look .card__media, .look .card__tile { border-radius: 0; }
.look .card__rating { display: none; }
.look .card__title { margin-top: 12px; }

/* ---------- ABOUT THIS ITEM (spec 7) ---------- */
.about { width: 806px; max-width: calc(100% - 24px); margin: 100px auto 0; }
.about__title { text-align: center; margin-bottom: 10px; }
.tabs2 { display: flex; justify-content: center; gap: 40px; border-bottom: 1px solid var(--c-line); overflow-x: auto; scrollbar-width: none; }
.tabs2::-webkit-scrollbar { display: none; }
.tabs2 .tab { position: relative; flex: 0 0 auto; padding: 20px 0; min-height: 0; color: var(--c-accent-3); }
.tabs2 .tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--c-accent-6); opacity: 0; transition: opacity var(--t); }
.tabs2 .tab[aria-selected="true"] { color: var(--c-accent-1); }
.tabs2 .tab[aria-selected="true"]::after { opacity: 1; }
.about__panel { padding-top: 40px; font-size: 14px; line-height: 19.6px; transition: opacity .2s ease; }
.about__panel.is-fading { opacity: 0; }
.about__panel[hidden] { display: none; }
.reviews__title { margin-bottom: 8px; text-transform: none; }
.review { display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--c-line); }
.review__avatar { flex: 0 0 60px; width: 60px; height: 60px; border-radius: 50%; background: var(--c-accent-2); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 500; color: var(--c-muted); }
.review__body { flex: 1 1 auto; min-width: 0; }
.review__meta { margin-top: 6px; font-size: 14px; font-weight: 600; }
.review__meta small { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--c-muted); }
.summary__rating .rev-link { padding: 4px 0; }
.review__text { margin-top: 8px; }
.about__note { margin-top: 20px; color: var(--c-muted); }
.qa__item + .qa__item { margin-top: 20px; }
.qa__q { font-weight: 600; }
.qa__a { margin-top: 8px; }
.qa__ask { margin-top: 28px; }
.qa__form { margin-top: 20px; }
.qa__form[hidden] { display: none; }

/* ---------- Carousels (spec 8): 5 per view, arrows at the page edge ---------- */
.pcar { margin-top: 100px; }
.pcar--bought { margin-top: 80px; margin-bottom: 80px; }
.pcar__title { text-align: center; margin-bottom: 28px; }
.pcar .carousel { padding: 0 12px; }
.pcar .carousel .arrow--prev { left: 12px; }
.pcar .carousel .arrow--next { right: 12px; }
.pcar[hidden] { display: none; }

/* ---------- Mobile sticky add to cart bar (spec 11) ---------- */
.sticky-atc { display: none; }

/* ---------- Lightbox (spec 4) ---------- */
.lb {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t);
}
.lb.is-open { opacity: 1; visibility: visible; }
.lb__img { position: relative; height: 90vh; max-width: calc(100vw - 120px); aspect-ratio: 2 / 3; background: var(--c-accent-2); }
.lb__img .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.lb__img img { object-position: center; }
.lb__btn {
  position: absolute; width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: #fff; cursor: pointer; opacity: .85; transition: opacity var(--t);
}
.lb__btn:hover { opacity: 1; }
.lb__close { top: 16px; right: 16px; }
.lb__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Size & fit guide modal (spec 5.8) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; padding: 16px;
  display: flex; align-items: center; justify-content: center; background: var(--c-overlay);
  opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t);
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__box { position: relative; width: 720px; max-width: 100%; max-height: 90vh; overflow-y: auto; background: var(--c-bg); padding: 48px; border-radius: 0; }
.modal__close { position: absolute; top: 10px; right: 10px; }
.modal__title { font-size: 20px; font-weight: 400; line-height: 1.4; text-transform: uppercase; margin-bottom: 24px; }
.sizes { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.sizes th, .sizes td { padding: 10px 8px; border-bottom: 1px solid var(--c-line); text-align: left; }
.sizes th { font-weight: 500; }
.modal p { margin-top: 24px; font-size: 14px; line-height: 1.5; }

/* ---------- Not found state ---------- */
.pdp-nf { padding: 100px 16px 160px; text-align: center; }
.pdp-nf h1 { font-size: 20px; font-weight: 400; text-transform: uppercase; }
.pdp-nf p { max-width: 540px; margin: 16px auto 0; font-size: 14px; line-height: 1.5; }
.pdp-nf .btn-row { margin-top: 30px; }

/* =====================================================================
   Responsive (spec 11)
   ===================================================================== */
@media (max-width: 1024px) {
  .crumb { padding: 8px 24px; }
  .pdp-top { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .pdp-gallery { width: 100%; }
  .gimg { aspect-ratio: 3 / 4; }
  .summary { position: static; width: 100%; max-width: 600px; margin: 0 auto; padding: 32px 24px 0; }
  .look { margin-top: 80px; }
  .look__grid { grid-template-columns: 55fr 45fr; }
  .about { width: 90vw; }
  .pcar { margin-top: 80px; }
}

@media (max-width: 767px) {
  .crumb { padding: 8px 16px; }
  .summary { padding: 24px 16px 0; }
  .buyrow { height: 52px; }
  .qty { flex-basis: 90px; width: 90px; height: 52px; }
  .atc { height: 52px; padding: 17px 0; }
  .look { margin-top: 60px; max-width: calc(100% - 32px); }
  .look__title { font-size: 24px; }
  .look__grid { grid-template-columns: minmax(0, 1fr); }
  .look__left { position: static; }
  .look__list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .about { width: auto; max-width: none; margin-top: 60px; }
  .about__title { padding: 0 16px; }
  .tabs2 { justify-content: flex-start; gap: 28px; padding: 0 16px; }
  .about__panel { padding: 32px 16px 0; }
  .pcar { margin-top: 60px; }
  .pcar--bought { margin-bottom: 60px; }
  .pcar .carousel { padding: 0 16px; }
  .modal__box { padding: 32px 20px; }
  .lb__img { max-width: calc(100vw - 24px); height: auto; width: calc(100vw - 24px); }
  .lb__prev, .lb__next { top: auto; bottom: 16px; transform: none; }
  .pdp-main { padding-bottom: 64px; }

  .sticky-atc {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-left: 16px;
    background: var(--c-bg); border-top: 1px solid var(--c-line);
    transform: translateY(100%); transition: transform var(--t);
  }
  .sticky-atc.is-visible { transform: none; }
  .sticky-atc__price { font-size: 14px; font-weight: 500; }
  .sticky-atc__btn { height: 100%; padding: 0 28px; }
}

/* Colour swatches (catalogue colour variants, Phase B) */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.swatch-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--c-line); background-size: cover; background-position: center; cursor: pointer; padding: 0; }
.swatch-btn.is-active { outline: 2px solid var(--c-accent-6, #111); outline-offset: 3px; }
.swatch-btn:focus-visible { outline: 2px solid var(--c-accent-6, #111); outline-offset: 3px; }
.colour-name { font-weight: 400; color: var(--c-accent-6); }
#colour-field { margin-top: 24px; }
#colour-field + .field { margin-top: 20px; }
