/* index.html: single-viewport landing page for The Hurma Jeans.
   Desktop never scrolls: html/body are locked to the viewport height and
   the brand story lives inside the #storyOverlay dialog. Mobile scrolls as
   a normal page with the "Sign up for presale" button pinned to the bottom
   of the screen.
   Uses the shared --bg/--text/--muted/--border tokens. Dark by default; the
   header's BA mark toggles light mode (data-theme="light" on <html>, set by an
   inline script in index.html before paint, same storage key as the legal
   pages). The green header bar keeps its own palette in both themes. */

/* Instrument Serif is loaded by a <link> in index.html (an @import here
   would delay it until this file downloads). */

:root {
  --bg: #0c0b09;
  --brand-green: #585944;
  --text: #f2f0eb;
  --muted: #a8a196;
  /* Dimmer secondary text that still meets WCAG AA (4.5:1) on --bg. */
  --faint: #8a847a;
  --border: #35322b;
  --section-bg: rgba(255, 255, 255, 0.04);
  --input-bg: #000000;
  --input-border: #3a372f;
  --danger: #ff6b6b;
  /* Text on the brand-green button: light in both themes. */
  --on-brand: #f2f0eb;
  /* Fully transparent --bg, for the fade above the pinned button bar. */
  --bg-fade: rgba(12, 11, 9, 0);
  --overlay-bg: rgba(6, 5, 4, 0.96);
  --lightbox-bg: rgba(4, 3, 2, 0.97);
  --lightbox-btn-bg: rgba(0, 0, 0, 0.5);
  /* Instagram / TikTok icons are white artwork; light mode inverts them. */
  --icon-filter: none;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Light palette: same tokens as the light theme of privacy.html / faq.html. */
:root[data-theme="light"] {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #666666;
  --faint: #767676;
  --border: #eaeaea;
  --section-bg: rgba(0, 0, 0, 0.03);
  --input-bg: #ffffff;
  --input-border: #cfcfcf;
  --danger: #c62828;
  --bg-fade: rgba(255, 255, 255, 0);
  --overlay-bg: rgba(255, 255, 255, 0.99);
  --lightbox-bg: rgba(255, 255, 255, 0.98);
  --lightbox-btn-bg: rgba(255, 255, 255, 0.7);
  --icon-filter: invert(1);
  color-scheme: light;
}

:root:not([data-theme="light"]) {
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

/* ---------- Main split ---------- */
.ps-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 52svh 1fr;
}

@media (min-width: 900px) {
  .ps-main {
    grid-template-columns: 60% 1fr;
    grid-template-rows: 1fr;
  }
}

/* ---------- Hero panel (left) ---------- */
.ps-hero {
  min-height: 0;
  background: #000 url("../branding/hero.webp") left center / cover no-repeat;
}

@media (max-width: 899px) {
  .ps-hero {
    background-image: url("../branding/hero%20mobile.webp");
    background-position: calc(50% - 6px) center;
  }
}

/* ---------- Commerce panel ---------- */
.ps-panel {
  grid-row: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px calc(16px + var(--safe-bottom)) 20px;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  .ps-panel {
    grid-row: 1;
    grid-column: 2;
    border-top: none;
    border-left: 1px solid var(--border);
    padding: 20px 32px;
    /* "safe" pins content to the top rather than clipping the story line
       if it is ever taller than the panel. */
    justify-content: safe center;
  }
}

.ps-story-line {
  display: none;
}

@media (min-width: 900px) {
  .ps-story-line {
    display: block;
    font-size: 11px;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin-bottom: 10px;
    min-height: 16px;
  }

  /* All captions share one grid cell; only the active one is visible, so the
     cell is always the width of the longest caption. */
  #psStoryLineText {
    display: inline-grid;
  }

  #psStoryLineText > span {
    grid-area: 1 / 1;
    visibility: hidden;
  }

  #psStoryLineText > span.is-active {
    visibility: visible;
  }

}

/* "Read the story" sits right after the product name on desktop (mobile has
   its own trigger link). */
#readStoryBtn {
  display: none;
}

@media (min-width: 900px) {
  .ps-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 14px;
  }

  .ps-title-row .ps-product-price {
    flex-basis: 100%;
  }

  #readStoryBtn {
    display: inline-block;
    background: none;
    border: 0;
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.6px;
    padding: 0;
  }
}

