/* ========================================
   Alpha v2 — Product Detail Shared Styles
   Used by ALL product detail pages
   ======================================== */

/* ========================================
   1. PRODUCT HERO
   ======================================== */
/* Base pd-hero composes its background from theme CSS vars.
   Each product sets its own --theme-tint-1/2 + surface via .pd-hero--variant.
   Fallbacks produce a clean pure-white hero if no theme is set. */
.pd-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + var(--space-3)) var(--space-page-x) var(--space-4);
  background:
    radial-gradient(ellipse 80% 55% at var(--theme-pos-1, 30% 35%),
      var(--theme-tint-1, transparent) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at var(--theme-pos-2, 80% 75%),
      var(--theme-tint-2, transparent) 0%, transparent 60%),
    linear-gradient(180deg,
      var(--theme-surface-start, var(--color-surface)) 0%,
      var(--theme-surface-end,   var(--color-surface)) 100%);
  overflow: hidden;
}

.pd-hero__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-lg);
  max-width: 1200px;
  width: 100%;
  position: relative;
  z-index: var(--z-raised);
}

.pd-hero__content {
  max-width: 560px;
  position: relative;
  z-index: var(--z-raised);
  text-align: left;
}

.pd-hero__image {
  flex: 0 0 auto;
  width: 380px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pd-hero__image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: var(--shadow-drop-image);
  transition: transform var(--ease-reveal);
}

.pd-hero__image img:hover {
  transform: scale(1.03);
}

/* Hero Slideshow */
.pd-hero__slideshow {
  position: relative;
  flex-direction: column;
}

.pd-hero__slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.pd-hero__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--ease-reveal);
  will-change: transform;
}

.pd-hero__slide.active {
  opacity: 1;
  position: relative;
}

.pd-hero__slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: var(--shadow-drop-image);
  user-select: none;
}

/* Slideshow arrows — glass FAB (carousel-arrow pattern) */
.pd-hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border-top:    var(--glass-edge-top);
  border-left:   var(--glass-edge-left);
  border-right:  var(--glass-edge-right);
  border-bottom: var(--glass-edge-bottom);
  box-shadow: var(--shadow-glass);
  color: var(--color-primary-deep);
  font-size: var(--icon-inline);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur) var(--ease),
              background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  z-index: var(--z-raised);
}

.pd-hero__slideshow:hover .pd-hero__arrow {
  opacity: 1;
}

.pd-hero__arrow:hover {
  background: var(--glass-hover);
  box-shadow: var(--shadow-glass-raised);
}

.pd-hero__arrow--prev {
  left: calc(-1 * var(--space-3));
}

.pd-hero__arrow--next {
  right: calc(-1 * var(--space-3));
}

@media (max-width: 900px) {
  .pd-hero__arrow--prev {
    left: -1rem;
  }

  .pd-hero__arrow--next {
    right: -1rem;
  }
}

.pd-hero__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-1);
}

.pd-hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border-heavy);
  cursor: pointer;
  padding: 0;
  transition: background var(--ease-normal), transform var(--ease-normal);
}

.pd-hero__dot.active {
  background: var(--color-primary);
  transform: scale(1.3);
}

.pd-hero__dot:hover {
  background: var(--color-primary);
}

@media (max-width: 900px) {
  .pd-hero__inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .pd-hero__content {
    text-align: center;
  }

  .pd-hero__image {
    width: 260px;
    height: 260px;
  }

  .pd-hero__actions {
    justify-content: center;
  }
}

/* Legacy: support pages without __inner wrapper */
.pd-hero > .pd-hero__content:only-child {
  text-align: center;
  max-width: 740px;
}

.pd-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--padding-badge);
  background: var(--badge-bg);
  border: none;
  box-shadow: var(--shadow-glass-pill);
  border-radius: var(--radius-button);
  font-size: var(--text-xs-plus);
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.03em;
  margin-bottom: var(--space-xl);
}

.pd-hero__badge svg {
  width: var(--icon-xs);
  height: var(--icon-xs);
}

.pd-hero__title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: var(--lh-display-tight);
  letter-spacing: -0.035em;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.pd-hero__subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--color-text-secondary);
  line-height: var(--lh-prose);
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
}

