/* ═══════════════════════════════════════════════════
   QuickCommerce — Emerald Green Theme
   ═══════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
    /* Primary – rich emerald green */
    --qc-primary:        #16a34a;
    --qc-primary-dark:   #15803d;
    --qc-primary-deeper: #166534;
    --qc-primary-light:  #dcfce7;
    --qc-primary-pale:   #f0fdf4;

    /* Accent – warm amber */
    --qc-accent:         #f59e0b;
    --qc-accent-dark:    #d97706;
    --qc-accent-light:   #fef3c7;

    /* Neutrals */
    --qc-bg:             #f0fdf4;
    --qc-surface:        #ffffff;
    --qc-border:         #d1fae5;
    --qc-text:           #14532d;
    --qc-text-muted:     #6b7280;
    --qc-dark:           #0a1628;

    /* Shadows */
    --qc-shadow-sm:      0 1px 3px rgba(22,163,74,.1), 0 1px 2px rgba(22,163,74,.06);
    --qc-shadow:         0 4px 20px rgba(22,163,74,.12);
    --qc-shadow-lg:      0 8px 32px rgba(22,163,74,.18);
    --qc-shadow-xl:      0 16px 48px rgba(22,163,74,.22);

    /* Radius */
    --qc-radius-sm:      .5rem;
    --qc-radius:         1rem;
    --qc-radius-lg:      1.5rem;
    --qc-radius-full:    9999px;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--qc-bg);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: #1f2937;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════════════════
   NAVBAR
════════════════════════════════════════════════════ */
.qc-navbar {
    background: linear-gradient(135deg, var(--qc-primary) 0%, var(--qc-primary-deeper) 100%);
    box-shadow: 0 2px 16px rgba(21,128,61,.35);
    padding: .6rem 0;
    backdrop-filter: blur(8px);
}

.qc-navbar .navbar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.qc-navbar .navbar-brand i {
    color: var(--qc-accent) !important;
    filter: drop-shadow(0 0 6px rgba(245,158,11,.6));
}

.qc-navbar .nav-link {
    color: rgba(255,255,255,.85) !important;
    font-weight: 500;
    font-size: .9rem;
    padding: .45rem .75rem;
    border-radius: var(--qc-radius-sm);
    transition: color .2s, background .2s;
}

.qc-navbar .nav-link:hover {
    color: #fff !important;
    background: rgba(255,255,255,.12);
}

.qc-navbar .nav-link.active {
    color: var(--qc-accent) !important;
    font-weight: 700;
}

.qc-navbar .dropdown-menu {
    border: none;
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow-xl);
    padding: .5rem;
    min-width: 200px;
    animation: dropIn .18s ease;
}

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

.qc-navbar .dropdown-item {
    border-radius: var(--qc-radius-sm);
    padding: .5rem .75rem;
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s;
}

.qc-navbar .dropdown-item:hover {
    background: var(--qc-primary-pale);
    color: var(--qc-primary-dark);
}

.cart-badge {
    font-size: .6rem !important;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--qc-accent) !important;
    color: #fff !important;
    animation: popIn .25s cubic-bezier(.34,1.56,.64,1);
}

@keyframes popIn {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ── Search bar ── */
.search-bar { max-width: 520px; flex: 1; }
.search-bar .input-group { border-radius: var(--qc-radius-full); overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.search-bar .input-group-text { background: #fff; border: none; color: var(--qc-text-muted); padding-left: 1rem; }
.search-bar .form-control { border: none; font-size: .9rem; padding: .55rem .5rem; }
.search-bar .form-control:focus { box-shadow: none; outline: none; }
.search-bar .btn-warning {
    background: linear-gradient(135deg, var(--qc-accent), var(--qc-accent-dark));
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: .875rem;
    padding: .55rem 1.25rem;
    transition: opacity .2s;
}
.search-bar .btn-warning:hover { opacity: .9; color: #fff; }

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow-xl);
    z-index: 1050;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--qc-border);
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    text-decoration: none;
    color: #1f2937;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.search-suggestion-item:last-child { border-bottom: none; }
.search-suggestion-item:hover,
.search-suggestion-item.active { background: var(--qc-primary-pale); color: #1f2937; }

.search-suggestion-thumb {
    width: 44px; height: 44px;
    border-radius: var(--qc-radius-sm);
    background: var(--qc-primary-pale);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
}
.search-suggestion-thumb img { max-width:100%; max-height:100%; object-fit:contain; }
.search-suggestion-meta { font-size: .75rem; color: var(--qc-text-muted); }

.search-view-all {
    display: block;
    padding: .75rem 1rem;
    text-align: center;
    font-weight: 700;
    color: var(--qc-primary);
    text-decoration: none;
    background: var(--qc-primary-pale);
    font-size: .875rem;
    transition: background .15s;
}
.search-view-all:hover { background: var(--qc-primary-light); color: var(--qc-primary-dark); }

/* ════════════════════════════════════════════════════
   HERO SECTION
════════════════════════════════════════════════════ */
.hero-section {
    background: linear-gradient(135deg,
        var(--qc-primary) 0%,
        var(--qc-primary-dark) 50%,
        var(--qc-primary-deeper) 100%);
    color: #fff;
    border-radius: var(--qc-radius-lg);
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 260px; height: 260px;
    background: rgba(245,158,11,.15);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    left: 30%; bottom: -80px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,.06);
    border-radius: 50%;
}

/* ════════════════════════════════════════════════════
   CARDS
════════════════════════════════════════════════════ */
.category-card {
    background: #fff;
    border: 1.5px solid transparent;
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow);
    transition: transform .22s, box-shadow .22s, border-color .22s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--qc-shadow-xl);
    border-color: var(--qc-primary-light);
    color: inherit;
}

