/* Products Page Optimized Styles */
:root {
    --primary-gradient: #9333ea;
    --primary-color: #9333ea;
    --secondary-color: #7e22ce;
    --text-dark: #1a202c;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 20px;
}

.products-page {
    background: #f8f9fa;
    min-height: 100vh;
}

.products-container {
    max-width: 1320px;
    margin: 0 auto;
}

/* Sidebar Styling */
.products-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 100px;
}

.products-sidebar h4 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-size: 1.25rem;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.category-list a:hover {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
    transform: translateX(3px);
}

.category-list a.active {
    background: #9333ea !important;
    background-image: none !important;
    color: white;
}

.category-count {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.category-list a.active .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Mobile Sidebar Collapse */
.sidebar-toggle {
    display: none;
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-weight: 600;
    color: var(--dark-color);
}

/* Content Area */
.products-content {
    background: transparent;
}

.page-header {
    background: white;
    padding: 1.75rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.page-header h2 {
    margin: 0;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.75rem;
}

.sort-dropdown {
    min-width: 220px;
}

.sort-dropdown select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Product Grid - 3 columns on desktop */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Empty State */
.empty-state {
    background: white;
    padding: 4rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.btn-load-more {
    background: #9333ea !important;
    background-image: none !important;
    color: white;
    padding: 14px 48px;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.btn-load-more:hover {
    background: #7e22ce !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 991px) {
    .products-sidebar {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .sidebar-toggle {
        display: block;
    }

    .products-sidebar {
        display: none;
        margin-bottom: 1.5rem;
    }

    .products-sidebar.show {
        display: block;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .sort-dropdown {
        width: 100%;
        min-width: auto;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 products per row */
        gap: 12px;
    }

    .product-content {
        padding: 1rem;
    }

    .btn-order,
    .btn-cart-icon {
        font-size: 0.8rem;
        padding: 0.75rem 0.5rem;
    }
}