.pd-hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

/* Hero tinted variant */
.pd-hero--dark {
  background: var(--color-bg-dark);
}

.pd-hero--dark .pd-hero__badge {
  background: var(--badge-bg);
  border-color: var(--badge-border);
  color: var(--color-primary);
}

.pd-hero--dark .pd-hero__title {
  color: var(--color-text);
}

.pd-hero--dark .pd-hero__subtitle {
  color: var(--color-text-secondary);
}

/* ========================================
   2. SIGNATURE ANIMATION CONTAINER
   ======================================== */
.pd-signature {
  position: relative;
  height: 250vh;
  background: var(--pd-stage-bg);
}

.pd-signature__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  padding-top: var(--nav-height, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pd-signature__canvas {
  width: 100%;
  height: 100%;
  position: relative;
}

/* ========================================
   3. FEATURES SECTION
   ======================================== */
.pd-features {
  position: relative;
  background: var(--color-bg-dark);
  /* Match the edge-fade overlay colour to this section's background so
     the cards dissolve into it (see .hscroll-wrapper in primitives.css). */
  --hscroll-fade-color: var(--color-bg-dark);
  /* Fills the viewport so that, while pinned, the whole screen IS this
     section — the sections above and below are off-screen and cannot
     appear to move during the horizontal card scrub. Mirrors the home
     "Why Choose Us" row. The stacked variant resets this below. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Horizontal padding lives on the section; the inner .section-container
     caps content at the same 1200px max-width as every other section, so
     the scroll track scrubs within that window rather than full-bleed. */
  padding: var(--space-6) var(--space-page-x);
  overflow: hidden;
}

.pd-features__header {
  text-align: center;
  margin-bottom: var(--gap-lg);
}

.pd-features__header .section-label {
  color: var(--color-primary);
}

.pd-features__header .section-title {
  color: var(--color-text);
}

.pd-features__header .section-subtitle {
  color: var(--color-text-secondary);
  margin-left: auto;
  margin-right: auto;
}

/* Horizontal scroll clipping window — shared .hscroll-wrapper primitive
   (primitives.css): overflow clip + directional edge-fade mask. */

.pd-features__track {
  display: flex;
  gap: var(--gap-card);
  width: max-content;
  will-change: transform;
}

/* Feature card */
/* Static informational card — not clickable, so no hover affordance.
   Geometry mirrors the wcs-110 spa scent cards (user request 2026-07-06):
   portrait proportions, centre-aligned content, circular icon — on the
   light card surface (key features have no photography). */
.pd-feature-card {
  flex-shrink: 0;
  width: 320px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--color-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 2.5rem 2rem;
}

.pd-feature-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg);
  border-radius: 50%;
  margin: 0 auto var(--space-1-5);
  color: var(--color-primary);
}

.pd-feature-card__icon svg {
  width: 24px;
  height: 24px;
}

.pd-feature-card__title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.pd-feature-card__desc {
  font-size: var(--text-sm-plus);
  color: var(--color-text-secondary);
  line-height: var(--lh-prose);
}

/* Vertical stacked variant — a plain vertical list, not a pinned scroll,
   so it must NOT be forced to viewport height. */
.pd-features--stacked {
  min-height: 0;
  display: block;
}

.pd-features--stacked .pd-features__track {
  flex-direction: column;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-page-x);
}

.pd-features--stacked .pd-feature-card {
  width: 100%;
  min-height: 0; /* vertical list — don't force the portrait height */
}

/* ========================================
   4. SPECS GRID
   ======================================== */
.pd-specs {
  background: var(--color-bg);
  padding: var(--space-6) var(--space-page-x);
}

.pd-specs__header {
  text-align: center;
  margin-bottom: var(--gap-lg);
}

.pd-specs__header .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.pd-specs__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-1);
  max-width: 900px;
  margin: 0 auto;
}

/* Static informational card — not clickable, so no hover affordance. */
.pd-spec-card {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-1-5) var(--space-1-8);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.pd-spec-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xs);
}

