/**
 * =====================================================================================
 * HELLA 3D MANAGEMENT SUITE: INDEX / LANDING PAGE STYLESHEET
 * =====================================================================================
 * @file        index.css
 * @description Handles the structural layout and specific UI components unique to 
 * the homepage (Hero, Social Proof, Featured Grids, Odometer, Premium Videos).
 * @version     1.0.0
 * @cleared     Jul 5, 2026
 * * ARCHITECTURE OVERVIEW:
 * 1. Hardware Accelerated Animations: Uses transform hooks for dynamic text sliding 
 * (.dynamic-word) to enforce GPU compositing.
 * 2. Media Optimization: Enforces 'content-visibility: auto' to instruct Chromium 
 * engines to skip off-screen rendering for massive DOM node trees.
 * 3. Cinematic Cropping: Dynamically overrides video aspect ratios (4:3 to 16:9) via 
 * media queries to maximize viewport usage on mobile.
 * 4. Hover Query Isolation: Protects product cards from WebKit sticky-hover behavior 
 * by isolating active states to fine-pointer interactions.
 * =====================================================================================
 */

/* --- EXTRACTED PHP STYLES --- */
.smooth-scroll { scroll-behavior: smooth; }
.text-white-bold { color: #ffffff; font-weight: bold; }
.btn-large { padding: 1rem 2.8rem; font-size: 1.2rem; }

.db-error-alert {
    color: #ff3b3b; 
    font-weight: 600; 
    grid-column: 1 / -1; 
    text-align: center; 
    padding: 2rem; 
    background: rgba(255,0,0,0.1); 
    border-radius: 8px; 
    border: 1px solid #ff3b3b;
}

.empty-category-msg {
    color: #888; 
    grid-column: 1 / -1; 
    text-align: center; 
    padding: 2rem;
}

/* --- 0. PERFORMANCE & WEBKIT OVERRIDES --- */
.h3d-liquid-bg {
    isolation: isolate; 
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.h3d-liquid-bg .blob {
    animation: none !important;
    transition: none !important;
    transform: translate3d(0, 0, 0); 
}

/* --- 1. GLOBAL LAYOUT CONTROLS --- */
.index-main-content { 
    position: relative; 
    z-index: 10; 
    padding-top: 40px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

/* --- 2. HERO SECTION --- */
.hero-section { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    max-width: 1800px; 
    margin: 0 auto; 
    padding: 2rem 20px; 
    gap: 4rem; 
    width: calc(100% - 40px); 
    min-height: calc(100vh - 280px); 
}

.glass-hero-card { 
    flex: 1; 
    max-width: 680px; 
    background-color: var(--glass-bg); 
    background-image: var(--glass-noise); 
    backdrop-filter: var(--glass-blur); 
    -webkit-backdrop-filter: var(--glass-blur); 
    border: 1px solid var(--glass-border); 
    box-shadow: var(--glass-shadow); 
    border-radius: 24px; 
    padding: 4rem 3.5rem; 
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hero-headline { 
    font-size: 3.5rem; 
    font-weight: 800; 
    line-height: 1.1; 
    color: #ffffff; 
    margin-bottom: 1.5rem; 
}

.word-wrapper { 
    display: inline-block; 
    overflow: hidden; 
    vertical-align: bottom; 
    padding: 0 4px; 
    color: #ff3b3b; 
    width: 5.5em; /* Locks the width so "The Most" remains completely stationary */
    text-align: left;
    white-space: nowrap;
}

.dynamic-word { 
    display: inline-block; 
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease; 
    transform: translateY(0); 
    opacity: 1; 
}

.dynamic-word.slide-out { transform: translateY(-100%); opacity: 0; }
.dynamic-word.slide-in-prepare { transition: none; transform: translateY(100%); opacity: 0; }

.hero-subheadline { 
    font-size: 1.15rem; 
    color: #b0b0b0; 
    line-height: 1.6; 
    margin-bottom: 2.5rem; 
    max-width: 90%; 
}

.hero-cta-group { display: flex; gap: 1rem; }

.btn { 
    padding: 0.8rem 1.8rem; 
    border-radius: 8px; 
    font-size: 0.95rem; 
    font-weight: 600; 
    text-decoration: none; 
    transition: all 0.3s ease; 
    cursor: pointer; 
    text-align: center; 
    display: inline-block; 
}

.btn-primary { 
    background-color: #ff3b3b; 
    color: #ffffff; 
    border: none; 
    box-shadow: 0 4px 15px rgba(255, 59, 59, 0.3); 
}

.btn-primary:hover { 
    background-color: #ff1f1f; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(255, 59, 59, 0.4); 
}

.btn-secondary { 
    background-color: transparent; 
    color: #ffffff; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
}

.btn-secondary:hover { 
    background-color: rgba(255, 255, 255, 0.1); 
    transform: translateY(-2px); 
}

.hero-visual-content { 
    flex: 1; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

/* --- 3. SOCIAL PROOF STRIP --- */
.social-proof-strip { 
    width: calc(100% - 40px); 
    max-width: 1800px; 
    margin: 0 auto 5rem auto; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 4rem; 
    padding: 20px 40px; 
    flex-wrap: wrap; 
    background-color: var(--glass-bg); 
    background-image: var(--glass-noise); 
    backdrop-filter: var(--glass-blur); 
    -webkit-backdrop-filter: var(--glass-blur); 
    border: 1px solid var(--glass-border); 
    box-shadow: var(--glass-shadow); 
    border-radius: 16px; 
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.proof-item { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 0.85rem; 
    color: #ffffff; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.proof-item svg { width: 18px; height: 18px; color: #ff3b3b; }

/* --- 4. PRODUCT SHOWCASE GRID --- */
.showcase-wrapper { 
    max-width: 1800px; 
    width: calc(100% - 40px); 
    margin: 0 auto 6rem auto; 
    position: relative; 
    z-index: 10; 
}

.showcase-category { margin-bottom: 5rem; }

.showcase-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-bottom: 2rem; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    padding-bottom: 1rem; 
}

.showcase-header h2 { font-size: 2rem; font-weight: 700; color: #ffffff; margin: 0; }

.showcase-header .view-all-link { 
    color: #ff3b3b; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 0.95rem; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    transition: transform 0.2s ease; 
    white-space: nowrap; 
}

.showcase-header .view-all-link:hover { transform: translateX(4px); }

.product-grid { 
    display: grid; 
    grid-template-columns: repeat(6, 1fr); 
    gap: 1.5rem; 
}

.product-card { 
    background-color: var(--glass-bg); 
    background-image: var(--glass-noise); 
    backdrop-filter: var(--glass-blur); 
    -webkit-backdrop-filter: var(--glass-blur); 
    border: 1px solid var(--glass-border); 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); 
    border-radius: 16px; 
    overflow: hidden; 
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease; 
    transform: translateZ(0); 
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    contain: paint; 
    -webkit-tap-highlight-color: transparent; /* Kills the mobile blue flash */
}

/* DESKTOP HOVER FIX: Only apply these transitions if a physical mouse is used */
@media (hover: hover) and (pointer: fine) {
    .product-card:hover { 
        transform: translateY(-8px) translateZ(0); 
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.15); 
        border-color: rgba(255, 59, 59, 0.3); 
    }
    .product-card:hover .product-image-container.has-hover img.primary-img { opacity: 0; }
    .product-card:hover .product-image-container.has-hover img.hover-img { opacity: 1; }
    .product-card:hover .product-add-icon { background: #ff3b3b; }
}

.product-image-container {
    width: 100%; 
    aspect-ratio: 3 / 2; 
    background: rgba(0, 0, 0, 0.2); 
    position: relative; 
    overflow: hidden; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: block; 
}

.product-image-container img {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: opacity 0.4s ease; 
}

.product-image-container img.hover-img { opacity: 0; }

/* MOBILE JS TOGGLE OVERRIDE */
.product-card.is-flipped .primary-img { opacity: 0 !important; }
.product-card.is-flipped .hover-img { opacity: 1 !important; }

/* --- MOBILE IMAGE TOGGLE BUTTON (Visual Hierarchy Fix) --- */
.mobile-image-toggle-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background-color: #1e1e1e; 
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #ffffff;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4); 
    -webkit-tap-highlight-color: transparent; /* Kills the mobile blue flash */
}

.mobile-image-toggle-btn:active {
    transform: scale(0.92);
}

.mobile-image-toggle-btn svg { width: 20px; height: 20px; pointer-events: none; }

.badge-container {
    position: absolute; 
    top: 12px; 
    left: 12px;
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    z-index: 5;
}

.product-badge {
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 0.7rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: white;
    backdrop-filter: blur(4px); 
    -webkit-backdrop-filter: blur(4px);
}

.badge-sale { background: rgba(255, 59, 59, 0.9); }
.badge-oos { background: rgba(85, 85, 85, 0.9); }
.badge-discontinuing { background: rgba(255, 152, 0, 0.9); color: #000; }

.product-details { 
    padding: 1.25rem 1.25rem 1.5rem 1.25rem; 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
    text-decoration: none;
}

.product-tag { 
    font-size: 0.7rem; 
    font-weight: 800; 
    color: #ff3b3b; 
    text-transform: uppercase; 
    letter-spacing: 1.5px; 
    margin-bottom: 0.5rem; 
}

.product-title { 
    color: #ffffff; 
    font-size: 1rem; 
    font-weight: 700; 
    line-height: 1.4; 
    margin-bottom: 1.5rem; 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

.product-price-row { 
    margin-top: auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.price-block { display: flex; align-items: center; gap: 8px; }
.product-price { font-size: 1.2rem; font-weight: 800; color: #ff3b3b; }
.price-original { text-decoration: line-through; color: #888; font-size: 0.9rem; font-weight: 500; }

.product-add-icon { 
    width: 34px; 
    height: 34px; 
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #ffffff; 
    transition: background 0.2s ease; 
}

.explore-collection-btn { text-align: center; margin-top: 2rem; }

/* --- 5. FEATURES SECTION --- */
.features-section { 
    max-width: 1400px; 
    width: calc(100% - 40px); 
    margin: 0 auto 6rem auto; 
    padding: 0 20px; 
    position: relative; 
    z-index: 10; 
}

#brand-features { scroll-margin-top: 150px; }

.feature-row { 
    display: flex; 
    align-items: center; 
    gap: 5rem; 
    margin-bottom: 8rem; 
    flex-direction: row; 
}

.feature-row:nth-child(even) { flex-direction: row-reverse; }
.feature-text { flex: 1; }
.feature-text h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; color: #ffffff; }
.feature-accent { color: #ff3b3b; }
.odometer-text { font-variant-numeric: tabular-nums; display: inline-block; min-width: 1.5em; }
.feature-text p { font-size: 1.15rem; color: #b0b0b0; line-height: 1.7; }
.feature-visual { flex: 1; position: relative; }

.feature-image-wrapper { 
    background-color: var(--glass-bg); 
    background-image: var(--glass-noise); 
    backdrop-filter: var(--glass-blur); 
    -webkit-backdrop-filter: var(--glass-blur); 
    border: 1px solid var(--glass-border); 
    box-shadow: var(--glass-shadow); 
    border-radius: 24px; 
    padding: 2rem; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    aspect-ratio: 4/3; 
    overflow: hidden; 
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.feature-image-wrapper img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 12px; 
    object-fit: contain; 
    transition: transform 0.5s ease; 
}

@media (hover: hover) and (pointer: fine) {
    .feature-image-wrapper:hover img { transform: scale(1.05); }
}

.premium-video-wrapper {
    position: relative;
    border-radius: 24px; 
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #000; 
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.premium-video-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.3) 85%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

.premium-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(1) contrast(1.1); 
}

/* =========================================================
   6. DYNAMIC SCALING & RESPONSIVENESS OVERHAUL
   ========================================================= */

@media (max-width: 1300px) { 
    .product-grid { grid-template-columns: repeat(3, 1fr); } 
}

@media (max-width: 1024px) { 
    .hero-section { 
        flex-direction: column; 
        padding: 1rem; 
        gap: 1.5rem; 
        width: 100%; 
        min-height: auto; 
        text-align: center;
    } 
    .hero-cta-group { justify-content: center; }
    .glass-hero-card { padding: 3rem 2rem; max-width: 100%; } 
    .hero-headline { font-size: 3rem; } 
    .hero-subheadline { margin: 0 auto 2.5rem auto; }
    
    /* SOLUTION 1: THE CINEMATIC CROP */
    .hero-visual-content .premium-video-wrapper {
        aspect-ratio: 16 / 9;
        width: 100%;
        max-height: 350px;
    }
    
    .showcase-wrapper { width: calc(100% - 40px); } 
    .features-section { width: calc(100% - 40px); } 
    
    .feature-row, .feature-row:nth-child(even) { 
        flex-direction: column-reverse; 
        gap: 2.5rem; 
        margin-bottom: 6rem; 
        text-align: center; 
    } 
}

@media (max-width: 850px) { 
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } 
}

@media (max-width: 768px) {
    .hero-headline { font-size: 2.5rem; }
    .feature-text h2 { font-size: 2rem; }
    .showcase-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    
    .social-proof-strip { 
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem; 
        padding: 20px; 
        width: calc(100% - 20px); 
        margin-bottom: 4rem; 
    }
    .proof-item { flex-direction: column; text-align: center; gap: 8px; font-size: 0.75rem; }
    .proof-item svg { width: 22px; height: 22px; }
}

@media (max-width: 500px) { 
    .product-grid { grid-template-columns: 1fr; } 
    .product-details { padding: 1.25rem 1rem; } 
    .product-title { font-size: 0.95rem; } 
    .product-price { font-size: 1.1rem; } 
    
    .product-add-icon { 
        width: 44px; 
        height: 44px; 
        background: rgba(255, 59, 59, 0.2); 
    }
    
    .btn { padding: 0.8rem 1.5rem; font-size: 0.9rem; width: auto; }
    .btn-large { padding: 1rem 2.2rem; }
    .hero-cta-group { flex-direction: row; justify-content: center; }
}

@media (min-width: 1025px) {
    .hide-desktop { display: none !important; }
}

/* --- CHROME SPECIFIC SCROLL OPTIMIZATIONS --- */
.showcase-category,
.features-section {
    content-visibility: auto;
    contain-intrinsic-size: 800px; 
}

/* Shift the crop of the Unified Ecosystem video to the left */
#ecosystemVideo {
    object-position: 35% center;
}