/* ---------- Model set switcher: [ Name | Name ] ---------- */
.ps-set-switch {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Three-column grid keeps the "|" dead centre (under the gap between the two
   photos); no brackets. */
.ps-set-switch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.ps-set-switch button:first-of-type {
  justify-self: end;
}

.ps-set-switch button:last-of-type {
  justify-self: start;
}

.ps-set-switch-sep {
  opacity: 0.6;
}

.ps-set-switch button {
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--muted);
  padding: 6px 4px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ps-set-switch button:hover,
.ps-set-switch button:focus-visible {
  color: var(--text);
}

.ps-set-switch button[aria-pressed="true"] {
  color: var(--text);
  font-weight: 700;
}

.ps-set-switch button:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

/* ---------- Model tiles ---------- */
.ps-model-tiles {
  display: flex;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.25s ease;
}

.ps-model-tiles.is-fading {
  opacity: 0;
}

.ps-model-tile {
  aspect-ratio: 4 / 5;
  position: relative;
  min-width: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.ps-model-tile:hover,
.ps-model-tile:focus-visible {
  border-color: var(--muted);
}

.ps-model-tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ps-model-tile-placeholder {
  padding: 8px;
  text-align: center;
}

/* Mobile: tiles sit below the name/price inside the scrolling panel, so
   those stay first and the pinned button bar is unaffected. */
@media (max-width: 899px) {
  .ps-set-switch,
  .ps-model-tiles,
  .ps-story-trigger-mobile {
    order: 1;
  }

  .ps-buy-bar {
    order: 2;
  }

  .ps-set-switch {
    margin-top: 2px;
  }

  .ps-model-tiles {
    margin-bottom: 10px;
  }

  .ps-model-tile {
    flex: 0 1 calc((100% - 8px) / 2);
    max-width: 200px;
  }

  .ps-story-trigger-mobile {
    align-self: center;
  }
}

@media (min-width: 900px) {
  /* The tiles show the photos uncropped at their native 4:5 ratio and are
     the only flexible item in the panel. max-height is the full-width
     size (two tiles across the panel's content box); on a viewport too
     short for that, the row gets shorter and each tile's width follows
     its height via aspect-ratio, so the photos scale down (centred).
     min-height keeps them visible on short windowed laptop screens. */
  .ps-model-tiles {
    flex: 1 1 0;
    min-height: 140px;
    max-height: calc((40vw - 64px - 8px) / 2 * 5 / 4);
    margin-bottom: 14px;
  }

  .ps-model-tile {
    flex: 0 1 auto;
    height: 100%;
  }
}

.ps-product-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
  margin-bottom: 6px;
}

.ps-product-price {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Price parts and region buttons (styled by currency.js with opacity, which
   drops below AA): dim with --faint instead. */
.ps-product-price .price-was,
.ps-product-price .price-note {
  opacity: 1;
  color: var(--faint);
}

.ps-panel .currency-btn {
  opacity: 1;
  color: var(--faint);
}

.ps-panel .currency-btn[aria-pressed="true"] {
  color: var(--text);
}

.ps-presale-line {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.ps-presale-line strong {
  color: var(--text);
  font-weight: 600;
}

.ps-terms-link {
  font-size: 10px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
  margin-bottom: 16px;
}

.ps-terms-link:hover,
.ps-terms-link:focus-visible {
  color: var(--text);
}

.soldout-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 2px;
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.ps-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.btn {
  width: 100%;
  min-height: 46px;
  padding: 13px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--brand-green);
  border: 1px solid var(--border);
  color: var(--on-brand);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-line {
  min-height: 16px;
  font-size: 11px;
  color: var(--muted);
}

.status-line.status-alert {
  color: var(--danger);
}

/* Only used for a load error; no empty gap under the button otherwise. */
.status-line:empty {
  display: none;
}

/* Mobile: the whole page scrolls normally, while the button + status line
   stay pinned to the bottom of the screen (sticky inside the panel, which
   runs to the end of the page) so "Sign up for updates" is always
   reachable. */
@media (max-width: 899px) {
  html,
  body {
    height: auto;
    min-height: 100svh;
    /* clip, not hidden: hidden would make body a scroll container and the
       sticky button bar would stick to it instead of the screen. */
    overflow: visible;
    overflow-x: clip;
  }

  html.ps-overlay-open,
  html.ps-overlay-open body {
    overflow: hidden;
  }

  .ps-main {
    grid-template-rows: 52svh auto;
  }

  .ps-panel {
    overflow: visible;
    padding-bottom: 0;
  }

  .ps-buy-bar {
    position: sticky;
    /* Lift above the cookie banner while it's showing (set by consent.js). */
    bottom: var(--ba-cookie-h, 0px);
    z-index: 1;
    margin-top: auto;
    padding-top: 4px;
    padding-bottom: calc(12px + var(--safe-bottom));
    background: var(--bg);
  }

  /* Fade above the bar hints that details scroll behind it. */
  .ps-buy-bar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 16px;
    background: linear-gradient(to bottom, var(--bg-fade), var(--bg));
    pointer-events: none;
  }
}

/* Phones in landscape: side-by-side split like desktop, otherwise the panel
   under the photo is shorter than the pinned button. */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  .ps-main {
    grid-template-columns: 50% 1fr;
    grid-template-rows: auto;
  }

  .ps-hero {
    position: sticky;
    top: 71px;
    align-self: start;
    height: calc(100svh - 71px);
  }

  .ps-panel {
    grid-row: 1;
    grid-column: 2;
    border-top: none;
    border-left: 1px solid var(--border);
  }
}

/* Mobile: privacy/terms sit just above the company line at the end of the
   panel (the legal-entity footer is order 99). */
.ps-footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  order: 98;
  margin-top: 16px;
}

