/* ===========================================
   PRODUCTS PAGE - Minimal page-specific styles
   =========================================== */

/* Scroll Header */
.scroll-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    transform: translateY(-100%);
    transition: transform var(--transition-base);
}

.scroll-header.visible {
    transform: translateY(0);
}

/* Hero - REDUCED TOP PADDING for immediate headline presence */
.products-hero {
    min-height: auto;
    /* No longer full viewport */
    padding: var(--space-xl) var(--space-lg) var(--space-4xl);
    /* ~40% less top padding */
    background:
        linear-gradient(180deg,
            var(--bone-base) 0%,
            #F8F5F0 50%,
            #F5F0EA 100%);
    position: relative;
}

@media (min-width: 768px) {
    .products-hero {
        padding: var(--space-2xl) var(--space-lg) var(--space-5xl);
    }
}

/* Subtle travertine texture overlay */
.products-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
}

/* Monumental wordmark */
.products-hero .page-title {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    margin-bottom: var(--space-md);
    font-weight: 700;
}

/* MONUMENTAL - Even larger, commanding presence */
.hero__title--monumental {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: -0.04em;
    line-height: 0.9;
    margin-bottom: var(--space-sm);
}

/* Architectural horizontal rule for products hero */
.products-hero .hero-rule {
    width: 80px;
    height: 1px;
    background-color: var(--travertine);
    margin: var(--space-lg) auto var(--space-md);
}

/* Extreme letterspacing tagline */
.tagline--spaced {
    letter-spacing: 0.25em;
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
}

/* Editorial subheadline */
.subheadline--editorial {
    max-width: 400px;
    font-size: var(--text-lg);
    line-height: 1.5;
}

/* 
   Legacy hero animations removed.
   Now using global .reveal-* classes from base.css for the "Choreographed Entrance".
*/

/* Carousel Container - Reserve space to prevent layout jitter */
.carousel-wrapper {
    min-height: 500px;
    /* Ensures layout stability before JS/Images load */
    position: relative;
}

.products-hero .tagline {
    font-size: var(--text-lg);
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
}

.products-hero .subheadline {
    font-size: var(--text-xl);
    color: var(--ink-soft);
    margin-bottom: 0;
}

/* ===================
   ASYMMETRIC SECTION LAYOUTS
   Breaking the centered monotony
   =================== */

.section--asymmetric-layout {
    text-align: left;
}

.section--asymmetric-layout .container--asymmetric {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--space-lg);
}

@media (min-width: 768px) {
    .section--asymmetric-layout .container--asymmetric {
        margin-left: 12%;
        margin-right: auto;
    }
}

/* Editorial headline treatment */
.headline-editorial {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: var(--space-lg);
}

/* Section label - small, uppercase, leading element */
.section-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-muted);
    margin-bottom: var(--space-md);
    font-family: var(--font-sans);
}

/* Closing thought - italic, softer */
.closing-thought {
    font-style: italic;
    color: var(--ink-soft);
}

/* Spacious section - more breathing room */
.section--spacious {
    padding-top: var(--space-5xl);
    padding-bottom: var(--space-5xl);
}

.hero-products {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .hero-products {
        gap: var(--space-3xl);
    }
}

.hero-product {
    width: 130px;
    height: 170px;
    background: var(--bone-surface);
    border: 1px solid var(--travertine);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition-hover);
}

.hero-product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26, 26, 24, 0.06);
}

.hero-product__label {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-product__name {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: 600;
}

/* Entrance animations */


/* Product Cards */
.product-card {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* Card header gradient - creates depth */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, var(--bone-surface) 0%, transparent 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    pointer-events: none;
    z-index: 0;
}

/* Hover state - lift + accent shift */
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 24, 0.08);
}

.product-card:hover .product-card__claim {
    color: var(--accent-clay-dark);
}

/* 1. Result claim - DOMINANT (this is what they're buying) */
.product-card__claim {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--accent-clay);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--space-xs);
    position: relative;
    z-index: 1;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

/* Corner accent - subtle brand detail */
.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-top: 1px solid var(--travertine);
    border-right: 1px solid var(--travertine);
    pointer-events: none;
    z-index: 1;
    transition: border-color var(--transition-fast);
}

.product-card:hover::after {
    border-color: var(--accent-clay);
}

.product-card:hover .product-card__claim {
    color: var(--accent-clay-dark);
    transform: translateX(4px);
}

/* Claim supporting text */
.product-card__claim-sub {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

/* 2. Product name - secondary */
.product-card .card__title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    position: relative;
    z-index: 1;
}

/* 3. Format - tertiary, muted */
.product-card__format {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-lg);
    position: relative;
    z-index: 1;
}

/* Hero Ingredient badge - more prominent */
.product-card__hero-ingredient {
    background: var(--bone-base);
    border-left: 3px solid var(--accent-clay);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    position: relative;
    z-index: 1;
}

