/* Section & Container Setup */
.products-section {
    padding: 120px 0 80px 0; /* Top padding handles fixed header overlap */
    background-color: #fcfcfc;
}

.products-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px; /* Adds breathing room on screen edges */
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.8rem;
    color: var(--dark-green);
}

/* Grid Logic */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-auto-rows: 350px;
    gap: 25px;
}

@media (min-width: 992px) {
    .product-card.featured {
        grid-column: span 2;
    }
}

/* Card Styling */
.product-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 20%, rgba(0,0,0,0.85) 100%);
    display: flex;
    /* This is the key: it centers the content block horizontally */
    justify-content: center; 
    /* This keeps it at the bottom */
    align-items: flex-end; 
    padding: 40px;
    transition: background 0.3s ease;
}

.card-content {
    max-width: 800px; 
    width: 100%;
    display: flex;
    flex-direction: column;
    /* This ensures the block itself stays to the left of its container */
    align-items: flex-start; 
    /* This ensures the text inside the block is forced to the left */
    text-align: left; 
}

/* Interaction Effects */
.product-card:hover {
    transform: translateY(-8px);
}

.product-card:hover .card-overlay {
    background: linear-gradient(to bottom, rgba(34, 197, 94, 0.1) 0%, rgba(0,0,0,0.9) 100%);
}

.card-content h3, 
.card-content p, 
.explore-link {
    /* Absolute insurance that no parent inheritance flips the alignment */
    text-align: left; 
    align-self: flex-start;
    width: 100%;
}

/* Text & Visual Hints */
.card-content h3 {
    color: #ffffff;
    font-size: 1.7rem;
    margin-bottom: 10px;
}

.card-content p {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    /* Optional: prevents the paragraph from stretching too wide on the featured card */
    max-width: 500px; 
}

.explore-link {
    display: block;
    margin-top: 15px;
    color: var(--volt-lime);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateX(-15px);
    transition: all 0.3s ease;
}

.product-card:hover .explore-link {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Mobile Check */
@media (max-width: 600px) {
    .section-title { font-size: 2rem; }
    .product-grid { grid-auto-rows: 300px; }
}

/* For mobile/smaller cards, we can keep the max-width tight */
@media (max-width: 991px) {
    .explore-link {
        opacity: 1 !important;
        transform: translateX(0) !important;
        /* Optional: make it slightly more prominent on mobile */
        font-size: 0.85rem;
        margin-top: 12px;
    }   
    .card-content {
        max-width: 100%;
    }
    .card-overlay {
        padding: 25px;
        background: linear-gradient(to bottom, transparent 10%, rgba(0,0,0,0.85) 100%);
    }

    .product-card:active {
        transform: scale(0.98); /* Slight shrink effect */
        filter: brightness(0.8); /* Dims the image slightly */
        transition: 0.1s; /* Fast response for the tap */
    }
}