.ps-footer-links a {
  font-size: 9px;
  letter-spacing: 0.6px;
  color: var(--muted);
  text-decoration: none;
}

@media (min-width: 900px) {
  .ps-footer-links {
    justify-content: flex-start;
    order: 0;
    gap: 14px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .ps-footer-links a {
    font-size: 9px;
    letter-spacing: 0.6px;
    color: var(--muted);
    text-decoration: none;
  }

  .ps-footer-links a:hover,
  .ps-footer-links a:focus-visible {
    color: var(--text);
  }
}

/* Desktop compaction: tighter commerce block so the 4:5 model tiles fit
   at full size in a windowed browser (taskbar + browser chrome). */
@media (min-width: 900px) {
  .ps-product-name {
    font-size: clamp(28px, 3vw, 40px);
    margin-bottom: 4px;
  }

  .ps-product-price {
    margin-bottom: 6px;
  }

  .ps-presale-line {
    margin-bottom: 2px;
  }

  .ps-terms-link {
    margin-bottom: 12px;
  }

  .ps-actions {
    gap: 6px;
    margin-bottom: 6px;
  }

  .btn {
    min-height: 42px;
    padding: 11px;
  }

  .ps-footer-links {
    margin-top: 8px;
    padding-top: 8px;
  }
}

/* Short desktop windows (laptops with browser chrome + taskbar): reflow the
   commerce block into fewer rows so the model tiles keep most of the height.
   Name + price share a row and the availability line sits on its own. */
@media (min-width: 900px) and (max-height: 800px) {
  .ps-panel {
    padding-top: 14px;
    padding-bottom: 14px;
    overflow-y: auto;
  }

  .ps-story-line {
    margin-bottom: 8px;
  }

  .ps-model-tiles {
    margin-bottom: 10px;
  }

  .ps-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 14px;
    margin-bottom: 4px;
  }

  .ps-product-name {
    font-size: clamp(26px, 2.4vw, 34px);
    margin-bottom: 0;
  }

  .ps-product-price {
    margin-bottom: 0;
  }

  .ps-title-row .ps-product-price {
    flex-basis: auto;
  }

  .ps-meta-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 10px;
    margin-bottom: 10px;
  }

  .ps-presale-line,
  .ps-terms-link {
    margin-bottom: 0;
  }

  .btn {
    min-height: 40px;
    padding: 10px;
  }
}

/* Mobile: open the Story overlay instead of showing inline model tiles/story line. */
.ps-story-trigger-mobile {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 10px;
  cursor: pointer;
}

@media (min-width: 900px) {
  .ps-story-trigger-mobile {
    display: none;
  }
}

/* ---------- Story overlay ---------- */
.ps-overlay {
  position: fixed;
  inset: 0;
  height: 100svh;
  z-index: 100;
  display: none;
  background: var(--overlay-bg);
  color: var(--text);
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
  flex-direction: column;
}

.ps-overlay.open {
  display: flex;
}

.ps-overlay-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.ps-overlay-header .ps-set-switch {
  margin: 0 8px;
}

/* Mobile: title left, model switch truly centred, close pinned top right. */
@media (max-width: 699px) {
  .ps-overlay-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .ps-overlay-header .ps-set-switch {
    margin: 0;
    order: 0; /* the mobile page layout gives .ps-set-switch order: 1 */
    justify-self: center;
  }

  .ps-overlay-close {
    justify-self: end;
  }
}

.ps-overlay-photos {
  transition: opacity 0.25s ease;
}

.ps-overlay-photos.is-fading {
  opacity: 0;
}