.product-card__hero-ingredient .badge {
    margin-bottom: var(--space-sm);
    /* More prominent badge with subtle border */
    border: 1px solid rgba(156, 175, 148, 0.3);
    box-shadow: 0 1px 3px rgba(156, 175, 148, 0.15);
}

.product-card__hero-ingredient strong {
    display: block;
    font-size: var(--text-base);
    color: var(--ink);
}

/* Supporting ingredients list */
.product-card__ingredients {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl);
    font-size: var(--text-xs);
    color: var(--ink-soft);
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.product-card__ingredients li {
    padding: 6px 0;
    padding-left: var(--space-md);
    position: relative;
}

/* Subtle dash before each ingredient */
.product-card__ingredients li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--stone-warm);
}

/* Price + CTA area - more separation */
.product-card .card__footer {
    margin-top: auto;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--travertine);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    position: relative;
    z-index: 1;
}

.product-card__price {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--ink);
}

/* CTA button - more presence */
.product-card .btn {
    flex-shrink: 0;
    padding: var(--space-md) var(--space-lg);
}

/* ===========================================
   FORMULA FACTS - MONUMENTAL PRESENTATION
   =========================================== */

/* Section wrapper for architectural framing */
.formula-facts-showcase {
    position: relative;
    padding: var(--space-3xl) 0;
}

/* Travertine backdrop - creates depth and gallery feel */
.formula-facts-backdrop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-1.5deg);
    width: min(750px, 90vw);
    height: calc(100% + var(--space-xl));
    background: linear-gradient(135deg,
            var(--travertine) 0%,
            rgba(232, 225, 214, 0.5) 50%,
            var(--travertine) 100%);
    border-radius: var(--radius-sm);
    z-index: 0;
    opacity: 0.6;
}

/* Thin vertical framing lines - gallery aesthetic */
.formula-facts-frame {
    position: relative;
    z-index: 1;
    /* Left/right architectural lines */
}

.formula-facts-frame::before,
.formula-facts-frame::after {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    width: 1px;
    background: linear-gradient(to bottom,
            transparent 0%,
            var(--stone-warm) 15%,
            var(--stone-warm) 85%,
            transparent 100%);
}

.formula-facts-frame::before {
    left: -40px;
}

.formula-facts-frame::after {
    right: -40px;
}

/* ===========================================
   CAROUSEL - SIMPLE SHOW/HIDE PATTERN
   Guarantees centered on load. No scroll transforms.
   =========================================== */

/* Wrapper - contains arrows positioned outside panel */
.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 70px;
    /* Space for arrows */
}

/* Track - centers the active panel */
.formula-facts-scroll-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    overflow: visible;
}

/* Panels - only active one visible */
.formula-card,
.supplement-facts.formula-card {
    flex: 0 0 100%;
    width: 100%;
    max-width: 700px;
    padding: var(--space-xl);

    /* Hidden by default - no animation on load */
    display: none;

    position: relative;
    z-index: 2;

    /* Glass panel styling - architectural feel */
    background: var(--bone-base);
    border: 1px solid var(--travertine);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    /* Subtle inner glow - like light through glass */
    background-image: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0) 8%);
}

/* Active panel - visible and centered */
.formula-card.active-card,
.supplement-facts.formula-card.active-card {
    display: block;
    opacity: 1;
    z-index: 5;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 8px 30px rgba(26, 26, 24, 0.08),
        0 4px 12px rgba(26, 26, 24, 0.04);
}

/* Transition effects — only after user interaction */
.carousel-wrapper.initialized .formula-card {
    transition: opacity 0.4s ease-out;
}

.carousel-wrapper.initialized .formula-card.active-card {
    animation: panelFadeIn 0.4s ease-out;
}

@keyframes panelFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel header - darker architectural bar */
.formula-card .supplement-facts__header,
.supplement-facts.formula-card .supplement-facts__header {
    background: var(--ink);
    color: var(--bone-base);
    padding: var(--space-lg) var(--space-xl);
}

/* ===========================================
   NAVIGATION ARROWS - Positioned Outside Panel
   =========================================== */

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bone-base);
    border: 1px solid var(--travertine);
    color: var(--ink);
    font-size: 18px;
    font-weight: 300;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    /* Smooth transitions */
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-arrow:hover {
    border-color: var(--accent-clay);
    background: var(--bone-surface);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-arrow:disabled:hover {
    transform: translateY(-50%);
    background: var(--bone-base);
    border-color: var(--travertine);
}

/* Position arrows outside the panel area */
.nav-prev {
    left: 0;
}

.nav-next {
    right: 0;
}

/* Mobile: arrows inside, smaller */
@media (max-width: 767px) {
    .carousel-wrapper {
        padding: 0 10px;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .nav-prev {
        left: 5px;
    }

    .nav-next {
        right: 5px;
    }
}

/* ===========================================
   PAGINATION DOTS - Subtle & Elegant
   =========================================== */

.carousel-progress {
    width: 100%;
    max-width: 300px;
    margin: var(--space-xl) auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);

    font-family: var(--font-mono, monospace);
    font-size: var(--text-sm);
    color: var(--ink);
}

.progress-bar {
    flex-grow: 1;
    height: 2px;
    background: var(--travertine);
    position: relative;
    overflow: hidden;
    border-radius: 1px;
}

.progress-fill {
    display: block;
    height: 100%;
    background: var(--accent-clay);
    width: 33%;
    border-radius: 1px;
    transition: width 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Alternative: Dot pagination (hidden by default, can be enabled) */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    /* Increased gap */
    margin-top: var(--space-lg);
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--travertine);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: var(--stone-warm);
}

