/* ===========================================================================
   pdp-zoom.css
   Product gallery, four-angle switcher, colorway swatch hover preview,
   inline size chart, inline shipping and returns, and the full resolution
   zoom lightbox used on every Bourbon Room product page.
   Round 14, Seat 4 (merchandise and ecommerce).
   =========================================================================== */

/* ---------- stage ---------- */
.pdp-stage {
  position: relative;
}

.pdp-zoom-trigger {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--color-border, #2A2824);
  border-radius: 6px;
  background: #0E0E0C;
  cursor: zoom-in;
  overflow: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.pdp-zoom-trigger picture,
.pdp-zoom-trigger img {
  display: block;
  width: 100%;
  height: auto;
}

.pdp-zoom-trigger:focus-visible {
  outline: 2px solid var(--brass-bright, #B8942A);
  outline-offset: 3px;
}

.pdp-zoom-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 226, 213, 0.22);
  background: rgba(14, 14, 12, 0.72);
  color: #E8E2D5;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ---------- four angle thumbnails ---------- */
.pdp-angles {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.pdp-angle {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-border, #2A2824);
  border-radius: 4px;
  background: #0E0E0C;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.pdp-angle img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.pdp-angle-label {
  display: block;
  padding: 0.3rem 0.2rem 0.4rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted, #A8A092);
}

.pdp-angle:hover {
  border-color: var(--brass-bright, #B8942A);
  transform: translateY(-2px);
}

.pdp-angle.is-active {
  border-color: var(--oxblood-bright, #A0282A);
}

.pdp-angle.is-active .pdp-angle-label {
  color: var(--brass-bright, #B8942A);
}

.pdp-angle:focus-visible {
  outline: 2px solid var(--brass-bright, #B8942A);
  outline-offset: 2px;
}

/* ---------- colorway swatch hover preview ---------- */
.pdp-swatch {
  position: relative;
}

.pdp-swatch-preview {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.6rem);
  transform: translate(-50%, 6px);
  width: 132px;
  padding: 6px;
  border: 1px solid var(--color-border, #2A2824);
  border-radius: 6px;
  background: #0E0E0C;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 30;
  pointer-events: none;
}

.pdp-swatch-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}

.pdp-swatch-preview span {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--brass-bright, #B8942A);
}

.pdp-swatch:hover .pdp-swatch-preview,
.pdp-swatch:focus-visible .pdp-swatch-preview {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (hover: none) {
  .pdp-swatch-preview { display: none; }
}

/* ---------- inline size chart ---------- */
.size-guide {
  margin-top: var(--space-5, 1.5rem);
  border: 1px solid var(--color-border, #2A2824);
  border-radius: 6px;
  background: rgba(232, 226, 213, 0.03);
  padding: var(--space-4, 1rem);
}

.size-guide h2,
.size-guide h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-bright, #B8942A);
  font-weight: 600;
}

.size-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.size-guide-table caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 0.5rem;
  font-size: 0.78rem;
  color: var(--color-text-muted, #A8A092);
}

.size-guide-table th,
.size-guide-table td {
  padding: 0.42rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(42, 40, 36, 0.9);
  white-space: nowrap;
}

.size-guide-table thead th {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-bright, #B8942A);
}

.size-guide-table tbody th {
  font-weight: 600;
  color: #E8E2D5;
}

.size-guide-note {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-muted, #A8A092);
}

.size-guide-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- inline shipping and returns ---------- */
.ship-return {
  margin-top: var(--space-5, 1.5rem);
  display: grid;
  gap: var(--space-3, 0.75rem);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ship-return-card {
  border: 1px solid var(--color-border, #2A2824);
  border-left: 2px solid var(--brass-bright, #B8942A);
  border-radius: 0 4px 4px 0;
  background: rgba(184, 148, 42, 0.04);
  padding: var(--space-4, 1rem);
}

.ship-return-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-bright, #B8942A);
}

.ship-return-card p,
.ship-return-card li {
  margin: 0 0 0.35rem;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #D8CFBE;
}

.ship-return-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* ---------- cross sell ---------- */
.pdp-crosssell {
  margin-top: var(--space-5, 1.5rem);
  display: grid;
  gap: var(--space-3, 0.75rem);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.pdp-crosssell a {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--color-border, #2A2824);
  border-radius: 6px;
  text-decoration: none;
  background: rgba(232, 226, 213, 0.03);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.pdp-crosssell a:hover {
  border-color: var(--brass-bright, #B8942A);
  transform: translateY(-2px);
}

.pdp-crosssell img {
  width: 56px;
  height: 74px;
  object-fit: cover;
  border-radius: 3px;
  flex: none;
  background: #0E0E0C;
}

.pdp-crosssell-copy strong {
  display: block;
  font-size: 0.9rem;
  color: #E8E2D5;
}

.pdp-crosssell-copy span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--color-text-muted, #A8A092);
}

/* ---------- size reminder capture ---------- */
.pdp-remind {
  margin-top: var(--space-4, 1rem);
  border: 1px dashed var(--color-border, #2A2824);
  border-radius: 6px;
  padding: var(--space-4, 1rem);
}

.pdp-remind p {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-text-muted, #A8A092);
}

.pdp-remind form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pdp-remind input[type="email"] {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--color-border, #2A2824);
  border-radius: 4px;
  background: #0E0E0C;
  color: #E8E2D5;
  font-size: 0.86rem;
}

/* ---------- PDP FAQ ---------- */
.pdp-faq {
  margin-top: var(--space-5, 1.5rem);
}

.pdp-faq details {
  border-bottom: 1px solid var(--color-border, #2A2824);
  padding: 0.7rem 0;
}

.pdp-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #E8E2D5;
  list-style: none;
}

.pdp-faq summary::-webkit-details-marker { display: none; }

.pdp-faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--brass-bright, #B8942A);
}

.pdp-faq details[open] summary::before { content: "\2212"; }

.pdp-faq details p {
  margin: 0.5rem 0 0 1.1em;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #D8CFBE;
}

/* ===========================================================================
   Zoom lightbox
   =========================================================================== */
.jgb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  background: rgba(8, 8, 7, 0.96);
}

.jgb-lightbox[data-open="true"] {
  display: block;
}

.jgb-lightbox-viewport {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* mobile: native pinch zoom plus one finger pan */
  touch-action: pinch-zoom pan-x pan-y;
  display: grid;
  place-items: center;
  cursor: zoom-in;
}

.jgb-lightbox-viewport.is-zoomed {
  cursor: grab;
  place-items: start;
}

.jgb-lightbox-viewport.is-panning {
  cursor: grabbing;
}

.jgb-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100vh;
  width: auto;
  height: auto;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

.jgb-lightbox-viewport.is-zoomed .jgb-lightbox-img {
  max-width: none;
  max-height: none;
}

.jgb-lightbox-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(to bottom, rgba(8, 8, 7, 0.92), rgba(8, 8, 7, 0));
  pointer-events: none;
}

.jgb-lightbox-caption {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #E8E2D5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jgb-lightbox-btn {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 226, 213, 0.26);
  border-radius: 50%;
  background: rgba(14, 14, 12, 0.75);
  color: #E8E2D5;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.jgb-lightbox-btn:hover {
  border-color: var(--brass-bright, #B8942A);
  color: var(--brass-bright, #B8942A);
}

.jgb-lightbox-btn:focus-visible {
  outline: 2px solid var(--brass-bright, #B8942A);
  outline-offset: 2px;
}

.jgb-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.jgb-lightbox-nav.prev { left: 0.8rem; }
.jgb-lightbox-nav.next { right: 0.8rem; }

.jgb-lightbox-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.9rem;
  background: linear-gradient(to top, rgba(8, 8, 7, 0.92), rgba(8, 8, 7, 0));
}

.jgb-lightbox-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(232, 226, 213, 0.4);
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.jgb-lightbox-dot[aria-current="true"] {
  background: var(--brass-bright, #B8942A);
  border-color: var(--brass-bright, #B8942A);
}

.jgb-lightbox-hint {
  position: absolute;
  left: 50%;
  bottom: 3rem;
  transform: translateX(-50%);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 226, 213, 0.6);
  pointer-events: none;
  text-align: center;
}

body.jgb-lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .pdp-angles { gap: 0.35rem; }
  .pdp-angle-label { font-size: 0.5rem; letter-spacing: 0.08em; }
  .jgb-lightbox-nav.prev { left: 0.3rem; }
  .jgb-lightbox-nav.next { right: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-angle,
  .pdp-crosssell a,
  .pdp-swatch-preview { transition: none; }
}

/* ===========================================================================
   Zoom grid. Tile grids where every tile opens the full resolution photo.
   Used by the Quoted T's collection page.
   =========================================================================== */
.zoom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}
.zoom-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface, #161513);
  border: 1px solid var(--color-border, #2A2824);
  border-radius: 6px;
  overflow: hidden;
}
.zoom-card-figure {
  position: relative;
  margin: 0;
}
.zoom-card-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #F5F4F2;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
}
.zoom-card-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7%;
  display: block;
}
.zoom-card-btn:focus-visible {
  outline: 2px solid var(--brass-bright, #B8942A);
  outline-offset: -3px;
}
.zoom-card-zoomtag {
  position: absolute;
  bottom: 0.55rem;
  right: 0.55rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0E0E0C;
  background: rgba(232, 226, 213, 0.9);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  pointer-events: none;
}
.zoom-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1rem 1.1rem;
  flex: 1 1 auto;
}
.zoom-card-body h3 {
  font-size: 0.98rem;
  line-height: 1.35;
  margin: 0;
}
.zoom-card-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-bright, #B8942A);
}
.zoom-card-actions {
  margin-top: auto;
  padding-top: 0.5rem;
}
.zoom-card-actions a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-secondary, #D8CFBE);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 148, 42, 0.55);
}
.zoom-card-actions a:hover,
.zoom-card-actions a:focus-visible {
  color: var(--brass-bright, #B8942A);
}
@media (max-width: 520px) {
  .zoom-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
  .zoom-card-body { padding: 0.75rem 0.8rem 0.9rem; }
  .zoom-card-body h3 { font-size: 0.88rem; }
}

/* ===========================================================================
   Mobile overflow guard. Grid children default to min-width auto, so one
   wide descendant inside the gallery was widening the single mobile column
   and pushing the whole PDP into an 84px horizontal scroll at 390px.
   =========================================================================== */
@media (max-width: 900px) {
  .pdp { grid-template-columns: minmax(0, 1fr); }
  .pdp > * { min-width: 0; }
  .pdp-gallery,
  .pdp-info { max-width: 100%; }
  .pdp-angles { min-width: 0; }
  .size-row { min-width: 0; }
}
