:root {
    --sidebar-width: 280px;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        sans-serif;
    background: #f8f9fa;
}

label {
    font-size: 12px;
}
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.category-checkboxes {
    height: 140px;
    overflow-y: scroll;
    border: 1px solid #ddd;
    padding: 0px 5px;
}
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background: #ff0000;
    color: white;
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 600;
}

.filter-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.filter-section h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.main-content {
    padding:1rem;
}

.main-content.griddy {
    padding: 2rem;
}
@media screen and (min-width: 768px) {
    .main-content {
    margin-left: var(--sidebar-width);
    }
}

.stats-row {
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #667eea;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* List View Styles (default) */
#productsContainer:not(.grid-view) {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#productsContainer:not(.grid-view) .product-card .card-body {
    padding: 1rem;
}

#productsContainer:not(.grid-view) .product-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f9fa;
}

/* Grid View Styles */
#productsContainer.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

#productsContainer.grid-view .product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#productsContainer.grid-view .product-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#productsContainer.grid-view .product-image {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

#productsContainer.grid-view .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#productsContainer.grid-view .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#productsContainer.grid-view .product-name {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

#productsContainer.grid-view .badges-container {
    margin-bottom: 0.75rem;
}

#productsContainer.grid-view .price-section {
    margin-top: auto;
    padding-top: 0.5rem;
}

#productsContainer.grid-view .btn-view {
    width: 100%;
    text-align: center;
    margin-top: 0.75rem;
}

#productsContainer.grid-view .product-meta {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 0.5rem;
}

/* Product Details */
.product-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}

.sale-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc3545;
}

.original-price {
    font-size: 1rem;
    color: #6c757d;
    text-decoration: line-through;
}

.discount-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.category-badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.site-badge {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid #dee2e6;
}

.stock-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stock-badge.in-stock {
    background: #d4edda;
    color: #155724;
}

.stock-badge.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.btn-view {
    background: linear-gradient(135deg, #cb0000 20%, #ff9999a6 100%);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.loader {
    text-align: center;
    padding: 3rem;
}

.spinner-border {
    color: #667eea;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.show {
        transform: translateX(0);
        max-height: 100%;
    }

    .main-content {
        margin-left: 0;
    }

    #productsContainer.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    #productsContainer:not(.grid-view) .product-card .row {
        flex-direction: column;
    }

    #productsContainer:not(.grid-view) .product-image {
        margin: 0 auto 1rem;
    }
}

@media (min-width: 768px) {
    #mobile_footer {
        display: none;
    }
}
@media screen and (max-width: 768px) {
    #mobile_footer {
        position: fixed;
        bottom: 0;
        left: 0;
        height: 105px;
        width: 100vw;
        background: white;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        padding: 0 1rem;
        border-top: 1px solid #dee2e6;
    }
}

/* Mobile Responsive */
/* Mobile List View Optimizations */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    #productsContainer.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    /* Mobile List View - Compact Layout */
    #productsContainer:not(.grid-view) .product-card .card-body {
        padding: 0.75rem;
    }
    
    #productsContainer:not(.grid-view) .mobile-layout {
        display: flex;
        gap: 0.75rem;
    }
    
    #productsContainer:not(.grid-view) .mobile-left {
        flex: 1;
        min-width: 0;
    }
    
    #productsContainer:not(.grid-view) .mobile-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
        flex-shrink: 0;
        align-items: center;
    }
    
    #productsContainer:not(.grid-view) .mobile-price {
        font-size: 1.25rem;
        font-weight: 700;
        color: #dc3545;
        white-space: nowrap;
    }
    
    #productsContainer:not(.grid-view) .mobile-image {
        width: 100px;
        height: 100px;
        object-fit: contain;
        border-radius: 4px;
        background: #f8f9fa;
    }
    
    #productsContainer:not(.grid-view) .mobile-site {
        font-size: 0.7rem;
        font-weight: 600;
        color: #667eea;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.25rem;
    }
    
    #productsContainer:not(.grid-view) .mobile-product-name {
        font-size: 0.875rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
        font-weight: 600;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    #productsContainer:not(.grid-view) .mobile-savings {
        font-size: 0.75rem;
        color: #28a745;
        margin-bottom: 0.25rem;
    }
    
    #productsContainer:not(.grid-view) .mobile-updated {
        font-size: 0.65rem;
        color: #6c757d;
        margin-bottom: 0.5rem;
    }
    
    #productsContainer:not(.grid-view) .mobile-button {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        width: 100%;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}