.carousel-dot.active {
    background: var(--accent-clay);
    transform: scale(1.2);
}

/* ===========================================
   FORMULA FACTS SECTION - Premium Layout
   =========================================== */

/* Section container with breathing room */
.formula-carousel-section {
    padding: var(--space-5xl) 0;
    overflow: hidden;
}

/* Bolder header bar */
.formula-facts-showcase .supplement-facts__header {
    padding: var(--space-lg) var(--space-md);
    font-size: var(--text-2xl);
    /* Slightly adjusted for better fit */
    letter-spacing: 0.06em;
}

/* More internal padding for rows */
.formula-facts-showcase .supplement-facts__subheader {
    padding: var(--space-md) var(--space-lg);
}

.formula-facts-showcase .supplement-facts__row {
    padding: var(--space-md) var(--space-lg);
}

.formula-facts-showcase .supplement-facts__row--header {
    padding: var(--space-sm) var(--space-lg);
}

.formula-facts-showcase .supplement-facts__note {
    padding: var(--space-md) var(--space-lg);
}

/* ===========================================
   ENTRANCE ANIMATION - Panel Reveal
   =========================================== */

/* Scroll-triggered entrance */
/* Animation handled by class addition logic or simple CSS hover for debugging */
/* Handled by JS adding .visible class to section */
/* Staggered entrance for cards when section becomes visible */
.formula-carousel-section.visible .formula-card {
    animation: panelReveal 0.8s ease-out forwards;
    opacity: 0;
    /* Star hidden */
}

.formula-carousel-section.visible .formula-card:nth-child(1) {
    animation-delay: 0.1s;
}

.formula-carousel-section.visible .formula-card:nth-child(2) {
    animation-delay: 0.2s;
}

.formula-carousel-section.visible .formula-card:nth-child(3) {
    animation-delay: 0.3s;
}


@keyframes panelReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 0.4;
        /* Default inactive state */
        transform: translateY(0) scale(0.92);
    }
}

/* Active card specific keyframe isn't needed if we use transition, 
   BUT on initial load, we want the active one to go to full opacity.
   We'll let JS handle the .active-card class application which overrides basic styling.
*/

/* ===========================================
   INGREDIENT DEEP-DIVES - BREATHING ROOM
   =========================================== */

/* More space between panel and accordions */
.ingredient-accordion-section {
    margin-top: var(--space-3xl);
}

/* Smaller, more understated subhead */
.ingredient-accordion-section .section-subhead {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-muted);
    font-weight: 500;
    margin-bottom: var(--space-xl);
}

/* Accordions with more breathing room */
.ingredient-accordion-section .accordion {
    gap: var(--space-md);
}

.ingredient-accordion-section .accordion details {
    margin-bottom: var(--space-md);
    transition: opacity 0.4s ease, transform 0.4s ease;
    /* For staggered reveal */
}

/* Ingredient Details */
.ingredient-detail {
    margin-bottom: var(--space-md);
}

.ingredient-detail:last-child {
    margin-bottom: 0;
}

/* =========================================
   PRODUCTS PAGE SPACING REFINEMENT
   ========================================= */

/* 1. Target the container holding the "Formula Facts" section */
.section--formula-facts {
    /* Ensure this class exists on the section tag in HTML */
    /* Increase spacing above the entire section so it breathes away from the hero */
    padding-top: var(--space-3xl) !important;
    padding-bottom: var(--space-2xl) !important;
}

/* 2. Target the section main headline */
.section--formula-facts h2 {
    /* Increase spacing below the headline, pushing the cards down */
    margin-bottom: var(--space-2xl) !important;
}

/* 3. Ensure individual cards have breathing room below them */
.product-card {
    margin-bottom: var(--space-xl) !important;
}

/* 4. Minor adjustment to card internal header spacing for crispness */
.product-card__header {
    padding-top: var(--space-lg) !important;
    padding-bottom: var(--space-md) !important;
}

/* =========================================
   INGREDIENT SOURCE CITATIONS
   ========================================= */

.ingredient-source {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--travertine);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.source-label {
    font-weight: 500;
    color: var(--ink-soft);
}

.source-text {
    display: block;
    margin-top: var(--space-xs);
    font-style: italic;
}

.source-link {
    color: var(--accent-clay);
    text-decoration: none;
    margin-left: var(--space-sm);
    font-weight: 500;
}

.source-link:hover {
    text-decoration: underline;
}

.source-note {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--ink-muted);
}