:root {
    --primary-color: #4f46e5;
    --secondary-color: #fb641b;
    --accent-color: #0cce6b;
    --light-bg: #f8fafc;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

body {
    background-color: var(--light-bg);
    margin: 0;
    padding: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* Filter Styles */
.filters-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 18px;
    margin-bottom: 20px;
    transition: all var(--transition-speed) ease;
}

.filters-section:hover {
    box-shadow: var(--hover-shadow);
}

.filter-header {
    font-size: 16px;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1a202c;
}

.filter-clear {
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.filter-clear:hover {
    color: #3730a3;
    text-decoration: underline;
}

.filter-option {
    display: block;
    padding: 10px 0;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f7f7f7;
    transition: all 0.2s;
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    color: var(--primary-color);
    padding-left: 5px;
    background-color: rgba(79, 70, 229, 0.05);
}

.filter-option.active {
    color: var(--primary-color);
    font-weight: 500;
    position: relative;
    padding-left: 5px;
}

.filter-option.active::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 3px;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

/* Product Grid */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-5px);
}

.product-image {
    height: 220px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    transition: all 0.3s;
    position: relative;
}

.product-card:hover .product-image {
    background-color: #f9fafb;
}

.product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-details {
    padding: 16px;
    border-top: 1px solid #f0f0f0;
    transition: all 0.3s;
}

.product-title {
    font-size: 15px;
    margin-bottom: 10px;
    color: #1a202c;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 500;
    transition: color 0.2s;
}

.product-card:hover .product-title {
    color: var(--primary-color);
}

.price-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.original-price {
    color: #878787;
    text-decoration: line-through;
    font-size: 14px;
}

.discount {
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 500;
    background-color: rgba(12, 206, 107, 0.1);
    padding: 1px 6px;
    
    border-radius: 4px;
}

/* Badge styling */
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.bg-success {
    background-color: var(--accent-color) !important;
}

/* Mobile Filter */
.mobile-filter-toggle {
    position: fixed;
    bottom: 12vh;
    right: 20px;
    z-index: 1002;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    display: none;
    transition: all 0.3s;
}

.mobile-filter-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.4);
}

.filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1001;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transition: transform 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.1);
}

.filter-drawer.show {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    background: white;
    padding: 10px 0;
    z-index: 1;
    border-bottom: 1px solid #eaeaea;
}

.drawer-header h3 {
    margin: 0;
    font-weight: 600;
    color: #1a202c;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #4a5568;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.drawer-close:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

/* Active Filters */
.active-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-badge {
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.2);
}

.filter-badge:hover {
    background: #3730a3;
}

.filter-badge .close {
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.2s;
}

.filter-badge .close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Add to cart popup */
.add-to-cart-popup {
    position: absolute;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 220px;
    border: 1px solid #eaeaea;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #4a5568;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f7fafc;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.quantity-input {
    width: 45px;
    height: 32px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 15px;
}

.add-btn {
    width: 100%;
    padding: 10px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.add-btn:hover {
    background: #3730a3;
}

.cart-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1001;
    animation: fadeInOut 2.5s ease;
    box-shadow: 0 4px 12px rgba(12, 206, 107, 0.3);
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    15% {
        opacity: 1;
        transform: translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Login popup */
.login-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.login-popup-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #4a5568;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

.login-btn {
    background-color: #4285f4;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.2);
}

.login-btn:hover {
    background-color: #3367d6;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    transform: translateY(-2px);
}

/* Filter overlay */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.filter-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-filter-toggle {
        display: block !important;
        z-index: 1002;
    }

    .filter-drawer {
        display: block !important;
    }

    .product-image {
        height: 160px;
    }

    .product-details {
        padding: 12px;
    }

    .filter-drawer {
        height: 80vh;
        overflow-y: auto;
    }
    
    .product-title {
        font-size: 14px;
        height: 36px;
    }
    
    .product-price {
        font-size: 16px;
    }
}

/* Loading animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}