/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --luxury-gold: #c5a059;
    --luxury-black: #1a1a1a;
    --luxury-white: #ffffff;
    --luxury-bg: #fcfcfc;
    --luxury-gray: #f4f4f4;
    --luxury-text-muted: #888;
    --luxury-accent: #ff6b6b;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--luxury-bg);
    color: var(--luxury-black);
    line-height: 1.6;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    padding: 8px 16px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    /* Performance fix: avoiding heavy blur on mobile */
}

@media (min-width: 768px) {
    .header {
        backdrop-filter: blur(10px);
    }
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #f1f2f6;
    border-radius: 12px;
    padding: 0 12px;
    gap: 8px;
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1001;
}

.search-bar:focus-within {
    background: #ffffff;
    border-color: rgba(255, 107, 107, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    transition: color 0.3s ease;
}

.search-bar:focus-within .search-icon {
    color: #ff6b6b;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    color: #2d3436;
    height: 32px;
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
}

.search-input::placeholder {
    color: #b2bec3;
    font-weight: 400;
}

.clear-search {
    background: none;
    border: none;
    color: #b2bec3;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.clear-search:hover {
    color: #ff6b6b;
}

/* World-Class Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    border: 1px solid rgba(0,0,0,0.05);
    animation: slideInDown 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #fdf2f2;
}

.search-result-img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 2px;
}

.search-result-price {
    font-size: 12px;
    color: #ff6b6b;
    font-weight: 700;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
}

/* Main Content */
.main-content {
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Luxury Brand Identity Style */
.luxury-brand-identity {
    padding: 12px 16px;
    text-align: center;
    background: transparent;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

.brand-text {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff0f7b 0%, #f89b29 50%, #ff0f7b 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    animation: luxuryGlow 4s linear infinite, brandEntrance 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
    will-change: transform, opacity, background-position;
}

/* Red-focused Luxury Gradient variant as requested */
.brand-text {
    background: linear-gradient(to right, #e52d27 0%, #b31217 50%, #e52d27 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes luxuryGlow {
    to {
        background-position: 200% center;
    }
}

@keyframes brandEntrance {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 767px) {
    .luxury-brand-identity {
        padding: 8px 12px;
        margin-top: 4px;
        margin-bottom: -4px;
    }
    .brand-text {
        font-size: 16px;
        letter-spacing: 2.5px;
    }
}

/* Banner Slider */
.banner-slider {
    position: relative;
    margin: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.slider-container {
    position: relative;
    height: 140px;
}

@media (max-width: 767px) {
    .banner-slider {
        margin: 12px;
        border-radius: 10px;
    }

    .slider-container {
        height: 110px;
    }

    .slider-dots {
        bottom: 8px;
        gap: 6px;
    }

    .dot {
        width: 6px;
        height: 6px;
    }
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: white;
}

/* Section Headers */
section {
    margin: 16px 16px;
}

@media (max-width: 767px) {
    section {
        margin: 8px 16px;
    }

    .categories {
        margin: 4px 16px 8px 16px;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Countdown Timer */
.countdown-timer {
    display: flex;
    gap: 4px;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 250, 250, 0.85) 100%);
    padding: 8px 12px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 107, 107, 0.18);
    backdrop-filter: blur(10px);
}

.timer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 107, 107, 0.05) 100%);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.15);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    min-width: 40px;
}

.timer-value {
    font-size: 16px;
    font-weight: 700;
    color: #ff6b6b;
    line-height: 1.2;
}

.timer-label {
    font-size: 11px;
    color: #ff6b6b;
    opacity: 0.8;
    font-weight: 600;
}

.timer-separator {
    font-size: 14px;
    font-weight: 700;
    color: #ff6b6b;
    opacity: 0.5;
    margin: 0 2px;
}

.countdown {
    display: flex;
    gap: 8px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ff6b6b;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 50px;
}

.time {
    font-size: 18px;
    font-weight: 600;
}

.label {
    font-size: 12px;
    opacity: 0.9;
}

@media (max-width: 767px) {
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin: 0;
    }

    .product-card {
        border-radius: 12px;
        width: 100%;
    }

    .product-image {
        height: 120px;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h3 {
        font-size: 12px;
    }

    .current-price {
        font-size: 13px;
    }

    .add-to-cart-btn {
        padding: 5px 10px;
        font-size: 10px;
    }
}

