/* ── PRODUCT PAGE ───────────────────────────────────────── */

/* Scroll-snap for smooth page-by-page image reveal */
html:has(.product-main) {
  scroll-snap-type: y mandatory;
  scroll-padding-top: 52px;
}

/* ── MOBILE NAV — transparent on load, frosted on scroll ── */
@media (max-width: 768px) {
  /* Transparent state (product page only, while at top) */
  body.prod-nav-clear .nav {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
    color: var(--dark);
  }
  html.dark body.prod-nav-clear .nav {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
    color: var(--dark);
  }
}

/* Two-column split layout */
.product-main {
  display: flex;
  align-items: flex-start;
  padding-top: 52px; /* nav height */
  min-height: 100vh;
  background: var(--cream);
}

/* LEFT — scrolling image stack */
.product-images {
  flex: 0 0 58%;
  display: flex;
  flex-direction: column;
}
.prod-img-block {
  width: 100%;
  height: calc(100vh - 52px);
  overflow: hidden;
  background: #f4f4f4;
  scroll-snap-align: start;
}
html.dark .prod-img-block {
  background: #1e1e1e;
}
.prod-img-block img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

/* RIGHT — sticky info panel */
.product-info-panel {
  flex: 0 0 42%;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--cream);
  overflow: visible;
  will-change: transform;
}
html.dark .product-info-panel {
  border-left-color: rgba(255, 255, 255, 0.08);
  background: var(--cream);
}

/* Scrollable content area */
.prod-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 48px 48px 32px;
  scrollbar-width: none;
}
.prod-panel-content::-webkit-scrollbar { display: none; }

/* Title row: name left, price right */
.prod-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}
.prod-title-row .prod-name { margin-bottom: 0; }
.prod-title-row .prod-price { margin-bottom: 0; flex-shrink: 0; }

/* Glass size picker — floats above the bottom bar */
.prod-size-drawer {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 20px 20px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(32px) saturate(2);
  -webkit-backdrop-filter: blur(32px) saturate(2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,0.4);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
html.dark .prod-size-drawer {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}
.prod-size-drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Bottom bar */
.prod-bottom-bar {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 10px 10px 12px;
  flex-shrink: 0;
  background: var(--cream);
}
html.dark .prod-bottom-bar { background: var(--cream); }

.prod-size-trigger {
  flex: 0 0 calc(38% - 3px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: "PPNeueMontreal", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dark);
  min-height: 68px;
  transition: background var(--t1);
}
.prod-size-trigger:hover { background: rgba(0, 0, 0, 0.1); }
html.dark .prod-size-trigger {
  background: rgba(255,255,255,0.08);
  color: var(--dark);
}
html.dark .prod-size-trigger:hover { background: rgba(255,255,255,0.13); }

.prod-size-icon {
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}
.prod-size-trigger[aria-expanded="true"] .prod-size-icon {
  transform: rotate(45deg);
}

/* Product info text */
.prod-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mid);
  margin-bottom: 20px;
  transition: color var(--t1);
}
.prod-back-link:hover { color: var(--dark); }

.prod-badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 10px;
}

.prod-name {
  font-family: "PPEditorialNew", serif;
  font-weight: 700;
  font-size: clamp(26px, 2.8vw, 44px);
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--dark);
}

.prod-series {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mid);
  margin: 0 0 28px;
}

.prod-price {
  font-family: "PPNeueMontreal", sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
  color: var(--dark);
}

.prod-desc {
  font-size: 12px;
  line-height: 1.8;
  color: var(--mid);
  margin: 0 0 8px;
  padding: 0;
}

/* Accordion */
.accordion {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
html.dark .accordion { border-top-color: rgba(255,255,255,0.1); }

.accordion + .accordion { border-top: none; }
.accordion:last-of-type {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 32px;
}
html.dark .accordion:last-of-type { border-bottom-color: rgba(255,255,255,0.1); }

.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  font-family: "PPNeueMontreal", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--dark);
  text-transform: uppercase;
  text-align: left;
}

