/* ========================================= */
/* PRODUCTS SECTION - STACKING MECHANISM     */
/* ========================================= */

.products-section {
    background-color: #050505; /* Deep Black */
    color: #ffffff;
    padding: 100px 20px;
    position: relative;
    /* Ensure no overflow hidden here, or sticky breaks */
    overflow: visible; 
}

/* 1. HEADER STYLES */
.products-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 80px auto;
}

.products-header .badge {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 24px;
}

.products-header h2 {
    padding-top: 30px;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.products-header p {
    font-size: 1.25rem;
    color: #94a3b8;
    line-height: 1.6;
}

/* 2. THE STACKING CONTAINER */
.stacking-container {
    max-width: 1000px;
    margin: 0 auto;
    /* This padding allows the last card to scroll up nicely */
    padding-bottom: 100px; 
}

/* 3. THE CARD (The Sticky Magic) */
.stack-card {
    /* STICKY POSITIONING: This is what stacks them */
    position: sticky;
    
    /* Dynamic Top Calculation: 
       base (100px) + (index * 20px) offset 
       This ensures they stack like a deck, not exactly on top of each other */
    top: calc(10vh + (var(--index) * 20px));
    
    /* Margin Bottom creates space to scroll before the next card hits */
    margin-bottom: 5vh;
    
    /* Visual Styles */
    height: auto;
    min-height: 500px;
    z-index: var(--index); /* Ensure lower cards are on top */
}

.card-body {
    background-color: #0f172a; /* Dark Blue-Grey */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 50px;
    display: flex;
    gap: 40px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); /* Shadow goes UP to separate cards */
    
    /* Clean transition if you want to add hover effects later */
    transition: transform 0.3s ease;
}

/* 4. CARD CONTENT LAYOUT */
.card-content {
    flex: 1;
}

.card-number {
    font-size: 4rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.05);
    font-family: monospace;
    line-height: 1;
    margin-bottom: -10px;
}

.card-category {
    color: var(--accent-gold); /* Light Blue */
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 10px;
}

.stack-card h3 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.stack-card p {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Specs Grid */
.card-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spec .label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.spec .value {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
}

/* Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-tags span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Visual Right Side */
/* Update this existing class */
.card-visual {
    flex: 0.8;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    
    /* ADD THIS: Prevents image from spilling out of rounded corners */
    overflow: hidden; 
    
    /* Ensure the container has a defined shape/height if needed */
    position: relative;
}

/* ADD THIS NEW BLOCK to control the image size */
.card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the box without stretching */
    display: block;    /* Removes tiny white space below images */
}

/* 5. RESPONSIVE (MOBILE) */
@media (max-width: 992px) {
    .products-header h2 { font-size: 2.5rem; }
    
    .stack-card {
        top: calc(10vh + (var(--index) * 10px)); /* Tighter stacking on mobile */
        min-height: auto;
    }
    
    .card-body {
        flex-direction: column-reverse; /* Image on top */
        padding: 30px;
        gap: 20px;
    }
    
    .card-visual {
        height: 150px;
        flex: none;
    }
}

/* ========================================= */
/* FIX: TEXT COLOR ON HOVER (Force White)    */
/* ========================================= */

/* 1. Reset the main text color on hover */
.stack-card:hover .card-body {
    color: #ffffff !important; /* Forces main text white */
}

/* 2. Force specific text elements to stay white */
.stack-card:hover .card-body h3, 
.stack-card:hover .card-body p, 
.stack-card:hover .card-body .spec .value {
    color: #ffffff !important;
}

/* 3. Handle the labels (usually grey, now make them white or light grey) */
.stack-card:hover .card-body .spec .label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 4. Handle the "Card Category" (Cyan text) */
/* If you want this to stay Cyan, do nothing. 
   If you want it White too, add this: */
.stack-card:hover .card-body .card-category {
    color: #ffffff !important;
}

/* 5. Handle the big background number */
.stack-card:hover .card-body .card-number {
    color: rgba(255, 255, 255, 0.2) !important;
}