/* Flash Products Horizontal Scroll Optimization */
.flash-products {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    will-change: transform; /* Hint to GPU for smoother scrolling */
}

.flash-products::-webkit-scrollbar {
    display: none;
}

.flash-products .product-card {
    min-width: 120px;
    flex: 0 0 120px;
    scroll-snap-align: start;
}

@media (max-width: 767px) {
    .flash-sale {
        padding: 4px 8px 4px !important;
        border-radius: 18px !important;
    }

    .flash-sale .section-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        gap: 4px !important;
        margin-bottom: 3px !important;
    }

    .flash-sale .section-header h2 {
        font-size: 15px !important;
        margin-bottom: 0 !important;
    }

    .flash-sale .section-header .countdown-timer {
        gap: 1px !important;
        padding: 2px 3px !important;
        border-radius: 10px !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
        border: 0.8px solid rgba(255, 255, 255, 0.15) !important;
        order: -1 !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
        backdrop-filter: blur(12px) !important;
    }

    .flash-sale .timer-item {
        padding: 2px 3px !important;
        min-width: 28px !important;
        background: linear-gradient(135deg, rgba(255, 107, 107, 0.12) 0%, rgba(255, 107, 107, 0.05) 100%) !important;
        border-radius: 6px !important;
        border: 0.5px solid rgba(255, 107, 107, 0.12) !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    }

    .flash-sale .timer-value {
        font-size: 11px !important;
        color: rgba(255, 255, 255, 0.95) !important;
    }

    .flash-sale .timer-label {
        font-size: 8px !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }

    .flash-sale .timer-separator {
        font-size: 12px !important;
        color: rgba(255, 255, 255, 0.6) !important;
        margin: 0 1px !important;
    }

    .flash-products {
        gap: 6px !important;
        padding-bottom: 3px !important;
        margin: 0 !important;
    }

    .flash-sale .product-card {
        min-width: 84px !important;
        flex: 0 0 84px !important;
        border-radius: 12px !important;
    }

    .flash-sale .product-image {
        height: 66px !important;
    }

    .flash-sale .product-info {
        padding: 3px !important;
    }

    .flash-sale .product-info h3 {
        font-size: 10px !important;
        margin-bottom: 2px !important;
        line-height: 1.15 !important;
    }

    .flash-sale .price {
        gap: 3px !important;
        margin-bottom: 3px !important;
    }

    .flash-sale .current-price {
        font-size: 10px !important;
    }

    .flash-sale .price {
        gap: 2px !important;
        margin-bottom: 0 !important;
        flex-direction: column;
        align-items: flex-start;
    }

    .flash-sale .add-to-cart-btn {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        border-radius: 6px !important;
    }

    .flash-sale .add-to-cart-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .flash-sale .discount-badge,
    .flash-sale .wishlist-btn {
        width: 20px !important;
        height: 20px !important;
    }

    .flash-sale .discount-badge {
        font-size: 8px !important;
        padding: 2px 3px !important;
        top: 4px !important;
        left: 4px !important;
    }

    .flash-sale .wishlist-btn {
        top: 4px !important;
        right: 4px !important;
    }
}

/* Optimized Product Cards */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    will-change: transform;
    backface-visibility: hidden; /* Fixes flickering during scroll */
}

.product-image {
    position: relative;
    aspect-ratio: 1 / 1; /* Fixed ratio prevents layout shifts */
    height: auto;
    overflow: hidden;
    background: var(--luxury-gray);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.wishlist-btn:hover {
    background: var(--luxury-gold);
    color: white;
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--luxury-black);
    color: var(--luxury-white);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.product-info {
    padding: 6px 10px 8px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.product-info h3 {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--luxury-black);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 0;
}

.price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.current-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--luxury-gold);
}

.original-price {
    font-size: 12px;
    color: var(--luxury-text-muted);
    text-decoration: line-through;
}

/* Ultra-Compact 3D Red Luxury Button */
.add-to-cart-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff3838 0%, #d60000 100%);
    color: white;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2.5px 0px #910000, 0 4px 10px rgba(214, 0, 0, 0.25);
    padding: 0;
    position: relative;
    top: 0;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff0000 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 0px #910000, 0 6px 15px rgba(214, 0, 0, 0.35);
}