.accordion-icon {
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}
.accordion.is-open .accordion-icon {
  transform: rotate(45deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.accordion.is-open .accordion-body {
  max-height: 400px;
}
.accordion-body p {
  font-size: 12px;
  line-height: 2;
  color: var(--mid);
  padding-bottom: 18px;
}

/* Color toggle — override swatch borders for light background */
.prod-color-section {
  margin: 8px 0 20px;
}
.prod-color-toggle {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.prod-color-toggle .p-swatch {
  border-color: rgba(0,0,0,0.15);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.prod-color-toggle .p-swatch.is-active {
  border-color: var(--dark);
}
html.dark .prod-color-toggle .p-swatch {
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}
html.dark .prod-color-toggle .p-swatch.is-active {
  border-color: var(--dark);
}

/* Size section (reuses size-label + size-grid + size-btn from style.css) */
.prod-size-section {
  margin-bottom: 28px;
}

/* Add to cart (lives in bottom bar) */
.prod-add-btn {
  flex: 1;
  background: #000;
  color: #fff;
  font-family: "PPNeueMontreal", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  min-height: 68px;
  transition: background var(--t1);
}
.prod-add-btn:hover:not(:disabled) { background: #222; }
.prod-add-btn:disabled {
  background: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.35);
  cursor: default;
}
html.dark .prod-add-btn {
  background: #f0f0f0;
  color: #111111;
}
html.dark .prod-add-btn:hover:not(:disabled) { background: #d8d8d8; }
html.dark .prod-add-btn:disabled {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.3);
}

/* ── EDITORIAL full-bleed ────────────────────────────────── */
.prod-editorial {
  scroll-snap-align: start;
  width: 100%;
  height: 92vh;
  overflow: hidden;
  position: relative;
  margin-top: 0;
}
.prod-editorial img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}

/* ── COMPLETE THE LOOK ───────────────────────────────────── */
.complete-look {
  scroll-snap-align: start;
  background: var(--cream);
  padding: 230px 48px 80px;
}
.complete-look-header {
  margin-bottom: 40px;
}
.complete-look .p-card-img-wrap {
  aspect-ratio: 2/3;
}
.complete-look-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* ── DOT INDICATORS (hidden on desktop) ─────────────────── */
.prod-img-dots { display: none; }

.prod-size-drawer-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 14px;
  text-transform: uppercase;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .prod-panel-content { padding: 36px 32px 24px; }
  .complete-look { padding: 160px 32px 64px; }
  .complete-look-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html:has(.product-main) { scroll-snap-type: none; }

  /* Full block layout — no flex algorithm involved, everything stacks naturally */
  .product-main {
    display: block;
    min-height: unset;
  }

  /* ── Swipeable image carousel ── */
  .product-images {
    display: flex;
    flex-direction: row;
    width: 100%;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .product-images::-webkit-scrollbar { display: none; }

  .prod-img-block {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    overflow: visible;
    scroll-snap-align: start;
  }
  .prod-img-block img {
    height: auto;
    object-fit: unset;
    object-position: unset;
  }

  /* ── Dot indicators ── */
  .prod-img-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 18px 0 10px;
    background: var(--cream);
    width: 100%;
  }
  .prod-img-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0,0,0,0.18);
    transition: background 0.25s, width 0.25s, border-radius 0.25s;
    flex-shrink: 0;
  }
  html.dark .prod-img-dot { background: rgba(255,255,255,0.22); }
  .prod-img-dot.is-active {
    width: 20px;
    border-radius: 3px;
    background: var(--dark);
  }

  /* ── Info panel — plain block, height = sum of all children, no flex tricks ── */
  .product-info-panel {
    display: block;
    width: 100%;
    position: static;
    height: auto;
    max-height: none;
    border-left: none;
    border-top: none;
    overflow: visible;
    padding-bottom: 0;
  }
  html.dark .product-info-panel { border-left: none; border-top: none; }

  .prod-panel-content {
    overflow: visible;
    padding: 24px 20px 8px;
  }

  /* ── Accordion ── */
  .accordion-trigger { min-height: 52px; padding: 14px 0; }

  /* ── Size drawer — glass panel stays same style on mobile ── */
  .prod-size-drawer { left: 0; right: 0; padding: 18px 16px 14px; }
  .prod-size-trigger { padding: 0 14px; font-size: 11px; }

  .size-btn { padding: 12px 20px; min-height: 46px; }

  /* ── Bottom bar — sticky to viewport bottom until natural position is reached ── */
  .prod-bottom-bar {
    display: flex;
    position: sticky;
    bottom: 0;
    z-index: 20;
    gap: 8px;
    padding: 12px 16px 16px;
    background: var(--cream);
  }
  html.dark .prod-bottom-bar {
    background: var(--cream);
  }

  .prod-size-trigger {
    padding: 0 16px;
    font-size: 11px;
    min-height: 56px;
    border-radius: 10px;
  }
  .prod-add-btn {
    min-height: 56px;
    border-radius: 10px;
    font-size: 12px;
  }

  .prod-editorial { height: 104vw; margin-top: 80px; scroll-snap-align: none; }
  .prod-editorial img { object-position: center 18%; transform: none; }

  .complete-look {
    padding: 80px 16px 80px;
    scroll-snap-align: none;
  }
  .complete-look-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 479px) {
  .prod-panel-content { padding: 20px 16px 8px; }
  .prod-name { font-size: clamp(20px, 5.5vw, 26px); }
  .prod-price { font-size: 17px; }
  .prod-add-btn { min-height: 56px; font-size: 12px; }
  .complete-look-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .complete-look { padding: 80px 12px 48px; }
  .prod-editorial { height: 104vw; }
  .prod-back-link { font-size: 9px; }
  .prod-badge { font-size: 8px; }
  .prod-series { font-size: 10px; margin-bottom: 16px; }
  .prod-size-drawer.is-open { padding: 16px 16px 10px; }
}
