/* ==========================================================================
   GLOW & GROW HERBAL CARE — 3D MOTION & CINEMATIC ANIMATION ENGINE
   Inspired by ThreadLab Luxury 3D Aesthetic
   Color Harmony:
     Cream:        #F7F3E9
     Ivory:        #FFFDF7
     Forest Green: #173F32
     Sage:         #82977B
     Gold:         #C5A15A
     Charcoal:     #242820
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VIEWPORT REVEAL SYSTEM (Scroll-Driven Viewport Cascades)
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.85s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal="fade-up"] {
  transform: translateY(32px);
}

[data-reveal="fade-down"] {
  transform: translateY(-28px);
}

[data-reveal="fade-left"] {
  transform: translateX(-35px);
}

[data-reveal="fade-right"] {
  transform: translateX(35px);
}

[data-reveal="scale-up"] {
  transform: scale(0.92);
}

[data-reveal="fade-in"] {
  transform: none;
}

/* Activated State via IntersectionObserver */
[data-reveal].is-revealed {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
}

/* Stagger Delays for Grid Children */
.stagger-grid > *[data-reveal],
[data-reveal-group] > * {
  transition-delay: calc(var(--reveal-idx, 0) * 80ms);
}

/* Fallback: If JS is disabled or takes > 2.5s, reveal all content safely */
@keyframes safetyReveal {
  to {
    opacity: 1;
    transform: none;
  }
}
.no-js [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}

/* --------------------------------------------------------------------------
   2. CINEMATIC 3D HERO SECTION (ThreadLab Inspired Studio Environment)
   -------------------------------------------------------------------------- */
.hero-3d-experience {
  position: relative;
  background-color: var(--c-cream, #F7F3E9);
  background-image: 
    radial-gradient(circle at 75% 40%, rgba(255, 255, 255, 0.65) 0%, transparent 55%),
    linear-gradient(105deg, rgba(247, 243, 233, 0.98) 0%, rgba(247, 243, 233, 0.88) 45%, rgba(247, 243, 233, 0.35) 100%),
    url('../images/herbal-oil-banner.jpeg');
  background-position: center right;
  background-size: cover;
  background-repeat: no-repeat;
  color: var(--c-forest, #173F32);
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 80px 0 100px;
  isolation: isolate;
}

/* Subtle Animated Ambient Sunlight Dappling */
.hero-3d-experience::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(197, 161, 90, 0.18) 0%, transparent 60%);
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: sunlightPulse 8s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes sunlightPulse {
  0% { opacity: 0.6; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.04); }
}

/* Particles & Drifting Botanicals Canvas */
.hero-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.hero-3d-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 3;
}

/* Editorial Content Styling (Left Column) */
.hero-editorial-copy {
  max-width: 580px;
}

.hero-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(197, 161, 90, 0.5);
  color: var(--c-forest, #173F32);
  padding: 7px 18px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(23, 63, 50, 0.06);
}

.hero-eyebrow-pill i {
  color: var(--c-gold, #C5A15A);
}

.hero-editorial-copy h1 {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: clamp(2.8rem, 5.2vw, 4.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-forest, #173F32);
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}

.hero-editorial-copy h1 span.gold-italic {
  font-style: italic;
  font-weight: 400;
  color: var(--c-gold, #C5A15A);
  position: relative;
  display: inline-block;
}

.hero-editorial-copy h1 span.gold-italic::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--c-gold, #C5A15A), transparent);
  border-radius: 2px;
  animation: lineExpand 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
  transform-origin: left;
  transform: scaleX(0);
}

@keyframes lineExpand {
  to { transform: scaleX(1); }
}

.hero-editorial-copy p {
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--c-charcoal-muted, #575D53);
  margin-bottom: 34px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

/* Trust Pill Strip in Hero */
.hero-trust-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid rgba(23, 63, 50, 0.1);
}

.hero-trust-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--c-forest, #173F32);
}

.hero-trust-chip i {
  color: var(--c-gold, #C5A15A);
  font-size: 0.95rem;
}

/* 3D Bottle Showcase Stage (Right Column) */
.hero-3d-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  min-height: 520px;
}

.hero-bottle-wrap {
  position: relative;
  width: 380px;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: grab;
}

.hero-bottle-wrap:active {
  cursor: grabbing;
}

.hero-bottle-img {
  max-height: 460px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 25px 35px rgba(23, 63, 50, 0.35));
  animation: floatBottle3D 6.5s ease-in-out infinite;
  transform-origin: center bottom;
  position: relative;
  z-index: 3;
  transition: filter 0.3s ease;
}

