/* ==========================================
   Global Styles & Variables
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1B4332;
    --secondary-color: #D4914A;
    --action-hover: #FFB703;
    --dark-color: #1a1a1a;
    --light-color: #f1f1f1;
    --text-color: #212529;
    --gray-color: #708D81;
    --accent-color: #708D81;
    --border-color: #e0e0e0;
    --light-bg: #f8f9fa;
    --primary-variant: #2D5A47;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

header {
    width: 100%;
    z-index: 1000;
}

/* ==========================================
   DESKTOP LAYOUT (993px and wider)
   ========================================== */
@media (min-width: 993px) {
    .products-layout {
        display: flex;
        margin-top: 0;
    }

    .products-sidebar {
        width: 260px;
        background: #1f2a36;
        color: #fff;
        padding: 20px;
        position: sticky;
        top: 80px;
        height: calc(100vh - 80px);
        overflow-y: auto;
    }

    /* Desktop Hover Effect */
    .products-sidebar button:hover {
        background: #009245;
        padding-left: 20px; /* Subtle "slide" effect */
        color: #fff;
    }

    .category-trigger {
        display: none;
    }
}

/* ==========================================
   MOBILE LAYOUT: The Transparent Grid Overlay
   ========================================== */
@media (max-width: 992px) {
    .products-layout {
        display: block;
    }

    .products-sidebar {
        position: fixed !important;
        top: 0;
        left: -100%; 
        width: 100%; 
        height: 100vh;
        background: rgba(31, 42, 54, 0.75); 
        backdrop-filter: blur(10px); 
        -webkit-backdrop-filter: blur(10px);
        color: #fff;
        padding: 80px 20px 40px 20px; 
        z-index: 5000;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        overflow-y: auto; 
    }

    .products-sidebar.open {
        left: 0 !important;
    }

    .products-sidebar h3 {
        margin-bottom: 20px;
        font-size: 1.2rem;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* Grid Layout */
    .products-sidebar ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 12px;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        padding-bottom: 40px;
    }

    .products-sidebar button {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding: 12px 8px !important;
        font-size: 0.85rem !important;
        text-align: center !important;
        border-radius: 6px !important;
        min-height: 50px;
        transition: all 0.3s ease; /* Smooth hover transition */
    }

    /* Mobile Hover/Touch Effect */
    .products-sidebar button:hover, 
    .products-sidebar button:active {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: var(--secondary-color) !important;
        transform: scale(1.02); /* Slight pop-out */
    }

    .products-sidebar button.active {
        background: var(--secondary-color) !important;
        border-color: var(--secondary-color) !important;
    }

    /* THE PULSING TAB */
    .category-trigger {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: fixed;
        left: 0;
        top: 40%;
        background: var(--secondary-color);
        color: white;
        padding: 15px 8px;
        border-radius: 0 10px 10px 0;
        cursor: pointer;
        z-index: 4500;
        box-shadow: 4px 0 10px rgba(0,0,0,0.2);
        animation: pulse-glow 2s infinite;
    }

    .category-trigger span {
        writing-mode: vertical-rl;
        font-size: 0.7rem;
        font-weight: bold;
        letter-spacing: 1px;
    }
}

/* ==========================================
   SHARED UI ELEMENTS
   ========================================== */
.products-sidebar ul {
    list-style: none;
    padding: 0;
}

.products-sidebar button {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: none;
    background: #2f3e4d;
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: 0.3s;
    border-radius: 4px;
}

.products-sidebar button.active {
    background: #009245;
}

/* ==========================================
   CONTENT AREA & GRIDS
   ========================================== */
.products-content {
    flex: 1;
    padding: 40px;
}

@media (max-width: 768px) {
    .products-content { padding: 20px; }
}

.category-section {
    display: none;
}

.category-section.active {
    display: block;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.product-card {
    background: #fff;
    padding: 0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.3s;
    text-align: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.product-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card h4 {
    padding: 5px 10px; /* Text gets the padding instead of the image */
    font-size: 1.1rem;
    color: var(--dark-color);
}




/* ==========================================
   Image Lightbox (Zoom Feature)
   ========================================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9000;
    cursor: zoom-out;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 80%;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    object-fit: contain; /* Shows the FULL image, no cropping */
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Make product images look clickable */
.product-card img {
    cursor: zoom-in;
}

/* Product Description Styling */
.product-desc {
    font-size: 0.85rem;
    color: var(--gray-color);
    padding: 2px 5px; 
    line-height: 1.4;
    text-align: center;
    font-style: italic; /* Distinguishes it from the bold title */
}

/* Adjust the title margin so it doesn't feel cramped */
.product-card h4 {
    padding: 5px 10px 7px 10px; 
    font-weight:500;
}


/* ==========================================
   CTA
   ========================================== */
.products-cta {
    margin-top: 60px;
    padding: 40px;
    background: var(--primary-variant);
    color: #fff;
    text-align: center;
}

.products-cta .cta-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 25px;
    background: var(--secondary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: 0.3s;
}

.products-cta .cta-button:hover {
    background: var(--action-hover);
}

/* ==========================================
   BACK TO TOP BUTTON
   ========================================== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #009245;
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Circle look */
    cursor: pointer;
    z-index: 1000;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: 0.3s;
    display: none; /* JS will toggle this */
}

#backToTop:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}
/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(212, 145, 74, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(212, 145, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 145, 74, 0); }
}