.category-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--qc-primary-pale);
    color: var(--qc-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto .75rem;
    transition: background .2s, transform .2s;
}
.category-card:hover .category-icon {
    background: var(--qc-primary-light);
    transform: scale(1.1);
}

.product-card {
    background: #fff;
    border: 1.5px solid var(--qc-border);
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow-sm);
    height: 100%;
    transition: transform .22s, box-shadow .22s, border-color .22s;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--qc-shadow-lg);
    border-color: var(--qc-primary-light);
}

.product-img-wrap {
    height: 160px;
    background: var(--qc-primary-pale);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
}
.product-img-wrap img { max-height:100%; max-width:100%; object-fit:contain; transition: transform .3s; }
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.product-img-placeholder { font-size: 3rem; color: #a7f3d0; }

/* ════════════════════════════════════════════════════
   TYPOGRAPHY & PRICE
════════════════════════════════════════════════════ */
.price-tag {
    color: var(--qc-primary);
    font-weight: 800;
    font-size: 1.1rem;
}
.mrp-strike {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: .85rem;
}
.discount-badge {
    background: var(--qc-accent-light);
    color: #92400e;
    font-size: .72rem;
    font-weight: 700;
    padding: .18rem .55rem;
    border-radius: var(--qc-radius-full);
}
.section-title {
    font-weight: 800;
    color: #111827;
    margin-bottom: 1.25rem;
    letter-spacing: -.02em;
}

/* ════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════ */
.btn-qc {
    background: linear-gradient(135deg, var(--qc-primary), var(--qc-primary-dark));
    border: none;
    color: #fff;
    font-weight: 700;
    border-radius: var(--qc-radius-sm);
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.btn-qc:hover {
    opacity: .92;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(22,163,74,.4);
}
.btn-qc:active { transform: none; box-shadow: none; }

/* Override Bootstrap primary to green across the site */
.btn-primary {
    background: linear-gradient(135deg, var(--qc-primary), var(--qc-primary-dark));
    border-color: var(--qc-primary-dark);
    font-weight: 600;
    transition: opacity .2s, transform .15s;
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--qc-primary-dark), var(--qc-primary-deeper));
    border-color: var(--qc-primary-deeper);
    transform: translateY(-1px);
}
.btn-outline-primary {
    color: var(--qc-primary);
    border-color: var(--qc-primary);
}
.btn-outline-primary:hover {
    background: var(--qc-primary);
    border-color: var(--qc-primary);
}
.btn-warning {
    background: linear-gradient(135deg, var(--qc-accent), var(--qc-accent-dark));
    border: none;
    color: #fff;
    font-weight: 700;
}
.btn-warning:hover { opacity:.9; color:#fff; }

/* ════════════════════════════════════════════════════
   FORMS
════════════════════════════════════════════════════ */
.form-control:focus, .form-select:focus {
    border-color: var(--qc-primary);
    box-shadow: 0 0 0 .2rem rgba(22,163,74,.2);
}
.form-check-input:checked {
    background-color: var(--qc-primary);
    border-color: var(--qc-primary);
}

/* ════════════════════════════════════════════════════
   QUANTITY CONTROL
════════════════════════════════════════════════════ */
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--qc-border);
    border-radius: var(--qc-radius-sm);
    overflow: hidden;
    background: #fff;
}
.qty-control button {
    border: none;
    background: var(--qc-primary-pale);
    width: 34px; height: 34px;
    font-weight: 700;
    color: var(--qc-primary-dark);
    transition: background .15s;
}
.qty-control button:hover { background: var(--qc-primary-light); }
.qty-control span {
    min-width: 34px;
    text-align: center;
    font-weight: 700;
    font-size: .95rem;
}

