/**
 * Oralyze Luxury Animations Suite
 * Wonder / Nook Luxury Editorial Oral Wellness Motion Identity
 * Reference: docs/luxury-motion-identity-spec.md & GEMINI.md
 * 
 * Hardware-Accelerated (Compositor-only: transform3d & opacity)
 * WCAG-Compliant prefers-reduced-motion
 * Zero Layout Reflows / 60-120fps Smooth
 */

:root {
    /* Brand Palette Tokens */
    --ow-brand: #767EFC;
    --ow-gold: #FCB40D;
    --ow-action: #393CAD;
    --ow-ink: #20213A;
    --ow-paper: #FAF9F6;
    --ow-sage: #F0EFFF;
    --ow-tint: #F3EEE8;
    --ow-line: #E7DFD7;
    --ow-muted: #55576B;

    /* Aliases for Luxury Theme Tokens */
    --luxury-periwinkle: var(--ow-brand);
    --luxury-gold: var(--ow-gold);
    --luxury-indigo: var(--ow-action);
    --luxury-ink: var(--ow-ink);
    --luxury-paper: var(--ow-paper);
    --luxury-lilac: var(--ow-sage);

    /* --- Luxury Editorial Easing Curves --- */
    /* Primary Ease: Cinematic Deceleration / Ease-Out Expo (reveals, drawers, card elevation) */
    --ow-ease-luxury-out: cubic-bezier(0.16, 1, 0.3, 1);
    --luxury-ease-out-expo: var(--ow-ease-luxury-out);

    /* Symmetrical Ease: Long hero slides, smooth pan/swaps */
    --ow-ease-fluid: cubic-bezier(0.65, 0, 0.35, 1);
    --luxury-ease-fluid: var(--ow-ease-fluid);

    /* Snappy Interactive Ease: Button presses, quick feedback */
    --ow-ease-snap: cubic-bezier(0.25, 1, 0.5, 1);
    --luxury-ease-snap: var(--ow-ease-snap);

    /* Soft Tactile Settle: Micro-pops for badges, checkmarks */
    --ow-ease-spring-soft: cubic-bezier(0.34, 1.25, 0.64, 1);
    --luxury-ease-spring: var(--ow-ease-spring-soft);

    /* Ambient Floating Drift: Continuous peaceful floating rhythm */
    --ow-ease-ambient: cubic-bezier(0.45, 0.05, 0.55, 0.95);
    --luxury-ease-in-out: var(--ow-ease-ambient);

    /* --- Duration Scales --- */
    --ow-dur-micro: 180ms;       /* Border tints, color shifts, icon color */
    --ow-dur-snappy: 320ms;      /* Button hover, dropdown menus, search autocomplete */
    --ow-dur-medium: 500ms;      /* Accordion expands, tab cross-fades, card elevation */
    --ow-dur-reveal: 750ms;      /* Scroll reveal fade-in-up, bento entrances */
    --ow-dur-drawer: 850ms;      /* Slide-out cart drawer, mobile nav drawer */
    --ow-dur-ambient: 4500ms;    /* Subtle floating badges, delicate glow pulse */
    --ow-dur-shimmer: 5200ms;    /* Luxury badge shimmer period */

    /* Aliases */
    --luxury-dur-instant: var(--ow-dur-micro);
    --luxury-dur-fast: var(--ow-dur-snappy);
    --luxury-dur-card: var(--ow-dur-medium);
    --luxury-dur-reveal: var(--ow-dur-reveal);
    --luxury-dur-float: var(--ow-dur-ambient);
    --luxury-dur-shimmer: var(--ow-dur-shimmer);

    /* --- Stagger Constants --- */
    --ow-stagger-base: 80ms;
    --luxury-stagger-step: var(--ow-stagger-base);
}

/* ==========================================================================
   1. SCROLL REVEALS (IntersectionObserver Progressive Enhancement)
   ========================================================================== */

