* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #fff;
    color: #1a1a1a;
    min-height: 100vh;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    z-index: 100;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5e5e5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a1a1a;
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #f5f5f5;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cart-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: #1a1a1a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
    display: none;
}

/* Filters */
.filters-wrapper {
    position: sticky;
    top: 73px;
    background: #fff;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    z-index: 90;
}

.filters {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid #e5e5e5;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #f5f5f5;
}

.filter-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* Main Content */
.main-content {
    padding: 20px;
    min-height: calc(100vh - 150px);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8f8f8;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: #1a1a1a;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.product-badge.best-seller {
    background: #2563eb;
}

.product-badge.new {
    background: #16a34a;
}

.product-badge.showroom-only {
    background: #1a1a1a;
}

.product-badge.festive {
    background: #ea580c;
}

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.product-price .unit {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.product-name {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* Product Actions */
.product-action {
    margin-top: auto;
    padding: 0 16px 16px;
}

.add-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.add-btn.primary {
    background: #1a1a1a;
    color: #fff;
}

.add-btn.primary:hover {
    background: #333;
}

.add-btn.primary:active {
    transform: scale(0.98);
}

.add-btn.outline {
    background: #fff;
    color: #1a1a1a;
    border: 1.5px solid #1a1a1a;
}

.add-btn.outline:hover {
    background: #f5f5f5;
}

.add-btn.disabled {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e5e5e5;
    cursor: not-allowed;
}

.add-btn.disabled:hover {
    background: #f5f5f5;
}

.add-btn .plus-icon {
    font-size: 16px;
    font-weight: 400;
}

.add-btn .phone-icon {
    width: 16px;
    height: 16px;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 4px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.qty-display {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    min-width: 40px;
    text-align: center;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.empty-state p {
    margin-top: 16px;
    font-size: 16px;
}

/* Premium Toast Notification & Sparkle Burst Effects */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px) scale(0.8);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 14.5px;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease, visibility 0.4s;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 
                0 0 20px rgba(30, 64, 175, 0.35),
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    animation: toast-glow 2s infinite alternate;
}

@keyframes toast-glow {
    0% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 15px rgba(30, 64, 175, 0.2); }
    100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 25px rgba(30, 64, 175, 0.5); }
}

.sparkle-particle {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    border-radius: 50%;
    animation: sparkle-fly 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes sparkle-fly {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot));
        opacity: 0;
    }
}

/* Responsive */
@media (min-width: 480px) {
    .products-grid {
        gap: 20px;
    }

    .product-info {
        padding: 20px;
    }

    .product-action {
        padding: 0 20px 20px;
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .main-content {
        padding: 24px 32px;
    }

    .filters {
        padding: 0 32px;
    }

    .header {
        padding: 16px 32px;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .main-content {
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* --- Search Bar Styles (Blinkit Style) --- */
.header-search-wrapper {
    flex: 1;
    margin: 0 16px;
    max-width: 600px;
    position: relative;
    display: flex;
    align-items: center;
}

.header-search-wrapper input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    background: #f8fafc;
    transition: all 0.2s ease;
    color: #1e293b;
}

.header-search-wrapper input:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.header-search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.header-search-wrapper .clear-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.header-search-wrapper .clear-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}

/* --- Search Overlay Styles --- */
.search-overlay {
    position: fixed;
    top: 73px;
    left: 0;
    width: 100%;
    height: calc(100vh - 73px);
    background: #fff;
    z-index: 105;
    overflow-y: auto;
    padding: 24px 20px;
}

.search-section {
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.search-section-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.75px;
}

.clear-all-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: #dc2626;
    cursor: pointer;
    transition: opacity 0.15s;
}

.clear-all-btn:hover {
    opacity: 0.8;
}

.recent-searches-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recent-search-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.recent-search-tag:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.popular-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 576px) {
    .popular-categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

.popular-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    transition: all 0.2s ease;
    border: 1.5px solid #f1f5f9;
}

.popular-cat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.05);
    border-color: #cbd5e1;
    background: #fff;
}

.popular-cat-img-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popular-cat-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-cat-card span {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}