/* ════════════════════════════════════════════════════
   CART & ORDER
════════════════════════════════════════════════════ */
.cart-item-img {
    width: 80px; height: 80px;
    object-fit: contain;
    background: var(--qc-primary-pale);
    border-radius: var(--qc-radius-sm);
}
.summary-card {
    background: #fff;
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow);
    padding: 1.5rem;
    border: 1.5px solid var(--qc-border);
}

/* ════════════════════════════════════════════════════
   LOGIN / AUTH
════════════════════════════════════════════════════ */
.login-card {
    max-width: 440px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--qc-radius-lg);
    box-shadow: var(--qc-shadow-xl);
    padding: 2.5rem 2rem;
    border: 1.5px solid var(--qc-border);
}
.otp-display {
    background: var(--qc-primary-pale);
    border: 2px dashed var(--qc-primary);
    border-radius: var(--qc-radius);
    padding: 1rem;
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--qc-primary);
    letter-spacing: .35rem;
}

/* ════════════════════════════════════════════════════
   STATUS BADGES
════════════════════════════════════════════════════ */
.status-badge {
    font-size: .72rem;
    font-weight: 700;
    padding: .3rem .7rem;
    border-radius: var(--qc-radius-full);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ════════════════════════════════════════════════════
   ALERTS (override Bootstrap to green tone)
════════════════════════════════════════════════════ */
.alert-success {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
.alert-info {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

/* ════════════════════════════════════════════════════
   FILTER SIDEBAR
════════════════════════════════════════════════════ */
.filter-sidebar {
    background: #fff;
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow);
    padding: 1.25rem;
    border: 1.5px solid var(--qc-border);
}

/* ════════════════════════════════════════════════════
   DELIVERY BANNER
════════════════════════════════════════════════════ */
.delivery-banner {
    background: linear-gradient(90deg, var(--qc-accent-light), #fde68a);
    border-radius: var(--qc-radius-sm);
    padding: .75rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    color: #92400e;
    border-left: 4px solid var(--qc-accent);
}

/* ════════════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--qc-text-muted);
}
.empty-state i {
    font-size: 4.5rem;
    color: #a7f3d0;
    margin-bottom: 1rem;
    display: block;
}
.empty-state h4 { color: #374151; font-weight: 700; }

/* ════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════ */
.qc-footer {
    background: linear-gradient(180deg, #052e16 0%, #0a1628 100%);
    color: #d1fae5;
    border-top: 3px solid var(--qc-primary);
}
.qc-footer h5, .qc-footer h6 { color: #ecfdf5; }
.qc-footer p, .qc-footer li, .qc-footer .text-muted { color: #86efac !important; }
.qc-footer a { color: #a7f3d0; text-decoration: none; transition: color .2s; }
.qc-footer a:hover { color: var(--qc-accent); }
.qc-footer hr { border-color: rgba(134,239,172,.2); opacity: 1; }
.qc-footer .small, .qc-footer small { color: #6ee7b7 !important; }

/* ════════════════════════════════════════════════════
   BREADCRUMBS & PAGINATION
════════════════════════════════════════════════════ */
.page-link { color: var(--qc-primary); }
.page-link:hover { color: var(--qc-primary-dark); background: var(--qc-primary-pale); border-color: var(--qc-border); }
.page-item.active .page-link {
    background: var(--qc-primary);
    border-color: var(--qc-primary);
}

/* ════════════════════════════════════════════════════
   PROGRESS / STEPS
════════════════════════════════════════════════════ */
.progress-bar { background: linear-gradient(90deg, var(--qc-primary), var(--qc-accent)); }

/* ════════════════════════════════════════════════════
   SCROLLBAR (Webkit)
════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--qc-primary-pale); }
::-webkit-scrollbar-thumb { background: #86efac; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--qc-primary); }

/* ════════════════════════════════════════════════════
   SELECTION
════════════════════════════════════════════════════ */
::selection { background: var(--qc-primary-light); color: var(--qc-primary-deeper); }

/* ════════════════════════════════════════════════════
   UTILITIES
════════════════════════════════════════════════════ */
.text-qc      { color: var(--qc-primary) !important; }
.bg-qc        { background: var(--qc-primary) !important; }
.bg-qc-pale   { background: var(--qc-primary-pale) !important; }
.border-qc    { border-color: var(--qc-primary) !important; }
.shadow-qc    { box-shadow: var(--qc-shadow) !important; }

/* ════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .hero-section  { padding: 2rem 1.25rem; }
    .product-img-wrap { height: 130px; }
    .qc-navbar .navbar-brand { font-size: 1.1rem; }
}