/* Progressive Enhancement: Hidden initial states ONLY when JS activates motion readiness */
html.luxury-motion-ready .ow-reveal,
body.luxury-motion-ready .ow-reveal,
html.luxury-motion-ready .luxury-reveal-item,
body.luxury-motion-ready .luxury-reveal-item,
html.luxury-motion-ready [data-luxury-reveal],
body.luxury-motion-ready [data-luxury-reveal] {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
    transition: opacity var(--ow-dur-reveal) var(--ow-ease-luxury-out),
                transform var(--ow-dur-reveal) var(--ow-ease-luxury-out);
    will-change: opacity, transform;
}

/* In-View Revealed State */
html.luxury-motion-ready .ow-reveal.is-revealed,
body.luxury-motion-ready .ow-reveal.is-revealed,
html.luxury-motion-ready .luxury-reveal-item.is-revealed,
body.luxury-motion-ready .luxury-reveal-item.is-revealed,
html.luxury-motion-ready [data-luxury-reveal].is-revealed,
body.luxury-motion-ready [data-luxury-reveal].is-revealed {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
    will-change: auto;
}

/* Reveal Variations */
html.luxury-motion-ready .luxury-reveal-item.reveal-fade,
html.luxury-motion-ready .ow-reveal.reveal-fade {
    transform: none;
}
html.luxury-motion-ready .luxury-reveal-item.reveal-fade.is-revealed,
html.luxury-motion-ready .ow-reveal.reveal-fade.is-revealed {
    transform: none !important;
}

html.luxury-motion-ready .luxury-reveal-item.reveal-scale,
html.luxury-motion-ready .ow-reveal.reveal-scale {
    transform: scale3d(0.96, 0.96, 1) translate3d(0, 16px, 0);
}
html.luxury-motion-ready .luxury-reveal-item.reveal-scale.is-revealed,
html.luxury-motion-ready .ow-reveal.reveal-scale.is-revealed {
    transform: scale3d(1, 1, 1) translate3d(0, 0, 0) !important;
}

/* Dynamic CSS Variable-based Sibling Staggering */
.luxury-reveal-item,
.ow-reveal {
    transition-delay: calc(var(--reveal-idx, 0) * var(--ow-stagger-base));
}

/* Explicit Stagger Helper Classes */
.ow-stagger-1 { transition-delay: 80ms !important; }
.ow-stagger-2 { transition-delay: 160ms !important; }
.ow-stagger-3 { transition-delay: 240ms !important; }
.ow-stagger-4 { transition-delay: 320ms !important; }
.ow-stagger-5 { transition-delay: 400ms !important; }

/* Grid Children Stagger Fallbacks */
.departments-grid .department-card:nth-child(1),
.bento-grid-wrapper > div:nth-child(1),
.brand-cards-grid .brand-card-item:nth-child(1),
.products .product:nth-child(1),
.slider-track .slider-product-card:nth-child(1),
.oh-card-grid > *:nth-child(1),
.oh-brand-grid > *:nth-child(1) { transition-delay: 40ms; }

.departments-grid .department-card:nth-child(2),
.bento-grid-wrapper > div:nth-child(2),
.brand-cards-grid .brand-card-item:nth-child(2),
.products .product:nth-child(2),
.slider-track .slider-product-card:nth-child(2),
.oh-card-grid > *:nth-child(2),
.oh-brand-grid > *:nth-child(2) { transition-delay: 110ms; }

.departments-grid .department-card:nth-child(3),
.bento-grid-wrapper > div:nth-child(3),
.brand-cards-grid .brand-card-item:nth-child(3),
.products .product:nth-child(3),
.slider-track .slider-product-card:nth-child(3),
.oh-card-grid > *:nth-child(3),
.oh-brand-grid > *:nth-child(3) { transition-delay: 180ms; }

