/* --- Performance Optimized Consolidated Styles --- */

:root {
    --blinkit-green: #1a602c; /* Premium Blue */
    --blinkit-bg: #f8f8f8;
    --blinkit-text: #1f1f1f;
    --blinkit-muted: #666;
    --header-height: 80px;
}

@media (max-width: 991.98px) {
    :root {
      --header-height: 200px;
    }
}

body {
    background-color: #fff;
    color: var(--blinkit-text);
    font-family: 'Inter', sans-serif;
    padding-top: var(--header-height);
    margin: 0;
}

/* --- Layout Navbar --- */
.layout-navbar, 
.layout-navbar .container-fluid, 
.layout-navbar .navbar,
.layout-navbar .navbar-nav,
.layout-navbar .nav-item {
    overflow: visible !important;
}

body {
    overflow-x: hidden;
}

.layout-navbar {
    background-color: #fff !important;
    border-bottom: 1px solid #f1f1f1;
    z-index: 1080 !important;
    padding: 0 40px !important;
    display: flex !important;
    align-items: center !important;
}

@media (min-width: 992px) {
    .layout-navbar {
        height: 80px !important;
        min-height: 80px !important;
        max-height: 80px !important;
    }
    .layout-navbar .navbar,
    .layout-navbar .container-fluid {
        height: 80px !important;
        max-height: 80px !important;
    }
}

.layout-navbar .navbar,
.layout-navbar .container-fluid {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

.layout-navbar .navbar-nav {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.layout-navbar .nav-item {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    position: relative !important;
}

.dropdown-menu {
    border: 1px solid #f1f1f1 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    z-index: 1100 !important;
    transform-origin: top center !important;
    padding: 0 !important;
}

.dropdown-header {
    color: #1f1f1f !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 15px 16px !important;
    background: #fff !important;
    border-bottom: 1px solid #f1f1f1 !important;
    display: block !important;
}

.dropdown-menu[data-bs-popper] {
    position: absolute !important;
    top: 100% !important;
    margin-top: 10px !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    z-index: 2000 !important;
}

.layout-navbar .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    z-index: 2000 !important;
}

/* Center specifically on mobile for better UX */
@media (max-width: 991.98px) {
    .mobile-actions .dropdown-menu {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        position: fixed !important;
        top: 80px !important;
        width: 90vw !important;
    }
}

@media (max-width: 991.98px) {
    .mobile-actions .dropdown-menu {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 90vw !important;
        max-width: 320px !important;
        position: fixed !important;
        top: 80px !important;
    }
}

@media (max-width: 991.98px) {
    .layout-navbar {
        height: auto !important;
        padding: 10px 15px !important;
    }
    .layout-navbar .navbar {
        height: auto !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 10px 15px !important;
    }
    .navbar-top-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    .search-full-width {
        width: 100% !important;
        margin-bottom: 5px !important;
    }
    .app-brand {
        margin: 0 !important;
        justify-content: flex-start !important;
    }
    .mobile-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important; /* Reduced from 12px for better fit */
    }
    
    .app-brand {
        margin: 0 !important;
        justify-content: flex-start !important;
        min-width: 0 !important; /* Allow brand to shrink */
        flex-shrink: 1 !important;
    }

    .app-brand-logo img {
        height: 40px !important; /* Scale down logo on mobile */
    }

    /* Hide desktop-only nav on mobile */
    .navbar-nav:not(.mobile-actions) {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .mobile-actions {
        gap: 6px !important;
    }
    .app-brand-text {
        font-size: 15px !important;
    }
    .mobile-cart-btn {
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 6px !important;
    }
}

@media (max-width: 400px) {
    .app-brand-text {
        display: none !important; /* Hide text to prioritize icons */
    }
    .mobile-actions {
        gap: 4px !important;
    }
    .mobile-cart-btn {
        min-width: 38px !important;
        min-height: 38px !important;
    }
}

.mobile-cart-btn {
    min-width: 44px;
    min-height: 44px;
}

.search-container {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 46px;
    transition: all 0.2s ease;
}

.search-container:focus-within {
    background: #fff;
    border-color: var(--blinkit-green);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    height: 100%;
    font-size: 14px;
    font-weight: 500;
}

/* --- Product Discount Badge --- */
.discount-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #256fef;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    padding: 6px 4px 10px 4px;
    min-width: 38px;
    z-index: 10;
    text-align: center;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.1px;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 80% 92%, 60% 100%, 40% 92%, 20% 100%, 0% 92%);
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

/* --- Category Grid --- */
.category-item {
    text-align: center;
    transition: transform 0.2s ease;
    padding: 5px;
    cursor: pointer;
}
.category-item:hover {
    transform: translateY(-3px);
}
.category-box {
    background: #f3f9fb;
    border-radius: 16px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    padding: 8px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
}
.category-box img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
}
.category-label {
    color: #333;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    display: block;
    height: 32px;
    overflow: hidden;
}

/* --- Standardized Product Card --- */
.product-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    height: 310px; /* Reduced for compact design */
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border-color: rgba(12, 131, 31, 0.15);
    transform: translateY(-4px);
}