.ps-overlay-title {
  font-family: var(--font-display);
  font-size: 20px;
}

.ps-overlay-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

.ps-overlay-close:hover,
.ps-overlay-close:focus-visible {
  border-color: var(--text);
}

.ps-overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  gap: 16px;
}

@media (min-width: 700px) {
  /* Photos get most of the width; the story is a narrow column. */
  .ps-overlay-body {
    grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
}

.ps-overlay-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  min-height: 0;
}

.ps-overlay-photos img,
.ps-overlay-photos .ps-overlay-photo-placeholder {
  flex: 0 0 78%;
  scroll-snap-align: start;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.ps-overlay-photos img:nth-child(1) {
  object-position: 53% top;
}

.ps-overlay-photos img:nth-child(2) {
  object-position: 47% top;
}

/* Desktop: the first two photos side by side, uncropped at their native 4:5,
   no scrolling. With width/height auto, max-width + max-height scale each
   image down to whichever limit it hits first while keeping its ratio. Extra
   photos live in the album thumbnails beside the story instead. */
@media (min-width: 700px) {
  .ps-overlay-photos {
    overflow: hidden;
    scroll-snap-type: none;
    justify-content: center;
    align-items: flex-start;
  }

  .ps-overlay-photos img {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    max-width: calc(50% - 4px);
    max-height: 100%;
    object-fit: contain;
  }

  .ps-overlay-photos img:nth-child(n + 3) {
    display: none;
  }

  .ps-overlay-photos .ps-overlay-photo-placeholder {
    flex: 0 0 calc(50% - 4px);
  }

  .ps-overlay-story {
    font-size: 13px;
    line-height: 1.7;
  }

  .ps-overlay-story p:first-child {
    font-size: 18px;
  }
}

.ps-overlay-side {
  min-height: 0;
  overflow-y: auto;
}

.ps-overlay-story {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.ps-overlay-story p {
  margin-bottom: 14px;
}

.ps-overlay-story p:first-child {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
}

.ps-specs-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  margin: 22px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ps-specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.ps-specs dt {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding-top: 2px;
}

.ps-specs dd {
  color: var(--text);
}

.ps-overlay-footer {
  margin-top: 14px;
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ps-overlay-back {
  background: none;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 10px 18px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
}

.ps-loading,
.ps-error {
  padding: 14px 20px;
  font-size: 12px;
  color: var(--muted);
}

.ps-error a {
  color: var(--text);
  text-decoration: underline;
}

/* Region switcher inside the panel on narrow screens; the header holds it on desktop. */
.ps-panel > .currency-switch--page {
  margin: 4px 0 8px;
}

/* Region switcher sits under the price on every screen size. */
@media (min-width: 900px) {
  .ps-panel > .currency-switch.currency-switch--page {
    display: inline-flex;
  }
}

/* Footer: desktop gets a full-width bar under the split; mobile keeps the
   links, socials and company line at the end of the panel. */
.ps-site-footer {
  display: none;
}

.ps-panel > .ps-social--footer {
  order: 98;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

.ps-social--footer img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.75;
  filter: var(--icon-filter);
}

.ps-social--footer a:hover img,
.ps-social--footer a:focus-visible img {
  opacity: 1;
}

@media (min-width: 900px) {
  .ps-panel > .ps-footer-links,
  .ps-panel > .ps-social--footer,
  .ps-panel > .legal-entity--presale {
    display: none;
  }

  .ps-site-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 32px calc(10px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg);
    font-size: 10px;
    letter-spacing: 0.4px;
    color: var(--muted);
  }

  .ps-site-footer .ps-footer-links {
    margin: 0;
    padding: 0;
    border: 0;
    order: 0;
    flex: 0 0 auto;
  }

  .ps-site-footer-entity {
    margin: 0;
    flex: 1 1 auto;
    text-align: center;
  }

  .ps-site-footer-entity a {
    color: inherit;
    text-decoration: underline;
  }

  .ps-site-footer .ps-social--footer {
    flex: 0 0 auto;
    gap: 14px;
  }
}

/* Desktop: "Read the story" sits on the caption row, centred on the gap
   between the two model photos (left offset set in presale.js). */
@media (min-width: 900px) {
  .ps-story-line {
    position: relative;
  }

  #readStoryBtn {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }
}

/* Desktop: the hero column widens to the artwork's 3:2 shape (height of the
   split x 1.5) so it fills the column with little or no cropping and no bars,
   never below 60% and never leaving the product panel under 520px. */
@media (min-width: 900px) {
  .ps-main {
    grid-template-columns: clamp(60%, calc((100svh - 64px) * 1.5), calc(100% - 520px)) 1fr;
  }
}

/* Desktop: the split fills the first screen and the footer sits below the
   fold; the page scrolls to reach it. */
@media (min-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100svh;
    overflow: visible;
    overflow-x: clip;
  }

  html.ps-overlay-open,
  html.ps-overlay-open body {
    overflow: hidden;
  }

  .ps-main {
    flex: 0 0 auto;
    height: calc(100svh - 64px);
  }

  .ps-site-footer {
    padding-top: 8px;
    padding-bottom: calc(8px + var(--safe-bottom));
    font-size: 9px;
  }

  .ps-site-footer .ps-social--footer img {
    width: 16px;
    height: 16px;
  }
}

/* Mobile: the story link sits above the photos and the JBIZ / SYLVIE switch
   below them (order only; DOM order is unchanged for desktop). */
@media (max-width: 899px) {
  .ps-panel > .ps-story-trigger-mobile {
    order: 1;
  }

  .ps-panel > .ps-model-tiles {
    order: 2;
  }

  .ps-panel > .ps-set-switch {
    order: 3;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .ps-panel > .ps-buy-bar {
    order: 4;
  }
}

/* Album thumbnails (desktop only): extra photos under the story; click opens
   the lightbox. */
.ps-overlay-album {
  display: none;
}

@media (min-width: 700px) {
  .ps-overlay-album {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 22px;
    padding-bottom: 4px;
  }

  .ps-overlay-album:empty {
    display: none;
  }

  .ps-album-thumb {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--section-bg);
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 4 / 5;
  }

  .ps-album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9;
    transition: opacity 0.2s ease;
  }

  .ps-album-thumb:hover img,
  .ps-album-thumb:focus-visible img {
    opacity: 1;
  }

  .ps-album-thumb:focus-visible {
    outline: 1px solid var(--text);
    outline-offset: 2px;
  }
}