.pd-spec-card__value {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

/* Specs tinted variant */
.pd-specs--dark {
  background: var(--color-bg-dark);
}

.pd-specs--dark .pd-specs__header .section-label {
  color: var(--color-primary);
}

.pd-specs--dark .pd-specs__header .section-title {
  color: var(--color-text);
}

.pd-specs--dark .pd-specs__header .section-subtitle {
  color: var(--color-text-secondary);
}

/* ========================================
   5. FILTRATION SECTION
   ======================================== */
.pd-filtration {
  background: linear-gradient(135deg, var(--color-bg-pool), var(--color-bg-lighter));
  padding: var(--space-6) var(--space-page-x);
  overflow: hidden;
}

.pd-filtration__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.pd-filtration__header .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.pd-filtration__flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.pd-filter-stage {
  position: relative;
  background: var(--glass-regular);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-card);
  padding: var(--space-xl) var(--space-1-8);
  /* Content tile — no blur (content is never glass). */
  text-align: center;
  min-width: 180px;
  max-width: 240px;
  flex: 1;
  transition: transform var(--ease-normal), box-shadow var(--ease-normal);
  opacity: 0;
  will-change: opacity, transform;
}

.pd-filter-stage:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pd-filter-stage__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  font-size: var(--text-sm-plus);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.pd-filter-stage__title {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2xs);
  letter-spacing: -0.01em;
}

.pd-filter-stage__desc {
  font-size: var(--text-sm-plus);
  color: var(--color-text-secondary);
  line-height: var(--lh-feature);
}

/* Arrow connectors */
.pd-filtration__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
  color: var(--color-primary);
  opacity: 0;
  will-change: opacity, transform;
}

.pd-filtration__arrow svg {
  width: 24px;
  height: 24px;
}

/* Filtration tinted variant */
.pd-filtration--dark {
  background: linear-gradient(135deg, var(--color-bg-pool), var(--color-bg-lighter));
}

/* ========================================
   6. VIDEO SECTION
   ======================================== */
.pd-video {
  background: var(--color-bg-pool);
  padding: var(--space-6) var(--space-page-x);
  scroll-margin-top: var(--space-section-y);
}

.pd-video__header {
  text-align: center;
  margin-bottom: var(--gap-lg);
}

.pd-video__header .section-label {
  color: var(--color-primary);
}

.pd-video__header .section-title {
  color: var(--color-text);
}

.pd-video__header .section-subtitle {
  color: var(--color-text-secondary);
  margin-left: auto;
  margin-right: auto;
}

.pd-video__container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.pd-video__embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
}

.pd-video__embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========================================
   7. GALLERY
   ======================================== */
.pd-gallery {
  padding: var(--space-6) var(--space-page-x);
  background: var(--color-bg);
}

.pd-gallery__header {
  text-align: center;
  margin-bottom: var(--gap-lg);
}

.pd-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap-card);
  max-width: 1100px;
  margin: 0 auto;
}

.pd-gallery__item {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
}

.pd-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 4 / 3;
}

/* ========================================
   8. PRICING CTA
   ======================================== */
.pd-pricing {
  background: linear-gradient(135deg, var(--color-primary), var(--color-deep));
  padding: var(--space-6) var(--space-page-x);
  text-align: center;
}

.pd-pricing__content {
  max-width: 600px;
  margin: 0 auto;
}

.pd-pricing__label {
  font-size: var(--text-xs-plus);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-on-dark-muted);
  margin-bottom: var(--space-xs);
}

.pd-pricing__amount {
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -0.03em;
  line-height: var(--lh-hero);
  margin-bottom: var(--space-2xs);
}

.pd-pricing__amount--small {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: var(--lh-h4);
}

.pd-pricing__amount span {
  font-size: 0.4em;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0;
}

.pd-pricing__subtitle {
  font-size: var(--text-md);
  color: var(--text-on-dark-sub);
  line-height: var(--lh-body);
  margin-bottom: var(--space-2xl);
}

.pd-pricing__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

/* Pricing warm variant */
.pd-pricing--warm {
  background: var(--warm-gradient);
}

/* ========================================
   8. RELATED PRODUCTS
   ======================================== */
.pd-related {
  background: var(--color-bg);
  padding: var(--space-6) var(--space-page-x);
}