.departments-grid .department-card:nth-child(4),
.bento-grid-wrapper > div:nth-child(4),
.brand-cards-grid .brand-card-item:nth-child(4),
.products .product:nth-child(4),
.slider-track .slider-product-card:nth-child(4),
.oh-card-grid > *:nth-child(4),
.oh-brand-grid > *:nth-child(4) { transition-delay: 250ms; }

.departments-grid .department-card:nth-child(5),
.brand-cards-grid .brand-card-item:nth-child(5),
.products .product:nth-child(5),
.slider-track .slider-product-card:nth-child(5),
.oh-card-grid > *:nth-child(5),
.oh-brand-grid > *:nth-child(5) { transition-delay: 320ms; }

.departments-grid .department-card:nth-child(6),
.brand-cards-grid .brand-card-item:nth-child(6),
.products .product:nth-child(6),
.slider-track .slider-product-card:nth-child(6),
.oh-card-grid > *:nth-child(6),
.oh-brand-grid > *:nth-child(6) { transition-delay: 390ms; }

/* Immediate reveal exemption */
.luxury-reveal-immediate {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
    transition: none !important;
}

/* ==========================================================================
   2. WELLNESS CARDS, TILES & BENTO BOX ELEVATION
   ========================================================================== */

.ow-wellness-card,
.editorial-bento-item,
.bento-card,
.product-card,
.slider-product-card,
.department-card,
.department-card-item,
.testimonial-card-inner,
.pro-product-card,
.oralyze-feature-card,
.oh-tile,
.oh-brand-link,
.brand-card-item,
.luxury-card-elevate {
    transition: transform var(--ow-dur-medium) var(--ow-ease-luxury-out),
                box-shadow var(--ow-dur-medium) var(--ow-ease-luxury-out),
                border-color var(--ow-dur-micro) ease !important;
    will-change: transform, box-shadow;
}

.ow-wellness-card:hover,
.editorial-bento-item:hover,
.bento-card:hover,
.product-card:hover,
.slider-product-card:hover,
.department-card:hover,
.department-card-item:hover,
.testimonial-card-inner:hover,
.pro-product-card:hover,
.oralyze-feature-card:hover,
.oh-tile:hover,
.luxury-card-elevate:hover {
    transform: translate3d(0, -6px, 0);
    border-color: rgba(118, 126, 252, 0.35);
    box-shadow: 0 24px 48px -12px rgba(32, 33, 58, 0.12),
                0 0 0 1px rgba(118, 126, 252, 0.15);
}

.oh-brand-link:hover {
    transform: translate3d(0, -3px, 0);
    border-color: rgba(118, 126, 252, 0.35);
    box-shadow: 0 12px 28px -6px rgba(32, 33, 58, 0.09);
}

/* Department Card Icon gentle scale on hover */
.department-card:hover .department-thumb-wrap,
.department-card:hover .department-img-wrap {
    transform: scale3d(1.06, 1.06, 1);
}

.department-thumb-wrap,
.department-img-wrap {
    transition: transform 0.45s var(--ow-ease-luxury-out);
    will-change: transform;
}

/* ==========================================================================
   3. IMAGE ZOOM & WARM SCRIM LIGHTING
   ========================================================================== */

.card-media,
.card-media-box,
.bento-media-wrap,
.department-thumb-wrap,
.department-img-wrap,
.ugc-media-wrap,
.oh-tile,
.luxury-zoom-wrap {
    overflow: hidden;
    position: relative;
}

.card-product-img,
.bento-img,
.department-thumb,
.department-img,
.card-media-box img,
.ugc-slide-video,
.luxury-zoom-img,
.ow-wellness-card .card-media img,
.editorial-bento-item img,
.oh-tile img,
.brand-card-bg-img {
    transition: transform 0.85s var(--ow-ease-luxury-out),
                filter 0.65s var(--ow-ease-luxury-out) !important;
    will-change: transform;
}