/* ---------- Album lightbox ---------- */
.ps-lightbox {
  position: fixed;
  inset: 0;
  height: 100svh;
  z-index: 110;
  display: none;
  flex-direction: column;
  background: var(--lightbox-bg);
  color: var(--text);
}

.ps-lightbox.open {
  display: flex;
}

.ps-lightbox-top {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.ps-lightbox-track {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.ps-lightbox-track::-webkit-scrollbar {
  display: none;
}

.ps-lightbox-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 72px 20px;
  box-sizing: border-box;
  min-width: 0;
}

.ps-lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.ps-lightbox-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ps-lightbox-btn:hover,
.ps-lightbox-btn:focus-visible {
  border-color: var(--text);
}

.ps-lightbox-prev,
.ps-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.ps-lightbox-prev {
  left: 20px;
}

.ps-lightbox-next {
  right: 20px;
}

.ps-lightbox-btn[disabled] {
  opacity: 0.3;
  cursor: default;
}

@media (max-width: 699px) {
  .ps-lightbox-slide {
    padding: 0 12px 16px;
  }
}

.ps-overlay-photo-zoom {
  cursor: zoom-in;
}

/* Phones swipe the album; the arrow buttons stay but sit smaller at the edges. */
@media (max-width: 699px) {
  .ps-lightbox-prev,
  .ps-lightbox-next {
    width: 32px;
    height: 32px;
    background: var(--lightbox-btn-bg);
  }

  .ps-lightbox-prev {
    left: 8px;
  }

  .ps-lightbox-next {
    right: 8px;
  }
}

/* "Questions? Read the FAQ" link at the end of the story overlay */
.ps-overlay-footer {
  align-items: center;
}

.ps-overlay-faq-link {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.ps-overlay-faq-link:hover,
.ps-overlay-faq-link:focus-visible {
  color: var(--text);
}

/* Phones: the story overlay scrolls as one page (full, uncropped photos, then
   the story underneath), while the header and the "Back to the jeans" footer
   stay pinned on screen. */
@media (max-width: 699px) {
  .ps-overlay-body {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .ps-overlay-photos {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .ps-overlay-photos img,
  .ps-overlay-photos .ps-overlay-photo-placeholder {
    flex: 0 0 auto;
    width: 86%;
    min-width: 0;
    height: auto;
    object-fit: contain;
  }

  .ps-overlay-photos .ps-overlay-photo-placeholder {
    aspect-ratio: 4 / 5;
  }

  .ps-overlay-side {
    overflow: visible;
  }

  .ps-overlay-footer {
    flex: 0 0 auto;
    align-self: stretch;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
}
