/* RITE CLOTHING — product page
   layout: one flat background in the photo grey, so the model floats on the page
   (ARK/8 style). Desktop: "‹ Shop" top left, the 2:3 slideshow in the centre and a
   liquid-glass order card on the right: name + price, colourway, fabric, sizes,
   Add to cart, stock line, then Details / Size & Fit / Shipping & Returns + heart.
   Tablet: photo left, card right. Phone: photo edge to edge, card below. */

:root{
  --photo-bg:#E5E5E5;
  --size-off:#A9AAA8;
  --ok:#4C9A6A;
  --low:#C9822B;
  --soft:rgba(13,28,56,.6);
  /* photo width: fits the window height and always leaves ~380px for the order card */
  --media-w:min(38vw, calc((100svh - var(--hdr-h) - 96px) * 2 / 3), calc(100vw - 2 * var(--gutter) - 96px - 760px));
}
body.pdp-page{background:var(--photo-bg)}

.pdp{
  display:grid;
  grid-template-columns:minmax(0,1fr) var(--media-w) minmax(0,1fr);
  grid-template-rows:minmax(72px, 20vh) 1fr;
  grid-template-areas:
    "back media ."
    ".    media buy";
  column-gap:clamp(24px, 3vw, 48px);
  padding:28px var(--gutter) 32px;
}

.pdp-back{
  grid-area:back;align-self:start;justify-self:start;
  text-decoration:none;display:inline-flex;gap:6px;align-items:center;
}
.pdp-back:hover span:last-child{text-decoration:underline;text-underline-offset:4px}

/* ---------- gallery ---------- */
.pdp-media{grid-area:media;min-width:0}
.gallery{
  position:relative;aspect-ratio:2/3;max-width:100%;
  background:var(--photo-bg);overflow:hidden;
}
.gallery-track{
  display:flex;height:100%;
  overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;scrollbar-width:none;
  overscroll-behavior-x:contain;
}
.gallery-track::-webkit-scrollbar{display:none}
.gallery-track.is-dragging{scroll-snap-type:none;cursor:grabbing}
.gallery-track:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
.slide{flex:0 0 100%;height:100%;scroll-snap-align:start;scroll-snap-stop:always}
.slide img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-drag:none;pointer-events:none}
@media (hover:hover){ .gallery-track{cursor:e-resize} }

.gallery-bar{
  position:absolute;left:12px;right:8px;bottom:8px;
  display:flex;align-items:center;gap:8px;
}
.gallery-progress{flex:1 1 auto;display:flex;gap:4px;min-width:0}
.seg{
  flex:1 1 0;height:16px;padding:0;margin:0;border:0;background:none;cursor:pointer;
  display:flex;align-items:center;
}
.seg .bar{position:relative;display:block;width:100%;height:2px;background:rgba(13,28,56,.16);overflow:hidden}
.seg .fill{position:absolute;inset:0;background:rgba(13,28,56,.75);transform:scaleX(0);transform-origin:left}
.seg.is-done .fill{transform:scaleX(1)}
.seg.is-active .fill{animation:seg-fill var(--dur, 4.5s) linear forwards}
.gallery.is-paused .seg.is-active .fill{animation-play-state:paused}
@keyframes seg-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}

.gallery-toggle{
  flex:none;width:28px;height:28px;padding:0;border:0;background:none;cursor:pointer;color:var(--ink);
  display:flex;align-items:center;justify-content:center;
}
.gallery-toggle svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.gallery-toggle .i-play{display:none}
.gallery.is-paused .gallery-toggle .i-play{display:block}
.gallery.is-paused .gallery-toggle .i-pause{display:none}
.gallery.single .gallery-bar{display:none}

.pdp-model{
  margin:12px 0 0;color:var(--ink);
  display:flex;align-items:center;justify-content:center;gap:8px;
}
.pdp-model svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round}

/* ---------- order card (liquid glass) ---------- */
.pdp-buy{
  grid-area:buy;align-self:start;justify-self:end;
  width:calc(100% + 40px);max-width:460px;margin-left:-40px;   /* reaches into the empty grey beside the photo */
  padding:22px 20px 20px;border-radius:6px;
  --glass-blur:22px;
  --glass-bg:rgba(255,255,255,.42);
  --glass-edge:rgba(255,255,255,.75);
  --glass-hi:rgba(255,255,255,.95);
  box-shadow:inset 0 0 0 1px var(--glass-edge), inset 0 1px 0 var(--glass-hi), 0 26px 50px -30px rgba(13,28,56,.28);
}

.pdp-head{display:flex;justify-content:space-between;align-items:baseline;gap:16px}
.pdp-name{margin:0;font-size:15px;font-weight:500;letter-spacing:.06em;line-height:1.3;text-wrap:balance;min-width:0}
.pdp-price{margin:0;font-size:15px;letter-spacing:.06em;white-space:nowrap;font-variant-numeric:tabular-nums}
.pdp-colorway{margin:6px 0 0;color:var(--soft)}
.pdp-fabric{margin:6px 0 0;display:flex;align-items:center;gap:6px;font-size:var(--fs-s);color:var(--soft)}
.pdp-fabric svg{width:12px;height:12px;flex:none;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}