.add-to-cart-btn:active {
    top: 1.5px;
    box-shadow: 0 0.5px 0px #910000, 0 1px 3px rgba(0,0,0,0.15);
    transform: translateY(0);
}

.add-to-cart-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 3.5;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}

/* Products Section Heading - Luxury Professional Style */
.section-header-luxury {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.products h2 {
    text-align: left;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--luxury-black);
    position: relative;
    padding-left: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
}

.products h2::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 14px;
    background: linear-gradient(to bottom, var(--luxury-gold), #e5c17b);
    border-radius: 4px;
}

/* Luxury Free Delivery Badge - Global Standard V2 */
.free-delivery-badge {
    display: flex;
    align-items: center;
    background: #0a0a0a;
    padding: 6px 14px;
    border-radius: 30px;
    border: 1.5px solid rgba(197, 160, 89, 0.5);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 10px rgba(197, 160, 89, 0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Fast Luxury Shimmer - Global Standard */
.free-delivery-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 80%;
    height: 200%;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 70%,
        transparent 100%
    );
    transform: rotate(25deg);
    animation: fastShimmer 2.5s infinite ease-in-out;
    will-change: transform;
    z-index: 1;
}

@keyframes fastShimmer {
    0% { left: -120%; }
    40% { left: 120%; }
    100% { left: 120%; }
}

.free-delivery-badge span {
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    margin-left: 8px;
    z-index: 2;
    text-shadow: 0 0 8px rgba(197, 160, 89, 0.6);
}

.delivery-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--luxury-gold);
    z-index: 2;
    filter: drop-shadow(0 0 4px var(--luxury-gold));
}

.delivery-icon svg {
    animation: luxuryVibe 2s ease-in-out infinite;
    will-change: transform;
}

@keyframes luxuryVibe {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.15); filter: brightness(1.4); }
}

.free-delivery-badge:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--luxury-gold);
    box-shadow: 0 12px 30px rgba(197, 160, 89, 0.4);
}

@media (max-width: 480px) {
    .free-delivery-badge {
        padding: 5px 12px;
        border-width: 1.2px;
    }

    .free-delivery-badge span {
        font-size: 7.5px;
        letter-spacing: 0.8px;
    }
}

@media (max-width: 480px) {
    .free-delivery-badge {
        padding: 4px 10px;
    }

    .free-delivery-badge span {
        font-size: 7px;
        letter-spacing: 0.5px;
    }

    .delivery-icon svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .section-header-luxury {
        flex-direction: row;
        justify-content: space-between;
    }

    .free-delivery-badge {
        padding: 3px 8px;
    }

    .free-delivery-badge span {
        font-size: 7.5px;
        letter-spacing: 0.3px;
    }
}

/* Categories Section - Luxury Edition */
.categories {
    margin-top: 8px;
    margin-bottom: 16px;
}

.categories h2 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.categories-grid {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0;
}

