/* Page Header Styles */
.page-header {
    background: linear-gradient(rgba(79, 70, 229, 0.9), rgba(99, 102, 241, 0.9)), url('https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3') center/cover;
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
}

/* Main Container with Sidebar */
.products-container {
    padding: 3rem 0;
    display: flex;
    gap: 2rem;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 100px;
    transition: transform 0.3s ease-in-out;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.filter-section ul {
    list-style: none;
}

.filter-section li {
    margin-bottom: 0.8rem;
}

.filter-section input {
    margin-right: 10px;
}

.price-inputs {
    display: flex;
    gap: 10px;
}

.price-inputs input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Main Content Area */
.main-content {
    flex: 1;
}

.search-sort-bar {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex-grow: 1;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.sort-dropdown select {
    padding: 0.8rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
}

.results-count {
    color: #64748b;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Mobile Filter Specific Styles */
.mobile-filter-toggle {
    display: none;
}

.close-filters {
    display: none;
}

.filter-overlay {
    display: none;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    gap: 8px;
}

.pagination button {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--dark);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    background-color: #f1f5f9;
    color: #cbd5e1;
    cursor: not-allowed;
}

/* Responsive Styles for Mobile & Tablet */
@media (max-width: 1024px) {
    .products-container {
        flex-direction: column;
    }

    .search-sort-bar {
        justify-content: center;
    }

    .mobile-filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 0.6rem 1rem;
        background-color: var(--primary);
        color: white;
        border: none;
        border-radius: 50px;
        font-size: 0.9rem;
        cursor: pointer;
        order: -1;
        margin-bottom: 1rem;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 300px;
        height: 100%;
        z-index: 1100;
        transform: translateX(-100%);
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .close-filters {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 2rem;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--dark);
    }

    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 1050;
    }
    
    .filter-overlay.open {
        display: block;
    }
}