.pdp-sizes-row{display:flex;justify-content:space-between;align-items:center;gap:6px 16px;flex-wrap:wrap;margin:26px 0 12px;min-height:26px}
.pdp-sizes{display:flex;flex-wrap:wrap;gap:6px 18px}
.pdp-size{
  background:none;border:0;padding:4px 0;cursor:pointer;color:var(--ink);
  text-underline-offset:5px;text-decoration-thickness:1px;
}
.pdp-size:hover,
.pdp-size[aria-pressed="true"]{text-decoration:underline}
.pdp-size[aria-pressed="true"]{font-weight:500}
.pdp-size:disabled{color:var(--size-off);cursor:default;text-decoration:none}
.pdp-sizes-row.needs-size .pdp-size:not(:disabled){animation:nudge .4s ease 2}
@keyframes nudge{50%{transform:translateY(-3px)}}
/* one-size items have no size row: keep the same gap above the button */

.pdp-add{
  width:100%;display:flex;justify-content:center;align-items:center;gap:8px;
  padding:11px 14px;border:0;background:var(--ink);color:var(--white);cursor:pointer;
  line-height:20px;
}
.pdp-add:disabled{background:var(--size-off);cursor:default}
.pdp-add svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}

.pdp-msg{margin:8px 0 0}
.pdp-msg:empty{display:none}
.pdp-msg.warn{color:#8A2F2F}

.pdp-stock{margin:0 0 0 auto;display:flex;align-items:center;gap:8px;white-space:nowrap}
.pdp-stock .dot{width:6px;height:6px;border-radius:50%;background:var(--ok);flex:none}
.pdp-stock.is-low .dot{background:var(--low)}
.pdp-stock.is-out .dot{background:var(--size-off)}

/* heart sits at the end of the tab row */
.pdp-wish{
  margin-left:auto;width:28px;height:28px;padding:0;border:0;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  background:none;cursor:pointer;color:var(--ink);
  transition:background-color .2s ease, box-shadow .2s ease;
}
.pdp-wish svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;transition:fill .15s ease}
.pdp-wish[aria-pressed="true"] svg{fill:currentColor}
.pdp-wish:hover,
.pdp-wish:focus-visible{background:rgba(255,255,255,.6);box-shadow:inset 0 0 0 1px rgba(255,255,255,.9);outline:none}

/* ---------- info tabs (Arte style: side by side, open just below) ---------- */
.pdp-info{margin-top:16px}
.pdp-tabs{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px}
.pdp-tab{
  display:inline-flex;align-items:center;gap:5px;
  background:none;border:0;padding:3px 0;cursor:pointer;color:var(--ink);font-size:var(--fs-s);letter-spacing:.08em;
}
.pdp-tab:focus{outline:none}
.pdp-tab:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
.tab-icon{position:relative;width:14px;height:14px;border-radius:50%;background:rgba(255,255,255,.75);box-shadow:inset 0 0 0 1px rgba(255,255,255,.9);flex:none}
.tab-icon::before,.tab-icon::after{
  content:"";position:absolute;left:4px;right:4px;top:6.5px;height:1px;background:var(--ink);
  transition:transform .2s ease;
}
.tab-icon::after{transform:rotate(90deg)}
.pdp-tab[aria-expanded="true"] .tab-icon::after{transform:rotate(0)}
.pdp-panel{margin-top:14px;font-size:13px;line-height:1.55;text-transform:none;letter-spacing:normal}
.pdp-panel p{margin:0 0 8px}
.pdp-panel p:last-child{margin-bottom:0}
.pdp-panel ul{margin:0;padding-left:16px}
.pdp-panel li{margin:2px 0}
.pdp-panel .muted{color:var(--muted)}

.pdp-missing{padding:80px var(--gutter);display:flex;flex-direction:column;gap:12px;align-items:flex-start}
.pdp-missing p{margin:0}

/* small laptops: a little tighter so the tabs + heart stay on one line */
@media (min-width:1300px) and (max-width:1365px){
  .pdp-buy{padding-inline:16px}
  .pdp-tabs{column-gap:10px}
}

/* ---------- tablet: photo left, column right ---------- */
@media (max-width:1299px){
  .pdp{
    grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);
    grid-template-rows:auto 1fr;
    grid-template-areas:
      "back  back"
      "media buy";
    column-gap:32px;
  }
  .pdp-back{margin-bottom:18px}
  .pdp-buy{justify-self:stretch;width:100%;max-width:none;margin-left:0}
}

/* ---------- phone: one column, photo edge to edge ---------- */
@media (max-width:699px){
  .pdp{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:none;
    grid-template-areas:"back" "media" "buy";
    padding-top:14px;
  }
  .pdp-back{margin-bottom:12px}
  .pdp-media{margin-inline:calc(-1 * var(--gutter))}
  .pdp-model{padding-inline:var(--gutter)}
  .pdp-buy{margin-top:16px;padding:18px 16px 16px}
  .pdp-sizes-row{margin-top:22px}
}

@media (prefers-reduced-motion:reduce){
  .seg.is-active .fill{animation:none;transform:scaleX(1)}
}
