.products-container {
    padding: 2rem 0;
    min-height: 80vh;
}

/* Sidebar */
.filters-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
    flex: 0 0 260px; 
    margin-right: 1.5rem;
    border-right: 1px solid #e5e5e5; 
}

.filters-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #01092b;
    padding-bottom: 1rem;
}

.filters-header h4 {
    margin: 0;
    color: #01092b;
    flex: 1;
}

.clear-filters-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
}
.clear-filters-btn:hover {
    background: #c82333;
}

/* Hide close button by default */
.close-filters {
    display: none;
}

/* Filters sections */
.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.filter-section h5 {
    color: #333;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
}

.filter-checkbox {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.filter-checkbox input {
    margin-right: 0.5rem;
}

.price-range {
    margin-top: 1rem;
}
.price-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Products Header */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.products-header h2 {
    color: #01092b;
    margin: 0;
}
.products-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}
#products-count {
    color: #666;
    font-weight: 500;
}
.view-options {
    display: flex;
    gap: 0.5rem;
}
.view-btn {
    padding: 0.5rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
}
.view-btn.active {
    background: #01092b;
    color: white;
    border-color: #01092b;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 1.5rem;
}

/* Product Card */
.product-card-grid {
    background: #fff;
    border: 1px solid #e5e5e5;   
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.product-card-grid:hover {
    transform: translateY(-6px);
    border-color: #01092b;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Image */
.product-image-grid {
    width: 100%;
    height: 220px;
    object-fit: contain;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #eee;
}

/* Category */
.product-category-grid {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #01092b;
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

/* Name (with line clamp fix) */
.product-name-grid {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;   /* Safari/Chrome */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2; /* Standard property (fix warning) */
}

/* Price + Stock */
.product-price-grid {
    color: #01092b;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}
.product-stock-grid {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.product-stock-grid.in-stock { color: #28a745; }
.product-stock-grid.out-of-stock { color: #dc3545; }

/* Button */
.view-details-btn-grid {
    margin-top: auto; /* stick at bottom */
    display: block;
    width: 100%;
    padding: 0.7rem;
    background: #01092b;
    color: white;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}
.view-details-btn-grid:hover {
    background: #1a237e;
}




/* List View */
.products-list .product-card-list {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.product-image-list {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    flex-shrink: 0;
}
.product-info-list { flex: 1; }
.product-category-list {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #01092b;
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}
.product-name-list {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}
.product-description-list {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.product-price-list {
    color: #01092b;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.product-meta-list {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}
.product-stock-list { font-size: 0.9rem; }
.product-stock-list.in-stock { color: #28a745; }
.product-stock-list.out-of-stock { color: #dc3545; }
.product-actions-list {
    display: flex;
    gap: 0.5rem;
}
.view-details-btn-list {
    padding: 0.6rem 1.2rem;
    background: #01092b;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}
.view-details-btn-list:hover { background: #1a237e; }

/* Pagination */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}
.pagination .page-item.active .page-link {
    background: #01092b;
    border-color: #01092b;
    color: #fff;
}
.pagination .page-link {
    color: #01092b;
    border-radius: 6px;
}
.pagination .page-link:hover {
    background: #f1f1f1;
    color: #1a237e;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #01092b;
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* No products */
.no-products {
    text-align: center;
    padding: 3rem;
    color: #666;
}
.no-products i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

/* Mobile Sidebar + Button */
@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .products-meta {
        width: 100%;
        justify-content: space-between;
    }
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 2000;
        padding: 1.5rem;
        box-shadow: 2px 0 8px rgba(0,0,0,0.3);
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
    }
    .filters-sidebar.active {
        left: 0;
    }
    .mobile-filters-btn {
        display: inline-block;
        background: #01092b;
        color: #fff;
        padding: 6px 12px;
        border: none;
        border-radius: 5px;
        font-size: 14px;
        cursor: pointer;
    }
    .close-filters {
        display: block;
        background: none;
        border: none;
        font-size: 20px;
        color: #01092b;
        margin-left: auto;
        cursor: pointer;
    }
    .product-card-list {
        flex-direction: column;
        text-align: center;
    }
    .product-meta-list { justify-content: center; }
    .product-actions-list { justify-content: center; }
}

/* Small screens */
@media (max-width: 576px) {
    .products-container { padding: 1rem 0; }
    .filter-section {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }
    .product-image-grid { height: 150px; }
    .product-name-grid { font-size: 0.9rem; }
    .product-price-grid { font-size: 1rem; }
}

/* Responsive */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}
@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr; 
    }
    .product-image-grid {
        height: 160px;
    }
}