@keyframes floatBottle3D {
  0%, 100% {
    transform: translateY(0px) rotateZ(0deg) rotateY(0deg);
  }
  50% {
    transform: translateY(-16px) rotateZ(1deg) rotateY(2.5deg);
  }
}

/* Realistic Pedestal Contact Shadow */
.pedestal-contact-shadow {
  position: absolute;
  bottom: 25px;
  width: 240px;
  height: 35px;
  background: radial-gradient(ellipse at center, rgba(13, 38, 30, 0.45) 0%, rgba(23, 63, 50, 0) 70%);
  border-radius: 50%;
  z-index: 2;
  animation: shadowScale 6.5s ease-in-out infinite;
}

@keyframes shadowScale {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(0.88); opacity: 0.55; }
}

/* Floating 3D Micro-Cards in Hero */
.hero-floating-stat {
  position: absolute;
  top: 10%;
  right: -10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(197, 161, 90, 0.35);
  border-radius: var(--radius-md, 16px);
  padding: 16px 22px;
  color: var(--c-forest, #173F32);
  box-shadow: 0 16px 36px rgba(23, 63, 50, 0.12);
  z-index: 5;
  animation: floatCardSlow 7.5s ease-in-out infinite 0.5s;
  transform-style: preserve-3d;
}

.hero-floating-stat .stat-num {
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--c-gold, #C5A15A);
  line-height: 1;
}

.hero-floating-stat .stat-label {
  font-size: 0.78rem;
  color: var(--c-charcoal-muted, #575D53);
  margin-top: 4px;
  font-weight: 600;
  max-width: 140px;
  line-height: 1.35;
}

.hero-floating-review {
  position: absolute;
  bottom: 12%;
  left: -20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(23, 63, 50, 0.12);
  border-radius: var(--radius-md, 16px);
  padding: 16px 20px;
  color: var(--c-forest, #173F32);
  box-shadow: 0 16px 36px rgba(23, 63, 50, 0.12);
  z-index: 5;
  max-width: 250px;
  animation: floatCardSlow 8s ease-in-out infinite 1.8s;
  transform-style: preserve-3d;
}

.hero-floating-review .stars {
  color: var(--c-gold, #C5A15A);
  font-size: 0.9rem;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.hero-floating-review p {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--c-charcoal, #242820);
  margin: 0 0 6px;
  font-style: italic;
}

.hero-floating-review .reviewer-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--c-forest, #173F32);
}

@keyframes floatCardSlow {
  0%, 100% { transform: translateY(0px) translateZ(20px); }
  50% { transform: translateY(-12px) translateZ(20px); }
}

/* --------------------------------------------------------------------------
   3. ULTRA-PREMIUM PRODUCT CARD 3D INTERACTIONS
   -------------------------------------------------------------------------- */
.product-card,
.gg-catalog-card {
  position: relative;
  background: var(--c-ivory, #FFFDF7);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(23, 63, 50, 0.1);
  box-shadow: 0 8px 24px rgba(23, 63, 50, 0.05);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
  display: flex;
  flex-direction: column;
}

/* 3D Lift & Shadow on Hover */
.product-card:hover,
.gg-catalog-card:hover {
  transform: translateY(-10px) scale(1.015);
  box-shadow: 0 24px 55px rgba(23, 63, 50, 0.16);
  border-color: rgba(197, 161, 90, 0.6);
}

/* Card Glare Layer (dynamically positioned by JS) */
.card-3d-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  mix-blend-mode: overlay;
  z-index: 10;
  border-radius: inherit;
}

.product-card:hover .card-3d-glare,
.gg-catalog-card:hover .card-3d-glare {
  opacity: 1;
}

/* Product Packaging Image Integrity */
.product-image,
.product-card .product-image,
.gg-catalog-card .product-image {
  position: relative;
  background: #FFFFFF;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 280px;
  border-bottom: 1px solid rgba(23, 63, 50, 0.06);
}

.product-image img,
.product-card .product-image img,
.gg-catalog-card .product-image img {
  width: 100%;
  height: 100%;
  max-height: 240px;
  object-fit: contain !important;
  background: transparent;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}

.product-card:hover .product-image img,
.gg-catalog-card:hover .product-image img {
  transform: scale(1.06);
}

/* Floating 3D Badges */
.product-badge-pill,
.badge,
.mega-pill {
  transform: translateZ(24px);
  transition: transform 0.3s ease;
}

.product-card:hover .product-badge-pill,
.product-card:hover .badge {
  transform: translateZ(32px) scale(1.05);
}

/* Wishlist Button Heart Beat Animation */
.wishlist,
.product-card .wishlist {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s ease,
              color 0.25s ease;
  transform: translateZ(28px);
}

.wishlist:hover {
  transform: translateZ(34px) scale(1.15);
}

.wishlist:active,
.wishlist.is-active i {
  animation: heartPulse 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Action Button Reveal Transitions */
.product-buttons,
.product-button-row {
  transform: translateZ(20px);
}

.buy-btn,
.view-btn {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(23, 63, 50, 0.25);
}

.buy-btn:active {
  transform: translateY(1px) scale(0.98);
}

/* --------------------------------------------------------------------------
   4. NAVIGATION & MEGA MENU MICROINTERACTIONS
   -------------------------------------------------------------------------- */
.site-header {
  transition: background 0.35s ease,
              box-shadow 0.35s ease,
              padding 0.35s ease;
}

.site-header.header-scrolled {
  background: rgba(255, 253, 247, 0.94) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 8px 30px rgba(23, 63, 50, 0.08) !important;
}

/* Expanding Gold Underline for Navigation */
.primary-nav ul li a:not(.btn-primary):not(.buy-btn) {
  position: relative;
  transition: color 0.25s ease;
}

.primary-nav ul li a:not(.btn-primary):not(.buy-btn)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--c-gold, #C5A15A);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.primary-nav ul li a:hover::after,
.primary-nav ul li a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Smooth Mega Menu Transition */
.mega-menu-panel,
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.28s;
  pointer-events: none;
}

.nav-has-mega:hover .mega-menu-panel,
.nav-has-mega:hover .mega-menu,
.nav-has-mega:focus-within .mega-menu-panel,
.nav-has-mega:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Badge Counter Bump on Cart Addition */
@keyframes badgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.4) rotate(-5deg); }
  100% { transform: scale(1); }
}

.badge-bump {
  animation: badgeBump 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   5. COLLECTION CARDS & FEATURED BANNERS
   -------------------------------------------------------------------------- */
.collection-card,
.category-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.collection-card:hover,
.category-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 48px rgba(23, 63, 50, 0.14);
}

.collection-card img,
.category-card img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.collection-card:hover img,
.category-card:hover img {
  transform: scale(1.08);
}

/* --------------------------------------------------------------------------
   6. RESPONSIVE OPTIMIZATIONS & ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .hero-3d-experience {
    min-height: auto;
    padding: 60px 0 80px;
    background-position: center;
  }
  .hero-3d-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-editorial-copy {
    max-width: 100%;
    margin: 0 auto;
  }
  .hero-cta-group {
    justify-content: center;
  }
  .hero-trust-strip {
    justify-content: center;
  }
  .hero-3d-stage {
    min-height: 420px;
  }
  .hero-bottle-wrap {
    width: 290px;
    height: 400px;
  }
  .hero-bottle-img {
    max-height: 360px;
  }
  .hero-floating-stat {
    right: 5%;
    top: 5%;
    padding: 12px 16px;
  }
  .hero-floating-review {
    left: 5%;
    bottom: 5%;
    max-width: 220px;
    padding: 12px 16px;
  }
}

@media (max-width: 576px) {
  .hero-editorial-copy h1 {
    font-size: 2.3rem;
  }
  .hero-bottle-wrap {
    width: 250px;
    height: 340px;
  }
  .hero-bottle-img {
    max-height: 300px;
  }
  .hero-floating-stat,
  .hero-floating-review {
    position: relative;
    right: auto;
    left: auto;
    top: auto;
    bottom: auto;
    margin: 12px auto;
    display: inline-block;
  }
}

/* prefers-reduced-motion: 100% accessible compliance */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-bottle-img,
  .hero-floating-stat,
  .hero-floating-review,
  .pedestal-contact-shadow {
    animation: none !important;
  }
  .hero-particles-canvas {
    display: none !important;
  }
}