.product-card:hover .card-product-img,
.slider-product-card:hover .card-product-img,
.slider-product-card:hover .card-media-box img,
.bento-card:hover .bento-img,
.editorial-bento-item:hover img,
.ow-wellness-card:hover .card-media img,
.oh-tile:hover img,
.ugc-carousel-item:hover .ugc-slide-video,
.luxury-zoom-wrap:hover .luxury-zoom-img {
    transform: scale3d(1.045, 1.045, 1);
    filter: brightness(1.02) contrast(1.02);
}

/* Scrim Overlays */
.bento-scrim-overlay,
.slide-scrim-gradient,
.ow-wellness-card .card-scrim {
    transition: opacity var(--ow-dur-medium) ease;
    will-change: opacity;
}

.bento-card:hover .bento-scrim-overlay,
.ow-wellness-card:hover .card-scrim {
    opacity: 0.90;
}

/* ==========================================================================
   4. DELICATE LUXURY BADGE SHIMMER
   ========================================================================== */

.ow-luxury-badge,
.pill-badge,
.badge-sale,
.badge-new,
.card-rating-badge,
.hero-wellness-pill,
.wellness-pill,
.center-studio-badge,
.ugc-social-badge,
.luxury-shimmer-badge,
[data-luxury-badge] {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.ow-luxury-badge::after,
.pill-badge::after,
.badge-sale::after,
.badge-new::after,
.card-rating-badge::after,
.hero-wellness-pill::after,
.wellness-pill::after,
.center-studio-badge::after,
.ugc-social-badge::after,
.luxury-shimmer-badge::after,
[data-luxury-badge]::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -70%;
    width: 60%;
    height: 220%;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 45%,
        rgba(252, 180, 13, 0.35) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translate3d(-150%, 0, 0) rotate(25deg);
    pointer-events: none;
    z-index: 2;
    animation: oralyze-badge-shimmer var(--ow-dur-shimmer) infinite var(--ow-ease-luxury-out);
}

.card-rating-badge::after,
.badge-new::after {
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(118, 126, 252, 0.28) 45%,
        rgba(252, 180, 13, 0.40) 55%,
        rgba(255, 255, 255, 0) 100%
    );
}

@keyframes oralyze-badge-shimmer {
    0% {
        transform: translate3d(-150%, 0, 0) rotate(25deg);
    }
    35%, 100% {
        transform: translate3d(240%, 0, 0) rotate(25deg);
    }
}

/* Acceleration on card hover */
.product-card:hover .pill-badge::after,
.product-card:hover .card-rating-badge::after,
.slider-product-card:hover .pill-badge::after {
    animation-duration: 2.2s;
}

/* ==========================================================================
   5. AMBIENT FLOATING MOTION (Sinusoidal Wellness Pills & Accents)
   ========================================================================== */

.ow-float-ambient,
.hero-wellness-pill,
.wellness-floating-pill,
.floating-badge,
.slide-eyebrow,
.luxury-ambient-float,
[data-luxury-float] {
    display: inline-block;
    animation: oralyze-float-ambient var(--ow-dur-ambient) infinite var(--ow-ease-ambient);
    will-change: transform;
}

@keyframes oralyze-float-ambient {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -6px, 0);
    }
}

/* Periwinkle Ambient Glow Pulse */
.luxury-glow-pulse {
    animation: oralyze-ambient-glow 4.5s infinite var(--ow-ease-ambient);
}

@keyframes oralyze-ambient-glow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(118, 126, 252, 0.12);
    }
    50% {
        box-shadow: 0 8px 28px rgba(118, 126, 252, 0.26);
    }
}

/* ==========================================================================
   6. TACTILE BUTTONS & EDITORIAL LINK MICRO-INTERACTIONS
   ========================================================================== */