.categories-grid::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 2px;
    min-width: 55px;
    flex: 0 0 55px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.category-item:hover {
    transform: translateY(-3px);
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.category-item:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-item span {
    font-size: 11px;
    font-weight: 600;
    color: #444;
    text-align: center;
}

/* Luxury Vibrant Gradients */
.bg-grocery { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.bg-electronics { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.bg-fashion { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.bg-home { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.bg-tools { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.bg-beauty { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

@media (max-width: 767px) {
    .categories {
        margin-top: 2px;
        margin-bottom: 6px;
    }

    .categories h2 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .categories-grid {
        display: flex;
        gap: 0;
        overflow-x: auto;
        padding: 2px 0;
        margin: 0 -16px;
        padding-left: 12px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .category-item {
        min-width: 52px;
        flex: 0 0 52px;
        padding: 2px 0;
        border-radius: 8px;
        scroll-snap-align: start;
    }

    .category-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        margin-bottom: 2px;
    }

    .category-icon svg {
        width: 16px;
        height: 16px;
    }

    .category-item span {
        font-size: 8.5px;
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item.active {
    color: #ff6b6b;
}

.nav-item svg {
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

/* Responsive Design */
@media (min-width: 768px) {
    .header {
        padding: 16px 24px;
    }

    .search-bar {
        max-width: 600px;
        margin: 0 auto;
    }

    .banner-slider {
        margin: 24px;
        height: 240px;
    }

    .slider-container {
        height: 240px;
    }

    section {
        margin: 32px 24px;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .flash-products {
        grid-template-columns: repeat(4, 1fr);
        overflow-x: visible;
        grid-auto-flow: row;
    }

    .flash-products .product-card {
        min-width: auto;
    }

    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }

    .category-item {
        padding: 24px 16px;
    }

    .product-image {
        height: 200px;
    }

    .bottom-nav {
        display: none; /* Hide on desktop */
    }
}

/* Flash Sale Animations */
.flash-sale .section-header {
    animation: fadeInUp 0.8s ease-out;
}

.flash-sale .product-card:nth-child(1) {
    animation: slideInLeft 0.6s ease-out;
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.flash-sale .product-card:nth-child(2) {
    animation: slideInRight 0.6s ease-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.countdown {
    animation: gentlePulse 3s ease-in-out infinite;
}

/* Keyframes for Flash Sale */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Modernized Flash Sale - Performance Oriented */
.flash-sale {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    border-radius: 20px;
    overflow: hidden;
    padding: 20px 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    contain: content; /* Significant performance boost */
}

.flash-sale .section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.flash-sale .section-header h2 {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: #ffffff;
}

.flash-sale .section-header .countdown {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.flash-sale .time-block {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 16px;
    min-width: 60px;
}

.flash-sale .time {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.flash-sale .label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
}

.flash-sale .product-card {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.flash-sale .product-info {
    padding: 14px;
}

.flash-sale .product-info h3 {
    color: #fff;
}

.flash-sale .current-price,
.flash-sale .original-price,
.flash-sale .add-to-cart-btn {
    color: #fff;
}

.flash-sale .current-price {
    font-size: 16px;
}

.flash-sale .original-price {
    color: rgba(255, 255, 255, 0.65);
}

.flash-sale .add-to-cart-btn {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.flash-sale .add-to-cart-btn:hover {
    background: rgba(255, 255, 255, 0.26);
}

.flash-sale .discount-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.flash-sale::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.14), transparent 18%),
                linear-gradient(45deg, rgba(255, 190, 103, 0.05), rgba(255, 255, 255, 0.04));
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.25;
    }
    50% {
        opacity: 0.55;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .flash-products {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Professional Profile Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.profile-popup {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    padding: 30px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .profile-popup {
    transform: translateY(0);
}

.profile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
}

.profile-close:hover {
    background: #e9ecef;
    color: #000;
    transform: rotate(90deg);
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
}

.profile-avatar-container {
    position: relative;
    margin-bottom: 12px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.2);
}

.online-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    background: #4cd137;
    border: 2px solid #fff;
    border-radius: 50%;
}

.profile-meta h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.profile-meta p {
    font-size: 13px;
    color: var(--luxury-gold);
    font-weight: 600;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 25px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #333;
    background: #fcfcfc;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: #fff;
    border-color: rgba(197, 160, 89, 0.2);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.menu-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
}

.bg-luxury-gold {
    background: linear-gradient(135deg, #c5a059 0%, #d4af37 100%);
}

.menu-item span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.menu-item .arrow {
    opacity: 0.3;
}

.logout-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: #fff5f5;
    color: #ff4757;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ff4757;
    color: white;
}

/* Mobile Specific Optimizations for Popup */
@media (max-width: 480px) {
    .profile-popup {
        padding: 24px 20px;
        margin: 10px; /* Ensures sides are empty */
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
    }
}

/* Auth Forms styling */
.auth-view {
    animation: fadeIn 0.3s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--luxury-text-muted);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--luxury-gold);
    outline: none;
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.1);
}

.auth-submit-btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-submit-btn:hover {
    background: var(--luxury-gold);
    transform: translateY(-2px);
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    margin-top: 15px;
    color: var(--luxury-text-muted);
}

.auth-switch a {
    color: var(--luxury-gold);
    text-decoration: none;
    font-weight: 600;
}

/* Google & Social Auth Buttons */
.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 15px 0;
    color: #b2bec3;
    font-size: 12px;
    font-weight: 600;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}

.auth-separator span {
    padding: 0 10px;
}

.google-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-auth-btn img {
    width: 20px;
    height: 20px;
}

.google-auth-btn:hover {
    background: #f8f9fa;
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.google-auth-btn:active {
    transform: translateY(0);
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

/* Success/Error Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.toast.active {
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }

/* Existing Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* World-Class Luxury Cart Drawer System */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3000;
    display: none;
    justify-content: flex-end;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-overlay.active {
    display: flex;
    opacity: 1;
}

.cart-container {
    background: #ffffff;
    width: 100%;
    max-width: 450px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.3);
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-overlay.active .cart-container {
    transform: translateX(0);
}

/* Luxury Red Gradient Header */
.cart-header {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%); /* Modern Vibrant Red-Orange Gradient */
    color: white;
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.2);
}

/* Fast Red Gradient variant for professional look */
.cart-header {
    background: linear-gradient(to right, #e52d27, #b31217); /* Classic Luxury Deep Red */
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.cart-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-title svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.cart-title span {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
}

.cart-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    backdrop-filter: blur(5px);
}

.cart-close:hover {
    background: white;
    color: #e52d27;
    transform: rotate(90deg) scale(1.1);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    scrollbar-width: thin;
    scrollbar-color: #e52d27 #f0f0f0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Butter smooth scrolling on iOS */
}

.cart-items::-webkit-scrollbar {
    width: 5px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #e52d27;
    border-radius: 10px;
}

/* Modern Item Card */
.cart-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    border: 1px solid #f8f8f8;
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease backwards;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
}

.cart-item-img {
    width: 100px;
    height: 100px;
    border-radius: 15px;
    object-fit: cover;
    background: #fdfdfd;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-info h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #222;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 800;
    color: #e52d27;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* Premium Qty Control */
.qty-control {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 4px;
    border: 1px solid #eee;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    color: #333;
    font-weight: bold;
}

.qty-btn:hover {
    background: #e52d27;
    color: white;
}

.qty-val {
    width: 40px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #000;
}

.remove-item {
    background: #fff5f5;
    border: none;
    color: #ff4757;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-item:hover {
    background: #ff4757;
    color: white;
    transform: scale(1.1);
}

/* Footer Section */
.cart-footer {
    padding: 30px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -15px 35px rgba(0, 0, 0, 0.05);
}

.cart-summary {
    margin-bottom: 25px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    color: #555;
    font-weight: 500;
}

.summary-line.total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 24px;
    font-weight: 800;
    color: #000;
}

.total-amount {
    color: #e52d27;
}

/* World-Class Checkout Button */
.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #e52d27 0%, #b31217 100%);
    color: #fff;
    border: none;
    padding: 22px;
    border-radius: 18px;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(229, 45, 39, 0.35);
    text-transform: uppercase;
}

.checkout-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(229, 45, 39, 0.45);
    filter: brightness(1.1);
}

.checkout-btn:active {
    transform: translateY(-2px);
}

/* Luxury Empty State */
.empty-cart-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: #333;
}

.empty-cart-icon {
    font-size: 90px;
    margin-bottom: 25px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.empty-cart-msg h3 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 12px;
    font-family: 'Cinzel', serif;
}

.empty-cart-msg p {
    color: #777;
    font-size: 16px;
    margin-bottom: 35px;
    max-width: 280px;
    line-height: 1.5;
}

.continue-shopping {
    background: #222;
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.continue-shopping:hover {
    background: #e52d27;
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(229, 45, 39, 0.2);
}

/* Fast Performance Optimizations */
.cart-container {
    will-change: transform;
    backface-visibility: hidden;
}

.cart-item {
    will-change: transform, opacity;
}

/* Mobile Specific Optimizations */
@media (max-width: 480px) {
    .cart-container {
        max-width: 100%;
    }

    .cart-header {
        padding: 20px;
    }

    .cart-title span {
        font-size: 18px;
    }

    .cart-items {
        padding: 15px;
    }

    .cart-item {
        gap: 15px;
        padding: 12px;
        border-radius: 15px;
    }

    .cart-item-img {
        width: 80px;
        height: 80px;
    }

    .cart-item-info h4 {
        font-size: 14px;
    }

    .cart-item-price {
        font-size: 16px;
    }

    .checkout-btn {
        padding: 18px;
        font-size: 16px;
    }
}

/* Loading States */
.product-image img {
    transition: opacity 0.3s ease;
}

.product-image img[loading] {
    opacity: 0;
}

.product-image img[loaded] {
    opacity: 1;
}