        :root {
            --primary: #0056b3;
            --primary-dark: hsl(212, 100%, 29%);
            --secondary: #ffc220;
            --accent: #e31837;
            --light: #f8f9fa;
            --dark: #343a40;
            --gray: #6c757d;
            --light-gray: #e9ecef;
            --border: #dee2e6;
            --success: #28a745;
            --warning: #ffc107;
            --danger: #dc3545;
            --shadow: 0 2px 10px rgba(0,0,0,0.1);
            --radius: 8px;
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: #f5f7fa;
            color: var(--dark);
            line-height: 1.6;
        }

        .container {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 15px;
        }

        .container-fluid {
            width: 100%;
            padding: 0 15px;
        }

        /* Header Styles */
        .header-top {
            background-color: var(--primary);
            color: white;
            padding: 10px 0;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: var(--shadow);
        }

        .header-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .logo {
            font-size: 24px;
            font-weight: bold;
            color: white;
            text-decoration: none;
        }

        .logo span {
            color: var(--secondary);
        }

.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    transition: all 0.3s ease-in-out;
}

        /* .search-bar {
            display: flex;
            flex: 1;
            max-width: 600px;
            margin: 0 20px;
        } */

        .mobile-search-toggle {
            display: none;
        }

        .search-bar input {
            width: 100%;
            padding: 10px 15px;
            border: none;
            border-radius: var(--radius) 0 0 var(--radius);
            font-size: 16px;
        }

        .search-bar button {
            background: var(--secondary);
            border: none;
            padding: 0 20px;
            border-radius: 0 var(--radius) var(--radius) 0;
            cursor: pointer;
            color: var(--dark);
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .header-action {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: white;
            font-size: 12px;
            cursor: pointer;
        }

        .header-action i {
            font-size: 18px;
            margin-bottom: 3px;
        }

        .cart-icon {
            position: relative;
        }

        .cart-count {
            position: absolute;
            top: -8px;
            right: -8px;
            background: var(--accent);
            color: white;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            font-size: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .auth-links {
            display: flex;
            gap: 15px;
        }

        .auth-link {
            color: white;
            text-decoration: none;
            font-size: 14px;
        }

        .start-selling-btn {
            background: var(--secondary);
            color: var(--dark);
            padding: 6px 12px;
            border-radius: var(--radius);
            text-decoration: none;
            font-weight: bold;
            font-size: 14px;
        }

        /* Navigation Styles - FIXED */
        .nav-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            background: white;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            position: relative;
        }

        .nav-links {
            display: flex;
            list-style: none;
            gap: 25px;
            position: relative;
        }

        .nav-links li {
            position: relative;
        }

        .nav-links a {
            color: var(--dark);
            text-decoration: none;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 8px 0;
            transition: var(--transition);
        }

        .nav-links a:hover {
            color: var(--primary);
        }

        /* Dropdown Styles - FIXED */
        .dropdown-content {
            position: absolute;
            top: 100%;
            left: 0;
            background: white;
            min-width: 200px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            border-radius: var(--radius);
            padding: 10px 0;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: var(--transition);
        }

        .dropdown:hover .dropdown-content {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .dropdown-content a {
            display: block;
            padding: 8px 20px;
            color: var(--dark);
            text-decoration: none;
            transition: var(--transition);
            white-space: nowrap;
        }

        .dropdown-content a:hover {
            background: var(--light);
            color: var(--primary);
        }

        /* Mega Dropdown Styles - FIXED */
        .mega-dropdown {
            position: static;
        }

        .mega-dropdown-content {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            border-radius: var(--radius);
            padding: 25px;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: var(--transition);
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 25px;
            max-height: 400px;
            overflow-y: auto;
        }

        .mega-dropdown:hover .mega-dropdown-content {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .mega-column {
            display: flex;
            flex-direction: column;
            width: 100%;
        }

        .mega-column h4 {
            color: var(--primary);
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 2px solid var(--light);
            font-size: 16px;
        }

        .mega-column a {
            display: block;
            padding: 6px 0;
            color: var(--dark);
            text-decoration: none;
            transition: var(--transition);
            font-size: 14px;
            border-bottom: 1px solid transparent;
        }

        .mega-column a:hover {
            color: var(--primary);
            border-bottom-color: var(--primary);
            padding-left: 5px;
        }

        .mega-column a:last-child {
            margin-top: 8px;
            font-weight: bold;
            color: var(--primary);
            border-bottom: none;
        }

        .mega-column a:last-child:hover {
            padding-left: 0;
            text-decoration: underline;
        }

        .nav-promo {
            background: linear-gradient(90deg, var(--primary), var(--primary-dark));
            color: white;
            padding: 8px 15px;
            border-radius: var(--radius);
            font-size: 14px;
            white-space: nowrap;
        }

        /* Mobile Navigation */
        .mobile-menu-toggle {
            display: none;
            flex-direction: column;
            background: none;
            border: none;
            cursor: pointer;
            width: 24px;
            height: 18px;
            justify-content: space-between;
        }

        .mobile-menu-toggle span {
            height: 2px;
            width: 100%;
            background-color: white;
            border-radius: 2px;
        }

        .mobile-nav {
            position: fixed;
            top: 0;
            left: -100%;
            width: 80%;
            max-width: 300px;
            height: 100vh;
            background: white;
            z-index: 1100;
            box-shadow: 2px 0 10px rgba(0,0,0,0.1);
            transition: var(--transition);
            overflow-y: auto;
            padding: 20px;
        }

        .mobile-nav.active {
            left: 0;
        }

        .mobile-nav-close {
            position: absolute;
            top: 15px;
            right: 15px;
            background: none;
            border: none;
            font-size: 20px;
            color: var(--dark);
            cursor: pointer;
        }

        .mobile-nav-links {
            list-style: none;
            margin-top: 30px;
        }

        .mobile-nav-links li {
            margin-bottom: 15px;
        }

        .mobile-nav-links a {
            color: var(--dark);
            text-decoration: none;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .mobile-dropdown-content {
            display: none;
            padding-left: 15px;
            margin-top: 10px;
            border-left: 2px solid var(--light);
        }

        .mobile-dropdown-content.active {
            display: block;
        }

        .mobile-mega-column {
            margin-bottom: 15px;
        }

        .mobile-mega-column h4 {
            color: var(--primary);
            margin-bottom: 8px;
            font-size: 16px;
        }

        .mobile-mega-column a {
            display: block;
            padding: 5px 0;
            color: var(--dark);
            text-decoration: none;
            font-size: 14px;
        }

        .mobile-mega-column a:last-child {
            font-weight: bold;
            color: var(--primary);
            margin-top: 5px;
        }

        .mobile-nav-promo {
            background: var(--primary);
            color: white;
            padding: 10px;
            border-radius: var(--radius);
            text-align: center;
            margin-top: 30px;
            font-size: 14px;
        }

        /* Main Content */
        .main-content {
            display: flex;
            gap: 10px;
            padding: 10px 0;
        }

        /* Sidebar Filters */
        .sidebar {
            width: 250px;
            background: white;
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow);
            height: fit-content;
            position: sticky;
            top: 100px;
        }

        .sidebar h3 {
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
            color: var(--dark);
        }

        .filter-section {
            margin-bottom: 20px;
            border-bottom: 1px solid var(--border);
            padding-bottom: 15px;
        }

        .filter-title {
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            font-weight: 500;
        }

        .filter-options {
            margin-top: 10px;
            display: none;
        }

        .filter-options.active {
            display: block;
        }

        .filter-option {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
        }

        .filter-option input {
            margin-right: 10px;
        }

        /* Products Section */
        .products-section {
            flex: 1;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            background: white;
            padding: 15px 20px;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }

        .section-title {
            font-size: 24px;
            color: var(--dark);
        }

        .sort-options {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .sort-options select {
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: white;
        }

        /* Products Grid */
        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 20px;
        }

        .product-card {
            background: white;
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
            position: relative;
        }

        .product-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .product-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            background: var(--accent);
            color: white;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
            z-index: 2;
        }

/* Add to your existing <style> block inside the {% block extra_css %} */

/* --- Wishlist Icon Overlay Styles --- */

/* The container holding the badge/icon, relative to main image container */
.verified-badge { 
    position: absolute; /* Position relative to the .main-image-container */
    top: 15px; /* Adjust vertical placement */
    right: 15px; /* Adjust horizontal placement */
    z-index: 10; /* Ensure it's above the image */
}

/* Style the icon itself to look professional and not like a button */
.wishlist-btn {
    display: flex; /* Centers the icon */
    align-items: center;
    justify-content: center;
    /* Size and shape of the icon's background */
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Makes it a circle */
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* Background and shadow for professional look */
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none; /* Remove default button border */
    padding: 0; /* Remove default button padding */
}

/* Style the heart icon */
.wishlist-btn i {
    font-size: 1.2rem; /* Make the icon size appropriate */
    /* Use black/dark grey for outline, or primary color */
    color: #495057; 
}

/* Hover effects */
.wishlist-btn:hover {
    background-color: white;
    transform: scale(1.1); /* Slight animation on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Active/In-Wishlist State */
.wishlist-btn.active-wishlist i,
.wishlist-btn:hover i.fas {
    /* When active, make it red */
    color: #dc3545 !important; 
}

        .product-image {
            height: 200px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--light);
        }

        .product-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            transition: var(--transition);
        }

        .product-card:hover .product-image img {
            transform: scale(1.05);
        }

        .product-info {
            padding: 15px;
        }

        .seller-store-link {
            color: var(--primary);
            text-decoration: none;
            font-size: 12px;
            margin-bottom: 5px;
            display: block;
        }

        .seller-store-link:hover {
            text-decoration: underline;
        }

        .product-category {
            color: var(--gray);
            font-size: 12px;
            margin-bottom: 5px;
        }

        .product-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 8px;
            line-height: 1.3;
        }

        .product-title a {
            color: inherit;
            text-decoration: none;
        }

        .product-title a:hover {
            color: var(--primary);
        }

        .product-rating {
            display: flex;
            align-items: center;
            gap: 5px;
            margin-bottom: 10px;
            font-size: 14px;
        }

        .product-price {
            margin-bottom: 15px;
        }

        .current-price {
            font-size: 18px;
            font-weight: bold;
            color: var(--dark);
        }

        .original-price {
            font-size: 14px;
            color: var(--gray);
            text-decoration: line-through;
            margin-left: 8px;
        }

        .discount {
            color: var(--accent);
            font-size: 14px;
            font-weight: bold;
            margin-left: 8px;
        }

        .product-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .btn- {
            border: none;
            border-radius: var(--radius);
            cursor: pointer;
            font-weight: 500;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            text-decoration: none;
            font-size: 14px;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: var(--primary-dark);
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--primary);
            color: var(--primary);
        }

        .btn-outline:hover {
            background: var(--primary);
            color: white;
        }

  /* Ensure the button elements themselves take up the full height available in the flex container */
