/*
   shop.css
   Includes slide-out filter logic, 2-column large cards, and fixed button positioning.
*/

/* ------------------------------------------------------------------- */
/* 1. SHOP HERO SECTION (No change) */
/* ------------------------------------------------------------------- */
.shop-hero-section {
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 40px;
    background-color: var(--gray-light);
}

.shop-intro-text {
    text-align: center;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ------------------------------------------------------------------- */
/* 2. MAIN SHOP LAYOUT (Desktop) */
/* ------------------------------------------------------------------- */

.main-shop-section {
    padding: 80px 0; 
    /* Crucial: Sets the context for absolutely positioned button */
    position: relative; 
}

.shop-layout {
    display: flex;
    gap: 0;
}

/* --- FILTER TOGGLE BUTTON (New Position: Top Right) --- */
.filter-toggle-container {
    /* FIX: Absolute positioning to place it top right */
    position: absolute;
    top: 50px; /* Adjust height below the hero/heading */
    right: 50px; /* Align to the right side of the container */
    z-index: 10;
    
    /* Ensure the button is only displayed on desktop */
    display: block; 
}

.filter-toggle-container .btn-outline {
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- FILTER SLIDE-OUT OVERLAY (Desktop & Mobile) --- */
.shop-sidebar {
    position: fixed;
    top: 0;
    left: -280px; 
    z-index: 1000;
    width: 250px;
    height: 100%;
    padding: 90px 20px 20px; 
    background-color: var(--white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    overflow-y: auto;
}

.shop-sidebar.active {
    left: 0; 
}

.sidebar-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    color: var(--black);
    z-index: 1001;
}

/* --- Filter Sidebar Content (No change) --- */
.filter-group { margin-bottom: 30px; }
.apply-filters-btn { width: 100%; margin-top: 20px; }


/* --- Product Grid Area (Right Column) --- */
.shop-products {
    flex: 1; 
    padding-top: 50px; /* Add space below where the filter button sits */
}

/* ------------------------------------------------------------------- */
/* 3. PRODUCT GRID DISPLAY (Larger Cards: 2 Columns on Desktop) */
/* ------------------------------------------------------------------- */

.shop-products .product-grid {
    /* FIX: Change to 2 columns for visibly larger cards on desktop */
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 40px; /* Increase gap for better visual separation */
}

/* --- Pagination (No change) --- */
.pagination-placeholder {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 10px;
}
.pagination-placeholder a {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: var(--transition);
}
.pagination-placeholder a:hover,
.pagination-placeholder a.active {
    background-color: var(--black);
    color: var(--white);
    border-color: var(--black);
}


/* ------------------------------------------------------------------- */
/* 4. RESPONSIVENESS */
/* ------------------------------------------------------------------- */

.mobile-filter-toggle {
    display: none; 
}

/* Tablet/Mobile Layout (Below 900px) */
@media (max-width: 900px) {
    .shop-layout {
        flex-direction: column; 
    }
    
    /* Hide the desktop button container on mobile */
    .filter-toggle-container {
        display: none; 
    }
    
    /* Show the mobile toggle button on mobile */
    .mobile-filter-toggle {
        display: block; 
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* --- Filter Overlay on Mobile (Slide-out remains) --- */
    .shop-sidebar {
        left: -280px; 
    }

    /* === VERTICAL GRID STACK (2 columns for tablets/phones) === */
    .shop-products {
        padding-top: 0; /* Remove padding when the desktop button is hidden */
    }
    .shop-products .product-grid { 
        display: grid; 
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px; 
        overflow-x: hidden; 
    }
    .shop-products .product-grid .product-card {
        /* THIS IS THE PROBLEM */
        flex: 1 1 100%; 
        max-width: 100%; 
        height: auto;
        margin: 0 10px;
    }
}

/* Very Small Mobile View (Below 480px) */
@media (max-width: 480px) {
    .shop-products .product-grid {
        /* Keep 2 columns even on small mobile view */
        grid-template-columns: repeat(2, 1fr); 
        column-gap: 0px;
        row-gap: 20px; 
    }
    .main-shop-section {
        padding: 40px 0;
    }
}