/* PDP gallery fit: keep the editorial gallery visible without changing the
   shared storefront/admin stylesheet. The frame keeps its stable 3:4 shape;
   only its outer size is capped by the viewport. */
.pdp-main-image--portrait { background: #f1eee8; }
.pdp-main-image--portrait img { object-fit: contain; }
.pdp-main-image[role="button"] { cursor: zoom-in; }
.pdp-main-image[role="button"]:focus-visible {
  outline: 2px solid #a87935;
  outline-offset: 4px;
}

/* Fullscreen product gallery. The source image is never modified; this is a
   separate viewing surface so visitors can inspect details without leaving
   the product page. */
.pdp-lightbox[hidden] { display: none !important; }
.pdp-lightbox .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pdp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: stretch;
  color: #fff;
  overflow: hidden;
}
.pdp-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, .92);
}
.pdp-lightbox-dialog {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  padding: clamp(14px, 2vw, 30px);
  gap: 12px;
  overflow: hidden;
}
.pdp-lightbox-stage {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: auto;
  margin: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.pdp-lightbox-stage img {
  display: block;
  /* Percentage max-height does not constrain a replaced element reliably in
     this grid. Give the image the stage's exact box and contain its pixels. */
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  user-select: none;
}
.pdp-lightbox-close,
.pdp-lightbox-arrow {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s;
}
.pdp-lightbox-close:hover,
.pdp-lightbox-arrow:hover,
.pdp-lightbox-close:focus-visible,
.pdp-lightbox-arrow:focus-visible {
  border-color: #fff;
  background: rgba(255,255,255,.18);
}
.pdp-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font: 300 30px/1 var(--serif);
}
.pdp-lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 64px;
  border-radius: 999px;
  font: 300 44px/1 var(--serif);
  transform: translateY(-50%);
}
.pdp-lightbox-arrow:hover,
.pdp-lightbox-arrow:focus-visible { transform: translateY(-50%) scale(1.04); }
.pdp-lightbox-arrow:disabled { opacity: .35; cursor: default; }
.pdp-lightbox-prev { left: clamp(8px, 2vw, 32px); }
.pdp-lightbox-next { right: clamp(8px, 2vw, 32px); }
.pdp-lightbox-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  width: 100%;
  min-height: 70px;
  max-height: 90px;
}
.pdp-lightbox-count {
  flex: 0 0 auto;
  min-width: 50px;
  font: 500 11px/1 var(--sans);
  letter-spacing: .08em;
  text-align: center;
}
.pdp-lightbox-thumbs {
  flex: 1 1 auto;
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: none;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 3px 2px 7px;
  scrollbar-width: thin;
}
.pdp-lightbox-thumbs button {
  flex: 0 0 58px;
  width: 58px;
  height: 70px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  opacity: .58;
  background: #2b251f;
  cursor: pointer;
}
.pdp-lightbox-thumbs button:hover,
.pdp-lightbox-thumbs button:focus-visible,
.pdp-lightbox-thumbs button.active { opacity: 1; border-color: #fff; }
.pdp-lightbox-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
body.pdp-lightbox-open { overflow: hidden; }

@media (max-width: 680px) {
  .pdp-lightbox-dialog {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding: max(52px, env(safe-area-inset-top)) 8px max(12px, env(safe-area-inset-bottom));
    gap: 4px;
  }
  .pdp-lightbox-stage { flex-basis: 0; }
  .pdp-lightbox-arrow { width: 38px; height: 54px; font-size: 36px; }
  .pdp-lightbox-prev { left: 4px; }
  .pdp-lightbox-next { right: 4px; }
  .pdp-lightbox-footer { gap: 8px; min-height: 60px; max-height: 72px; }
  .pdp-lightbox-count { min-width: 43px; font-size: 10px; }
  .pdp-lightbox-thumbs button { flex-basis: 50px; width: 50px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-lightbox-close, .pdp-lightbox-arrow { transition: none; }
}

@media (min-width: 861px) {
  .pdp-editorial-layout .pdp-gallery { min-width: 0; }
  .pdp-editorial-layout .pdp-main-image,
  .pdp-editorial-layout .pdp-thumbs {
    /* Restore a generous desktop preview: the stable 3:4 frame is roughly
       80% of the visible viewport height while remaining inside the column. */
    width: min(100%, 42vw, 60svh);
    max-width: 100%;
    margin-inline: auto;
  }
}

@media (max-width: 860px) {
  .pdp-editorial-layout .pdp-main-image {
    width: min(100%, 92vw, 58svh);
    max-width: 100%;
    margin-inline: auto;
  }
}