.pd-related__header {
  text-align: center;
  margin-bottom: var(--gap-lg);
}

.pd-related__header .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.pd-related__grid {
  display: flex;
  gap: var(--gap-card);
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-1);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color) transparent;
}

.pd-related__grid::-webkit-scrollbar {
  height: 6px;
}

.pd-related__grid::-webkit-scrollbar-track {
  background: transparent;
}

.pd-related__grid::-webkit-scrollbar-thumb {
  background: var(--scrollbar-color);
  border-radius: 3px;
}

.pd-related__grid .product-card {
  flex-shrink: 0;
  width: 340px;
  scroll-snap-align: start;
}

/* ========================================
   9. THEME VARIANTS
   ======================================== */

/* Warm accent theme (e.g. WHP-3700) — uses standard light nav */

/* Warm accent theme */
.theme-warm .pd-hero__badge {
  background: var(--warm-badge-bg);
  border-color: var(--warm-badge-border);
  color: var(--warm-accent);
}

.theme-warm .pd-feature-card__icon {
  background: var(--warm-icon-bg);
  color: var(--warm-accent);
}

.theme-warm .pd-spec-card__value {
  color: var(--warm-accent);
}

.theme-warm .pd-filter-stage__number {
  background: var(--warm-accent);
}

.theme-warm .pd-filtration__arrow {
  color: var(--warm-accent);
}

/* ========================================
   10. RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .pd-filter-stage {
    min-width: 160px;
    max-width: 200px;
    padding: var(--space-1-5) var(--space-page-x-sm);
  }
}

@media (max-width: 768px) {
  .pd-hero {
    padding: calc(var(--nav-height) + 2rem) var(--space-page-x-m) 3rem;
    min-height: 85vh;
  }

  .pd-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .pd-hero__actions .btn-primary,
  .pd-hero__actions .btn-white,
  .pd-hero__actions .btn-buy {
    width: 100%;
    justify-content: center;
  }

  /* Signature animation */
  .pd-signature {
    height: 200vh;
  }

  /* Features */
  .pd-features {
    padding: var(--space-4) var(--space-page-x-m);
  }

  .pd-feature-card {
    width: 280px;
    min-height: 354px;
    padding: var(--space-xl) var(--space-page-x-m);
  }

  .pd-features--stacked .pd-feature-card {
    width: 100%;
  }

  /* Specs */
  .pd-specs {
    padding: var(--space-4) var(--space-page-x-m);
  }

  .pd-specs__grid {
    grid-template-columns: 1fr;
  }

  /* Filtration */
  .pd-filtration {
    padding: var(--space-4) var(--space-page-x-m);
  }

  .pd-filtration__flow {
    flex-direction: column;
    gap: 0;
  }

  .pd-filtration__arrow {
    transform: rotate(90deg);
    width: auto;
    height: 32px;
    margin: var(--space-xs) 0;
  }

  .pd-filter-stage {
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  /* Video */
  .pd-video {
    padding: var(--space-4) var(--space-page-x-m);
  }

  /* Pricing */
  .pd-pricing {
    padding: var(--space-4) var(--space-page-x-m);
  }

  .pd-pricing__actions {
    flex-direction: column;
    width: 100%;
  }

  .pd-pricing__actions .btn-primary,
  .pd-pricing__actions .btn-white,
  .pd-pricing__actions .btn-buy {
    width: 100%;
    justify-content: center;
  }

  /* Related */
  .pd-related {
    padding: var(--space-4) var(--space-page-x-m);
  }

  .pd-related__grid .product-card {
    width: 280px;
  }
}

@media (max-width: 480px) {
  .pd-hero__title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  /* Third scent-card step (wcs-110 defines 320 / 280@768 / 260@480). */
  .pd-feature-card {
    width: 260px;
    min-height: 375px;
  }

  .pd-pricing__amount {
    font-size: 2.8rem;
  }

  .pd-related__grid .product-card {
    width: 260px;
  }
}

/* ========================================
   11. REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .pd-signature {
    height: auto;
  }

  .pd-signature__sticky {
    position: relative;
    height: auto;
    min-height: 60vh;
  }
}