.product-actions .d-flex button,
.product-actions .d-flex .add-to-cart-form {
    height: 100%;
}

.buy-now-btn {
    /* Keep existing colors */
    background: var(--secondary);
    color: var(--dark);
    font-weight: bold;
    /* Ensure the button uses padding for size */
    padding: 8px 12px;
    border: none; /* Remove border if not needed for solid color buttons */
}

.buy-now-btn:hover {
    background: #e6ac00; /* Keep existing hover color */
}

.add-to-cart-btn {
    /* Keep existing colors */
    background: white;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 12px;
}

.add-to-cart-btn:hover {
    /* Keep existing hover colors */
    background: var(--primary);
    color: white;
}

.wishlist-btn {
    /* Keep existing colors */
    background: white;
    border: 1px solid var(--accent);
    color: var(--accent);
    
    /* REMOVED: width: 40px; */
    
    /* Set padding to make it a square icon button */
    padding: 8px; 
    
    /* Ensure only the icon is visible by setting font size */
    font-size: 1rem; 
    flex-shrink: 0; /* Prevents it from shrinking under pressure */
}

.wishlist-btn:hover {
    /* Keep existing hover colors */
    background: var(--accent);
    color: white;
}

        /* Horizontal Scrollable Cards */
        .horizontal-scroll-section {
            margin: 40px 0;
        }

        .section-title-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .section-title-bar h2 {
            font-size: 22px;
            color: var(--dark);
        }

        .view-all-link {
            color: var(--primary);
            text-decoration: none;
            font-weight: 500;
        }

        .view-all-link:hover {
            text-decoration: underline;
        }

        .horizontal-scroll-container {
            display: flex;
            overflow-x: auto;
            gap: 15px;
            padding: 10px 0;
            scrollbar-width: thin;
            scrollbar-color: var(--primary) var(--light-gray);
        }

        .horizontal-scroll-container::-webkit-scrollbar {
            height: 8px;
        }

        .horizontal-scroll-container::-webkit-scrollbar-track {
            background: var(--light-gray);
            border-radius: 10px;
        }

        .horizontal-scroll-container::-webkit-scrollbar-thumb {
            background: var(--primary);
            border-radius: 10px;
        }

        .scroll-card {
            min-width: 200px;
            background: white;
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
        }

        .scroll-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .scroll-card-image {
            height: 150px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--light);
        }

        .scroll-card-image img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .scroll-card-content {
            padding: 15px;
        }

        .scroll-card-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 8px;
            line-height: 1.3;
        }

        .scroll-card-price {
            font-size: 18px;
            font-weight: bold;
            color: var(--dark);
        }

        /* Pagination */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 40px;
        }

        /* --- Desktop Styles (Search Bar visible by default) --- */
