:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-color: #ddd;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --text-color: #333;
    --text-light: #666;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
}

.navbar-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-link:hover,
.navbar-link.active {
    color: var(--secondary-color);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.main-content .container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Filters Sidebar */
.filters-sidebar {
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.filters-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light-color);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-inputs .filter-input {
    flex: 1;
}

.price-separator {
    color: var(--text-light);
    font-weight: 500;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-checkbox span {
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--light-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #d5dbdb;
}

/* Products Section */
.products-section {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-color);
}

.products-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.products-count {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Product Card */
.product-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: var(--light-color);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.4rem 0.8rem;
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 5px;
}

.product-badge.out-of-stock {
    background-color: var(--text-light);
}

.product-content {
    padding: 1.25rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.original-price {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-badge {
    padding: 0.25rem 0.5rem;
    background-color: var(--success-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--light-color);
}

.product-category {
    font-size: 0.8rem;
    color: var(--text-light);
}

.product-stock {
    font-size: 0.8rem;
    font-weight: 500;
}

.product-stock.in-stock {
    color: var(--success-color);
}

.product-stock.low-stock {
    color: var(--warning-color);
}

.product-stock.out-of-stock {
    color: var(--secondary-color);
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 3rem 1rem;
    display: none;
}

.loading-indicator.visible {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid var(--light-color);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* End Message */
.end-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 3rem 1rem;
}

.error-message p {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Scroll Sentinel */
.scroll-sentinel {
    height: 1px;
    visibility: hidden;
}

/* Footer */
.footer {
    background-color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

/* Noscript Warning */
.noscript-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--warning-color);
    color: white;
    padding: 1rem;
    text-align: center;
    z-index: 10000;
}

.noscript-warning p {
    margin: 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .main-content .container {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar-menu {
        gap: 1rem;
    }

    .navbar-link {
        font-size: 0.9rem;
    }

    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .products-title {
        font-size: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }

    .product-image-container {
        height: 220px;
    }

    .products-section {
        padding: 1.5rem;
    }

    .filters-sidebar {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar-menu {
        display: none;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image-container {
        height: 250px;
    }

    .price-inputs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .price-separator {
        display: none;
    }
}

/* Animation for fade-in effect */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease forwards;
}