.ow-btn-primary,
.btn-card-add-to-cart,
.btn-card-quick-add,
.slide-text-cta.cta-primary,
.cta-primary,
.oralyze-btn-primary,
.luxury-btn-magnetic {
    background: var(--ow-action);
    color: var(--ow-paper, #FAF9F6);
    border: 1px solid transparent;
    transition: transform var(--ow-dur-snappy) var(--ow-ease-luxury-out),
                box-shadow var(--ow-dur-snappy) var(--ow-ease-luxury-out),
                background-color var(--ow-dur-micro) ease !important;
    box-shadow: 0 4px 14px -2px rgba(57, 60, 173, 0.2);
    will-change: transform;
}

.ow-btn-primary:hover,
.btn-card-add-to-cart:hover,
.btn-card-quick-add:hover,
.slide-text-cta.cta-primary:hover,
.cta-primary:hover,
.oralyze-btn-primary:hover {
    background: #2D3094;
    transform: translate3d(0, -2px, 0) scale(1.015);
    box-shadow: 0 12px 28px -6px rgba(57, 60, 173, 0.35);
}

.ow-btn-primary:active,
.btn-card-add-to-cart:active,
.btn-card-quick-add:active,
.slide-text-cta:active,
.cta-primary:active,
.oralyze-btn-primary:active {
    transform: translate3d(0, 1px, 0) scale(0.985) !important;
    box-shadow: 0 4px 10px -2px rgba(57, 60, 173, 0.25);
}

/* Smooth Editorial Underline Link Animation */
.editorial-link,
.bento-cta-link,
.slide-text-cta.cta-secondary {
    position: relative;
    text-decoration: none;
}

.editorial-link::after,
.slide-text-cta.cta-secondary::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1.5px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.38s var(--ow-ease-luxury-out);
}

.editorial-link:hover::after,
.slide-text-cta.cta-secondary:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Three dots department indicator animation */
.department-dots-indicator .dot {
    transition: transform 0.35s var(--ow-ease-luxury-out),
                background-color 0.35s ease;
}

.departments-carousel-container:hover .department-dots-indicator .dot.active {
    transform: scale3d(1.25, 1.25, 1);
    background-color: var(--ow-gold, #FCB40D);
}

/* ==========================================================================
   7. ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    html.luxury-motion-ready .ow-reveal,
    body.luxury-motion-ready .ow-reveal,
    html.luxury-motion-ready .luxury-reveal-item,
    body.luxury-motion-ready .luxury-reveal-item,
    html.luxury-motion-ready [data-luxury-reveal],
    body.luxury-motion-ready [data-luxury-reveal] {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        transition: none !important;
    }

    .ow-luxury-badge::after,
    .pill-badge::after,
    .badge-sale::after,
    .badge-new::after,
    .card-rating-badge::after,
    .hero-wellness-pill::after,
    .wellness-pill::after,
    .center-studio-badge::after,
    .ugc-social-badge::after,
    .luxury-shimmer-badge::after,
    [data-luxury-badge]::after {
        display: none !important;
    }

    .ow-float-ambient,
    .hero-wellness-pill,
    .wellness-floating-pill,
    .floating-badge,
    .slide-eyebrow,
    .luxury-ambient-float,
    [data-luxury-float] {
        animation: none !important;
        transform: none !important;
    }

    .ow-wellness-card,
    .editorial-bento-item,
    .product-card,
    .slider-product-card,
    .department-card,
    .bento-card,
    .oh-tile,
    .oh-brand-link,
    .card-product-img,
    .bento-img {
        transform: none !important;
        box-shadow: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   8. ELEMENTOR LIVE EDITOR COMPATIBILITY
   ========================================================================== */

body.elementor-editor-active .ow-reveal,
body.elementor-editor-active .luxury-reveal-item,
body.elementor-editor-active [data-luxury-reveal],
.elementor-editor-active .ow-reveal,
.elementor-editor-active .luxury-reveal-item,
.elementor-editor-preview .ow-reveal,
.elementor-editor-preview .luxury-reveal-item {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
}