.search-bar {
    /* Your existing desktop styles */
    display: flex; /* Ensure it's visible on desktop */
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

/* Hide the toggle button on desktop */
.mobile-search-toggle {
    display: none;
}

/* --- Mobile Styles (Hiding/Showing the Search Bar) --- */
@media (max-width: 991px) {
    /* Show the mobile toggle button */
    .mobile-search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        font-size: 1.2rem;
        padding: 8px;
        border-radius: 50%;
        transition: all 0.3s ease;
        order: -1; /* Move toggle button to the left of header actions */
    }

    .mobile-search-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* 1. Initially hide the main search bar on small screens */
    .search-bar {
        position: absolute;
        top: 100%; /* Position it below the header-top */
        left: 0;
        width: 100%;
        height: 0;
        margin: 0;
        padding: 0 15px;
        overflow: hidden;
        /* Hiding properties */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        z-index: 1000;
        background-color: white;
        border-top: 1px solid #eee;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    /* 2. Show and expand the search bar when the active class is applied */
    .search-bar.search-bar-active {
        display: flex;
        height: auto;
        padding: 15px;
        opacity: 1;
        visibility: visible;
    }

    /* Style the search bar input and button for mobile */
    .search-bar input {
        border: 1px solid var(--border);
        border-right: none;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .search-bar button {
        background: var(--secondary);
        border: 1px solid var(--border);
        border-left: none;
    }

    /* Adjust header layout for mobile */
    .header-container {
        position: relative;
    }

    .header-actions {
        gap: 10px;
    }

    /* Hide some header actions when search is active to save space */
    .search-bar-active ~ .header-actions .auth-links,
    .search-bar-active ~ .header-actions .header-action:not(.cart-icon) {
        display: none;
    }
}
        /* Responsive Design */
        @media (max-width: 1024px) {
            .main-content {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                position: static;
                margin-bottom: 20px;
            }
            
            .products-grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            }
            
            .mega-dropdown-content {
                grid-template-columns: repeat(2, 1fr);
                max-height: 300px;
            }
        }

        @media (max-width: 768px) {
            .header-container {
                flex-wrap: wrap;
            }
            
            .search-bar {
                order: 3;
                margin: 10px 0 0;
                max-width: 100%;
            }
            
            .header-actions {
                gap: 15px;
            }
            
            .nav-container {
                display: none; /* Hide desktop nav on mobile */
            }
            
            .mobile-menu-toggle {
                display: flex;
            }
            
            .auth-links {
                display: none;
            }
            
            .section-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 15px;
            }
            
            .products-grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 15px;
            }
            
            .product-image {
                height: 150px;
            }
        }

        @media (max-width: 480px) {
            .products-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .product-image {
                height: 120px;
            }
            
            .product-info {
                padding: 10px;
            }
            
            .product-title {
                font-size: 14px;
            }
            
            .current-price {
                font-size: 16px;
            }
            
   
            .mega-dropdown-content {
                grid-template-columns: 1fr;
                padding: 15px;
            }
        }

/* Style for your existing mobile-menu-toggle button to work with sidebar */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 18px;
    justify-content: space-between;
    padding: 0;
    margin-right: 1rem;
}

.mobile-menu-toggle span {
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: var(--transition);
}

/* Hide on desktop when sidebar is present */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Show on mobile */
@media (max-width: 991.98px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}