/* Root variables should be inside :root selector */
:root {
    --primary: #0d6efd;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #ffffff;
    --black: #000000;
    --gray: #6c757d;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --body-bg: #f5f5f5;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    /* New color variables */
    --yellow-bg: #fffde7; /* Mastered yellow background */
    --emerald-charcoal: #264348; /* Emerald charcoal */
    --cobalt-blue: #0047ab; /* Cobalt blue */
    --spin-duration: 1s; /* Spin animation duration */
    --burgundy: #800020; /* Burgundy color for hero section */
    --rose-gold: #B76E79; /* Rose gold color for slogan */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--yellow-bg); /* Updated to mastered yellow */
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: none;
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== MOBILE-FIRST RESPONSIVE DESIGN ===== */
/* Mobile Header Structure - matches visiontech.co.ke */
.mobile-header {
    display: none;
}

.mobile-top-bar {
    display: none;
}

/* Default desktop styles remain the same */
.top-bar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    font-size: 0.9rem;
    background-color: var(--dark);
    color: var(--white);
    padding: 8px 0;
}

.header {
    position: fixed;
    top: 33px; /* Height of top bar */
    width: 100%;
    z-index: 999;
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.navbar {
    position: fixed;
    top: 93px; /* Height of top bar + header */
    width: 100%;
    z-index: 998;
    padding: 0;
    background-color: var(--primary) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Adjust main content for fixed headers */
main {
    padding-top: 180px; /* Height of top bar + header + navbar */
}

/* Top Bar Styling */
.top-bar .social-icons a {
    color: var(--white);
    margin-left: 10px;
    font-size: 1rem;
}

.top-bar a {
    position: relative;
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-bar a:hover {
    color: #f8f9fa;
}

.top-bar a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: white;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.top-bar a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Header Styling */
.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    line-height: 1.2;
}

.search-form {
    position: relative;
}

.search-form .form-control {
    border-radius: 20px 0 0 20px;
    font-size: 0.9rem;
}

.search-form .btn {
    border-radius: 0 20px 20px 0;
    padding: 0.375rem 0.75rem;
}

.header-icons .btn-link {
    padding: 5px 10px;
    font-size: 1.1rem;
}

/* Navigation Styling */
.navbar .navbar-nav .nav-link {
    color: var(--white);
    padding: 0.8rem 1rem;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.navbar .dropdown-toggle::after {
    display: none !important;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    background-color: rgba(0, 0, 0, 0.15);
}

.navbar .dropdown-menu {
    border: none;
    border-radius: 0;
    box-shadow: var(--card-shadow);
    margin-top: 0;
    font-size: 0.9rem;
    max-height: none !important;
    overflow-y: visible !important;
}

/* Category toggle buttons */
.toggle-subcategories {
    background: none;
    border: none;
    color: #333;
    padding: 0;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-subcategories:hover {
    color: var(--primary);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.subcategories-list {
    padding-left: 15px;
    margin-top: 5px;
    list-style: none;
}

.subcategories-list li {
    padding: 3px 0;
}

.subcategories-list a {
    display: block;
    padding: 5px 0;
    color: #555;
    transition: color 0.2s;
}

.subcategories-list a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: stretch;
    background-color: var(--burgundy); /* Burgundy background */
}

/* Cobalt Blue Category Card */
.hero-left {
    flex: 0 0 22%;
    background-color: var(--cobalt-blue) !important; /* Cobalt blue */
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    color: white !important; /* White text */
}

.hero-left .category-link,
.hero-left .toggle-subcategories {
    color: white !important;
}

.hero-left .subcategories-list a {
    color: #e0e0e0 !important;
}

.hero-left .category-link {
    background-color: rgba(255, 255, 255, 0.1);
}

.hero-left .category-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Emerald Charcoal Hero Middle */
.hero-middle {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    height: 400px;
    background-color: var(--emerald-charcoal) !important; /* Emerald charcoal */
}

.trending-container {
    position: relative;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3));
    padding: 20px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.today-deal {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #dc3545;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Updated Rotation Animation */
@keyframes spinAndPause {
    0% {
        transform: rotate(0deg);
    }
    14.2857% { /* 1s rotation out of 7s total (1s rotation + 6s pause) */
        transform: rotate(360deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.dance-animation {
    max-height: 180px;
    margin: 0 auto;
    display: block;
    animation: spinAndPause 7s ease-in-out infinite;
}

.hero-middle h3 {
    font-size: 1.4rem;
    margin-top: 10px;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.hero-middle p {
    font-size: 0.9rem;
    margin-bottom: 10px;
    max-width: 90%;
    line-height: 1.4;
}

.shop-now-btn {
    background-color: #0d6efd;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    bottom: 20px;
    left: 20px;
    animation: pulse 1.5s infinite;
}

/* UPDATED HERO SLOGAN WITH MASTRED YELLOW */
.hero-slogan {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #E6B800 !important; /* Mastred yellow color */
    font-weight: 700; /* Bold */
    font-size: 1.1rem;
    text-align: right;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    max-width: 60%;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    z-index: 5;
    animation: pulse 1.5s infinite; /* Breathing animation */
}

/* UPDATED PULSE ANIMATION FOR YELLOW */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(230, 184, 0, 0.3);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(230, 184, 0, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(230, 184, 0, 0);
    }
}

/* Right Banner */
.hero-right {
    flex: 0 0 22%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 400px;
}

.hero-banner {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: 100%;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-images {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    height: 190px;
}

.category-image-item {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.category-image-item:hover {
    transform: translateY(-5px);
}

.category-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hot Sales Section */
.hot-sales {
    margin: 40px 0;
    padding: 25px;
    background-color: #1a1a2e; /* Updated color */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.hot-sales .section-title {
    color: white !important; /* White text for visibility */
}

.hot-sales::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #ff6b6b, #ff8e53, #ff6b6b);
    animation: hotSaleGradient 3s ease infinite;
    background-size: 200% 200%;
}

/* Make Hot Sales title white */
.hot-sales .section-title {
    color: white !important;
}

@keyframes hotSaleGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Updated Hot Sales Animation */
.hot-sales-container {
    overflow: hidden;
    position: relative;
    height: 400px;
}

.hot-sales-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    animation: hotSalesScroll 30s linear infinite;
    width: max-content;
}

.hot-sales-item {
    flex: 0 0 auto;
    width: 300px;
    margin-right: 25px;
    transition: transform 0.3s ease;
}

.hot-sales-item:hover {
    transform: translateY(-5px);
}

.hot-sales-container:hover .hot-sales-track {
    animation-play-state: paused;
}

@keyframes hotSalesScroll {
    0% {
        transform: translateX(100%); /* Start from right */
    }
    100% {
        transform: translateX(-100%); /* Move to left */
    }
}

/* Enhanced HotSale item hover effect */
.hot-sales-item .card {
    transition: all 0.3s ease;
}

.hot-sales-item .card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Category Sections */
.category-section {
    margin: 50px 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0d6efd;
}

.view-all-link {
    font-size: 0.9rem;
    color: #0d6efd;
    text-decoration: none;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* ===== ENHANCED PRODUCT GRID - MOBILE FIRST APPROACH ===== */
/* Mobile-first: Start with 2 columns for mobile */
.product-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

/* Tablet: 3 columns */
@media (min-width: 768px) {
    .product-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Desktop: 4 columns */
@media (min-width: 992px) {
    .product-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-bottom: 30px;
    }
}

/* Equal height cards for perfect alignment */
.equal-height-cards {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.equal-height-cards .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.equal-height-cards .card-body .btn-group {
    margin-top: auto;
}

/* Sections */
.section-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--primary);
    position: relative;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background-color: var(--danger);
}

/* Product Cards */
.product-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    overflow: hidden;
    position: relative;
    height: 100%;
    margin-bottom: 1.5rem;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}

.product-card .card-img-top {
    height: 180px;
    object-fit: contain;
    padding: 12px;
    background-color: var(--light);
}

.product-card .card-body {
    padding: 1rem;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    height: 2.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.text-decoration-line-through {
    font-size: 0.85rem;
    margin-left: 5px;
}

.product-card .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

/* ===== EXPANDABLE PRODUCT DETAILS USING DETAILS ELEMENT ===== */
/* Hide the default <details> disclosure widget */
.product-details-element > summary { 
    list-style: none; 
    display: none; /* Completely hide the default summary */
}

.product-details-element > summary::-webkit-details-marker { 
    display: none; 
}

/* Full details section - hidden by default */
.product-full-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Show full details when details element is open */
.product-details-element[open] .product-full-details {
    display: block;
}

/* View Details button styling */
.view-details-btn {
    width: 100%;
    margin-top: 8px;
}

/* Category Cards */
.category-card {
    transition: transform 0.3s;
    border: none;
    text-align: center;
    background-color: var(--white);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    height: 100%;
    margin-bottom: 1.5rem;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}

.category-card .icon-placeholder {
    width: 70px;
    height: 70px;
    background-color: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.category-card .card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.category-card .card-text {
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

/* Footer */
footer {
    background-color: var(--dark);
    color: var(--white);
    padding: 2.5rem 0 1.5rem;
}

footer h5 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.4rem;
}

footer h5::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary);
}

footer ul.list-unstyled li {
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
}

footer ul.list-unstyled li i {
    width: 20px;
    margin-right: 8px;
}

footer .social-icons a {
    color: var(--white);
    font-size: 1.1rem;
    margin-right: 12px;
    transition: color 0.3s;
}

footer .social-icons a:hover {
    color: var(--primary);
    text-decoration: none;
}

footer .btn {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    transition: all 0.3s;
}

footer .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

footer .btn-outline-light:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Contact links */
footer a.text-white {
    transition: color 0.3s;
}

footer a.text-white:hover {
    color: var(--primary) !important;
    text-decoration: none;
}

/* Cart Page */
.cart-table img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

/* Checkout Form */
.checkout-form .form-label {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Payment Instructions */
.payment-card {
    background-color: var(--light);
    border-left: 4px solid var(--success);
    padding: 1rem;
    font-size: 0.9rem;
}

/* Success Message Card */
.success-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 2rem auto;
    max-width: 600px;
    text-align: center;
    border-left: 4px solid var(--success);
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--success);
}

.success-card p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.success-card .order-details {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.success-card .order-details p {
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.success-card .btn {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    font-size: 1.1rem;
}

/* Admin Styles */
.admin-dashboard .card {
    margin-bottom: 1.2rem;
    border: none;
    box-shadow: var(--card-shadow);
}

.admin-dashboard .card-body {
    padding: 1.2rem;
}

.admin-dashboard .display-4 {
    font-size: 2.2rem;
    font-weight: 600;
}

/* Search Results */
.search-form {
    position: relative;
}

.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
}

.search-result-text {
    flex: 1;
}

.search-result-text .product-name {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.search-result-text .product-price {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* ===== FIXES FOR MOBILE RESPONSIVE ISSUES ===== */

/* Hide mobile navigation elements on larger devices */
@media (min-width: 768px) {
    .mobile-nav-drawer,
    .mobile-nav-overlay,
    .mobile-top-bar,
    .mobile-header {
        display: none !important;
    }
}

/* Ensure hamburger menu categories only show when drawer is open */
.mobile-nav-drawer:not(.open) {
    left: -280px;
}

/* Make mobile top bar contact info clickable */
.mobile-top-bar a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-top-bar a:hover {
    color: #f8f9fa;
    text-decoration: underline;
}

/* Additional specificity for mobile navigation */
.mobile-nav-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-categories li {
    border-bottom: 1px solid #eee;
}

.mobile-subcategories {
    list-style: none;
    padding-left: 15px;
    margin: 5px 0;
}

.mobile-subcategories li {
    border-bottom: none;
    padding: 5px 0;
}

.mobile-subcategories a {
    font-size: 0.9rem;
    color: #666;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
/* Large devices (laptops/desktops, 992px and up) - Default desktop styles above */
@media (max-width: 1199px) {
    .site-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-title::after {
        width: 70px;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media (max-width: 991px) {
    .header .search-form {
        margin-top: 12px;
        width: 100%;
    }
    
    .site-title {
        font-size: 1.4rem;
    }
    
    .navbar .navbar-nav .nav-link {
        padding: 0.6rem 0.8rem;
    }
    
    .hero-section {
        flex-direction: column;
    }
    
    .hero-left,
    .hero-middle,
    .hero-right {
        flex: 0 0 100% !important;
        max-height: none !important;
        height: auto !important;
    }
    
    .hero-middle {
        height: 350px !important;
    }
    
    .hero-right {
        flex-direction: row !important;
        gap: 15px;
        height: auto !important;
    }
    
    .hero-banner,
    .category-images {
        width: 50% !important;
        height: 200px !important;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .product-card .card-img-top {
        height: 160px;
    }
    
    .category-card .icon-placeholder {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }
    
    .navbar-collapse {
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (max-width: 767px) {
    /* Hide desktop headers and show mobile headers */
    .top-bar,
    .header,
    .navbar {
        display: none !important;
    }
    
    .mobile-top-bar,
    .mobile-header {
        display: block !important;
    }
    
    /* Reset main padding for mobile */
    main {
        padding-top: 100px !important;
    }
    
    /* Mobile Top Bar - Contact info only - NOW CLICKABLE */
    .mobile-top-bar {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
        background-color: var(--dark);
        color: var(--white);
        padding: 8px 0;
        font-size: 0.8rem;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .mobile-top-bar .container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    /* Mobile Header - matches visiontech.co.ke layout */
    .mobile-header {
        position: fixed;
        top: 33px;
        width: 100%;
        z-index: 999;
        background-color: var(--white);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding: 10px 15px;
    }
    
    .mobile-header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    /* Hamburger menu on left */
    .mobile-hamburger {
        flex: 0 0 auto;
    }
    
    .mobile-hamburger .navbar-toggler {
        border: none;
        padding: 4px 8px;
        font-size: 1.2rem;
        color: var(--dark);
        background: none;
    }
    
    .mobile-hamburger .navbar-toggler:focus {
        box-shadow: none;
    }
    
    /* Search bar in middle */
    .mobile-search {
        flex: 1;
        margin: 0 15px;
    }
    
    .mobile-search .search-form {
        width: 100%;
        margin: 0;
    }
    
    .mobile-search .search-form .input-group {
        width: 100%;
    }
    
    .mobile-search .form-control {
        border-radius: 20px;
        font-size: 0.85rem;
        height: 35px;
    }
    
    .mobile-search .btn {
        display: none; /* Hide search button for cleaner look */
    }
    
    /* Cart icon on right */
    .mobile-cart {
        flex: 0 0 auto;
    }
    
    .mobile-cart .btn-link {
        padding: 5px;
        color: var(--dark);
        font-size: 1.3rem;
        position: relative;
    }
    
    .cart-count-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background-color: var(--danger);
        color: white;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile Navigation Drawer */
    .mobile-nav-drawer {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background-color: var(--white);
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .mobile-nav-drawer.open {
        left: 0;
    }
    
    .mobile-nav-header {
        padding: 15px;
        background-color: var(--primary);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-nav-close {
        background: none;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .mobile-nav-content {
        padding: 15px;
    }
    
    .mobile-nav-categories {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-nav-categories li {
        border-bottom: 1px solid #eee;
    }
    
    .mobile-nav-categories li:last-child {
        border-bottom: none;
    }
    
    .mobile-nav-categories a {
        display: block;
        padding: 12px 0;
        color: var(--dark);
        font-weight: 500;
        transition: color 0.2s;
    }
    
    .mobile-nav-categories a:hover {
        color: var(--primary);
    }
    
    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 1000;
        display: none;
    }
    
    .mobile-nav-overlay.active {
        display: block;
    }
    
    /* ===== ENHANCED MOBILE HERO SECTION - ATTACHED TO SEARCH BAR ===== */
    .hero-section.card {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: none !important;
    }

    /* Remove card body padding that creates gap */
    .hero-section.card .card-body {
        padding: 0 !important;
    }

    /* Remove row margins and padding */
    .hero-section .row {
        margin: 0 !important;
        --bs-gutter-x: 0 !important;
    }

    /* Ensure hero-middle attaches flush */
    .hero-middle {
        margin-top: 0 !important;
        border-top: none !important;
    }
    
    .hero-section {
        flex-direction: column;
        margin-bottom: 20px;
        background: none;
        gap: 0;
        margin-top: 0; /* Remove any top margin */
    }
    
    /* Hide left category section and right banner on mobile */
    .hero-left,
    .hero-right {
        display: none !important;
    }
    
    /* Make hero middle rectangular and full width - ATTACHED BELOW SEARCH BAR */
    .hero-middle {
        flex: 0 0 100% !important;
        min-height: 220px !important; /* Use min-height instead of height */
        height: auto !important;
        border-radius: 8px;
        margin-bottom: 0;
        margin-top: 5px; /* Minimal spacing from search bar */
        order: 3; /* Ensure it comes after mobile header in flow */
    }
    
    .trending-container {
        padding: 12px;
        min-height: 220px;
    }
    
    .dance-animation {
        max-height: 90px;
    }
    
    .hero-middle h3 {
        font-size: 1rem;
        margin-top: 6px;
        margin-bottom: 4px;
    }
    
    .hero-middle p {
        font-size: 0.75rem;
        max-width: 100%;
        margin-bottom: 6px;
    }
    
    .shop-now-btn {
        padding: 4px 12px;
        font-size: 0.75rem;
        bottom: 10px;
        left: 10px;
    }
    
    .hero-slogan {
        font-size: 0.7rem;
        padding: 3px 8px;
        bottom: 10px;
        right: 10px;
        max-width: 55%;
    }
    
    .today-deal {
        top: 8px;
        right: 8px;
        padding: 2px 8px;
        font-size: 0.7rem;
    }
    
    /* ===== ENHANCED MOBILE PRODUCT GRID ===== */
    .product-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px !important; /* Minimal horizontal and vertical spacing */
        margin-bottom: 15px;
    }

    /* Remove all margins and padding that create uneven spacing */
    .product-row .col-12 {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Ensure product cards have no external margins */
    .product-card {
        margin-bottom: 0 !important;
        border-radius: 6px;
        overflow: hidden;
    }

    /* Limit to maximum 6 rows (12 items) per category */
    .category-section .product-row .col-12:nth-child(n+13) {
        display: none !important;
    }

    /* Ensure even vertical spacing between rows */
    .product-row {
        row-gap: 4px !important;
    }

    /* Optimize card content for tight spacing */
    .product-card .card-body {
        padding: 8px !important;
    }

    .product-card .card-title {
        font-size: 0.8rem;
        height: 2.4rem;
        margin-bottom: 0.3rem;
        line-height: 1.2;
    }

    .product-card .product-price {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    /* Compact buttons for minimal spacing */
    .product-card .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
        min-height: auto;
    }

    /* Ensure image containers are compact */
    .product-card .card-img-top {
        height: 100px !important;
        padding: 6px !important;
    }

    /* Remove any extra spacing in button groups */
    .product-card .d-grid {
        gap: 3px !important;
    }
    
    /* ===== MOBILE EXPANDABLE DETAILS OPTIMIZATION ===== */
    
    /* Ensure details element doesn't affect layout */
    .product-details-element {
        width: 100%;
        border: none !important;
        background: none !important;
    }

    /* Full details section - optimized for mobile */
    .product-full-details {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #e9ecef;
        animation: slideDown 0.3s ease-out;
    }

    /* View Details button styling for mobile */
    .view-details-btn {
        width: 100%;
        margin-top: 6px;
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        border: 1px solid #6c757d !important;
        background: white !important;
        color: #6c757d !important;
        transition: all 0.2s ease;
    }

    .view-details-btn:hover {
        background: #f8f9fa !important;
    }

    /* Active state when details are open */
    .product-details-element[open] + .view-details-btn,
    .view-details-btn[aria-expanded="true"] {
        background: #6c757d !important;
        color: white !important;
        border-color: #6c757d !important;
    }

    /* Details content styling */
    .product-full-details p.small {
        font-size: 0.7rem !important;
        line-height: 1.3;
        margin-bottom: 6px;
    }

    .product-full-details hr {
        margin: 6px 0;
        border-color: #e9ecef;
    }

    .product-full-details .d-flex {
        font-size: 0.65rem;
    }

    /* Smooth animation for details expansion */
    @keyframes slideDown {
        from {
            opacity: 0;
            max-height: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            max-height: 200px;
            transform: translateY(0);
        }
    }

    /* Ensure card expands properly when details are open */
    .product-details-element[open] {
        margin-bottom: 8px;
    }

    /* Prevent content jump by setting min-height */
    .product-card .card-body {
        min-height: auto;
        transition: min-height 0.3s ease;
    }
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .section-title::after {
        width: 50px;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .category-card .card-title {
        font-size: 0.9rem;
    }
    
    footer {
        padding: 1.5rem 0 1rem;
    }
    
    footer h5 {
        font-size: 1rem;
    }
    
    /* Hot Sales mobile adjustments */
    .hot-sales {
        margin: 20px 0;
        padding: 15px;
    }
    
    .hot-sales-container {
        height: 280px;
    }
    
    .hot-sales-item {
        width: 220px;
        margin-right: 12px;
    }
    
    body {
        font-size: 0.85rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    .mobile-header {
        padding: 6px 8px;
    }
    
    .mobile-search {
        margin: 0 8px;
    }
    
    .mobile-search .form-control {
        font-size: 0.75rem;
        height: 30px;
    }
    
    .mobile-hamburger .navbar-toggler {
        font-size: 1rem;
        padding: 2px 5px;
    }
    
    .mobile-cart .btn-link {
        font-size: 1.1rem;
    }
    
    .hero-middle {
        min-height: 200px !important;
    }
    
    .dance-animation {
        max-height: 80px;
    }
    
    .hero-middle h3 {
        font-size: 0.9rem;
    }
    
    .hero-middle p {
        font-size: 0.7rem;
    }
    
    .shop-now-btn {
        padding: 3px 10px;
        font-size: 0.7rem;
        bottom: 8px;
        left: 8px;
    }
    
    .hero-slogan {
        font-size: 0.65rem;
        padding: 2px 6px;
        bottom: 8px;
        right: 8px;
        max-width: 60%;
    }
    
    .product-row {
        gap: 3px !important;
    }

    .product-card .card-body {
        padding: 6px !important;
    }

    .product-card .card-title {
        font-size: 0.75rem;
        height: 2.2rem;
    }

    .product-card .card-img-top {
        height: 90px !important;
    }
    
    .view-details-btn {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }

    .product-full-details {
        margin-top: 6px;
        padding-top: 6px;
    }

    .product-full-details p.small {
        font-size: 0.65rem !important;
    }
    
    .section-title {
        font-size: 1.1rem;
        padding-bottom: 0.2rem;
        margin-bottom: 0.6rem;
    }
    
    .section-title::after {
        width: 40px;
    }
    
    .product-card {
        margin-bottom: 0.5rem;
    }
    
    .product-card .card-img-top {
        height: 100px;
    }
    
    .product-card .card-title {
        font-size: 0.8rem;
        height: 2.4rem;
    }
    
    .product-price {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
    
    .product-card .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .category-card .icon-placeholder {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }
    
    .category-card .card-title {
        font-size: 0.85rem;
    }
    
    .category-card .card-text {
        font-size: 0.75rem;
    }
    
    .category-card .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .btn {
        padding: 0.2rem 0.4rem;
    }
    
    footer {
        padding: 1.2rem 0 0.8rem;
    }
    
    footer h5 {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    
    footer ul.list-unstyled li {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .hot-sales-container {
        height: 240px;
    }
    
    .hot-sales-item {
        width: 200px;
    }
    
    .success-card {
        padding: 1.2rem;
        margin: 0.8rem;
    }
    
    .success-icon {
        font-size: 2.5rem;
    }
    
    .success-card h3 {
        font-size: 1.2rem;
    }
    
    .success-card p {
        font-size: 0.9rem;
    }
    
    .mobile-top-bar {
        font-size: 0.7rem;
        padding: 5px 0;
    }
    
    .mobile-top-bar .container {
        gap: 8px;
    }
}

/* Print adjustments */
@media print {
    .navbar, .top-bar, .footer, .breadcrumb,
    .mobile-top-bar, .mobile-header {
        display: none !important;
    }
    
    body {
        padding: 0;
        background: white;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    main {
        padding-top: 0 !important;
    }
}