.product-img-wrapper {
    height: 150px; /* Reduced from 160px */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    position: relative;
    background: #fff;
    margin-bottom: 8px;
    overflow: hidden;
}

.product-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-name {
    font-size: 14px; /* Slightly smaller */
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    height: 32px;
}

.product-qty {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.variant-info {
    height: 14px;
    font-size: 11px;
    color: var(--blinkit-green);
    margin-bottom: 4px;
}

.discount-text {
    font-size: 11px;
    margin-bottom: 4px;
}

.product-price {
    font-weight: 750;
    color: #1a1a1a;
    font-size: 16px;
    letter-spacing: -0.2px;
}

/* --- Buttons & Selectors --- */
.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 3px;
}

.add-btn {
    border: 1px solid var(--blinkit-green);
    background: #fff;
    color: var(--blinkit-green);
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    transition: all 0.2s;
    min-width: 75px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    background: var(--blinkit-green);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 111, 239, 0.15);
}

.add-btn.has-options {
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: auto;
    min-height: 42px;
    min-width: 85px;
}

.add-btn.has-options .add-text {
    padding: 4px 0 2px 0;
    font-weight: 800;
}

.add-btn.has-options .options-text {
    font-size: 10px;
    background: #f0fdf4; /* Light green background */
    color: var(--blinkit-green);
    width: 100%;
    padding: 3px 0;
    text-transform: lowercase;
    font-weight: 700;
    border-top: 1px solid rgba(12, 131, 31, 0.1);
}

.add-btn.has-options:hover .options-text {
    background: transparent;
    color: #fff;
}

.qty-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--blinkit-green);
    color: #fff;
    border-radius: 8px;
    padding: 3px 4px;
    min-width: 85px;
    box-shadow: 0 4px 10px rgba(12, 131, 31, 0.2);
}

.qty-count {
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    flex-grow: 1;
    text-align: center;
}

.qty-nav-btn {
    background: #eeeeee;
    border: none;
    color: #0c831f;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.qty-nav-btn:hover {
    background: #ffffff;
}

/* --- Swiper Navigation --- */
.product-swiper {
    padding: 0 !important;
    margin-bottom: 10 !important;
    position: relative;
    overflow: visible !important;
    height: 310px !important; /* Match card height (300px) + small padding */
    display: flex;
    align-items: center;
}

.product-swiper-button-next, .product-swiper-button-prev {
    background: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: #333;
    z-index: 15;
    top: 50% !important; /* Proper middle */
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.product-swiper-button-next:hover, .product-swiper-button-prev:hover {
    background: var(--blinkit-green);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.product-swiper-button-next::after, .product-swiper-button-prev::after {
    font-size: 14px !important; /* Smaller arrows */
    font-weight: 900;
}

.product-swiper-button-next { right: -15px !important; }
.product-swiper-button-prev { left: -15px !important; }

/* --- Section Spacing --- */
.section-spacing, .product-row-container {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.section-title {
    margin-top: 15px !important; /* Small space before next row title */
}

/* --- Search Results Dropdown --- */
.search-result-item-wrapper {
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.2s;
}

.search-result-item-wrapper:hover,
.search-result-item-wrapper.selected {
    background: #f0fdf4;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
}

.search-result-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 3px;
    margin-right: 12px;
    background: #fff;
}

.view-all-link {
    display: block;
    padding: 12px;
    text-align: center;
    background: #f8f9fa;
    color: var(--blinkit-green);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    border-top: 1px solid #eee;
}

/* --- Section Headers --- */
.section-header-modern, .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    padding-top: 0 !important;
}

.section-header-modern h2, .section-title h2 {
    font-weight: 800;
    font-size: 1.25rem;
    margin: 0 !important;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.see-all {
    color: var(--blinkit-green);
    font-weight: 700;
    text-decoration: none !important;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Footer Custom Styling --- */
.landing-footer {
    background-color: #f8f9fa !important;
    color: #000 !important;
    border-top: 1px solid #ddd;
    padding: 40px 0;
}

/* --- Manual Quantity Input --- */
.manual-qty-input-global {
    background: transparent !important;
    border: none !important;
    text-align: center !important;
    font-weight: 800 !important;
    color: #fff !important;
    outline: none !important;
    width: 55px !important;
}

.apply-manual-qty-btn-global {
    background: transparent !important;
    color: #fff !important;
    border: 1.5px solid #fff !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.apply-manual-qty-btn-global:hover {
    background: #fff !important;
    color: var(--blinkit-green) !important;
}
/* --- Premium Dropdown Styles --- */
.layout-navbar .dropdown-menu {
    border: none !important;
    border-radius: 12px !important;
    padding: 8px !important;
    min-width: 220px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.layout-navbar .dropdown-item {
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    margin-bottom: 4px !important;
}

.layout-navbar .dropdown-item i {
    font-size: 20px !important;
    margin-right: 12px !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f1f8f3;
    color: var(--blinkit-green);
}

.dropdown-item.text-danger:hover {
    background-color: #fff5f5;
    color: #dc3545;
}

.dropdown-divider {
    margin: 8px 0;
    opacity: 0.08;
}
