/* =======================================================
   ChopnFresh - Premium Grocery eCommerce CSS
   Color Palette: Emerald Green (#0c831f), Fresh Mint (#e8f5e9), Dark Charcoal (#1e293b)
======================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-green: #0c831f;
    --primary-dark: #075b14;
    --accent-light: #e8f5e9;
    --mint-badge: #d1e7dd;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f4f6f8;
    --card-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 8px 24px rgba(12, 131, 31, 0.12);
    --border-radius: 14px;
    --transition-fast: all 0.25s ease-in-out;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-bottom: 70px; /* Space for mobile sticky nav */
    cursor: pointer;
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

/* =======================================================
   HEADER & NAVBAR
======================================================= */
.top-delivery-bar {
    background-color: #075b14;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 0;
}

.main-navbar {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.brand-logo {
    font-weight: 700;
    font-size: 1.65rem;
    color: var(--primary-green) !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-logo span {
    color: #ff9800;
}

.delivery-badge-pill {
    background: var(--accent-light);
    color: var(--primary-green);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-input-group {
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: var(--transition-fast);
    background: #f8fafc;
}

.search-input-group:focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(12, 131, 31, 0.15);
    background: #ffffff;
}

.search-input-group .form-control {
    border: none;
    box-shadow: none;
    background: transparent;
    font-size: 0.95rem;
}

.cart-nav-btn {
    background-color: var(--primary-green);
    color: #ffffff !important;
    border-radius: 12px;
    padding: 8px 18px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
    border: none;
}

.cart-nav-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Search Autocomplete Popup */
#search-results-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 380px;
    overflow-y: auto;
    display: none;
}

.search-item-row {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.search-item-row:hover {
    background-color: var(--accent-light);
}

.search-item-row img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
}

/* =======================================================
   HERO BANNER & CAROUSEL
======================================================= */
.hero-slider-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    background: linear-gradient(135deg, #0c831f 0%, #10b981 100%);
    color: white;
    padding: 2.5rem;
    position: relative;
    box-shadow: var(--card-shadow);
}

.hero-slider-card h1 {
    font-weight: 700;
    font-size: 2.2rem;
}

/* Category Pills */
.cat-pill-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 16px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition-fast);
    border: 1px solid #f1f5f9;
    display: block;
}

.cat-pill-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-green);
}

.cat-pill-item img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    margin-bottom: 8px;
}

.cat-pill-item span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
}

/* =======================================================
   PRODUCT CARD (BLINKIT/ZEPTO STYLE)
======================================================= */
.product-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    border: 1px solid #f1f5f9;
    box-shadow: var(--card-shadow);
    transition: var(--transition-fast);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: #d1e7dd;
}

.product-img-wrapper {
    position: relative;
    background: #f8fafc;
    padding: 16px;
    text-align: center;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img-wrapper img {
    max-height: 130px;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.06);
}

.badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ef4444;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;

}

.btn-wishlist-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-wishlist-icon:hover, .btn-wishlist-icon.active {
    color: #ef4444;
    border-color: #fca5a5;
    background-color: #fef2f2;
}

.product-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-time-badge {
    font-size: 0.72rem;
    color: var(--primary-green);
    font-weight: 600;
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
    width: fit-content;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.price-box {
    display: flex;
    flex-direction: column;
}

.current-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.old-price {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.btn-add-cart {
    background-color: var(--accent-light);
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    z-index: 5;
    position: relative;
}

.btn-add-cart:hover, .btn-add-cart:active {
    background-color: var(--primary-green);
    color: #ffffff;
}

/* Quantity Control Box */
.qty-control-box {
    display: inline-flex;
    align-items: center;
    background: var(--primary-green);
    color: white;
    border-radius: 8px;
    overflow: hidden;
    font-weight: 700;
    font-size: 0.85rem;
    touch-action: manipulation;
    user-select: none;
    z-index: 5;
    position: relative;
}

.qty-control-box button {
    background: transparent;
    border: none;
    color: white;
    padding: 5px 12px;
    cursor: pointer;
    font-weight: bold;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.qty-control-box button:hover {
    background: rgba(0, 0, 0, 0.15);
}

.qty-control-box span {
    padding: 0 8px;
}

/* =======================================================
   SUBSCRIPTION BANNER & CARD
======================================================= */
.sub-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: var(--border-radius);
    color: white;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

/* =======================================================
   MOBILE BOTTOM NAVIGATION
======================================================= */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1030;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--primary-green);
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

/* =======================================================
   CART DRAWER & OVERLAY
======================================================= */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1060;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    right: 0;
}

.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1055;
    display: none;
}

.cart-drawer-overlay.open {
    display: block;
}

.cart-drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.cart-drawer-body {
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
}

.cart-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

/* Sticky Toast Notification */
.cf-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 1090;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.cf-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.cf-toast.success {
    border-left: 4px solid var(--primary-green);
}
