/* ==========================================================================
   AK MART - DESIGN SYSTEM
   Subject: a Tamil Nadu neighborhood "Annachi Kadai" gone quick-commerce.
   Signature element: the die-cut paper price-tag badge on product cards
   (see .price-tag below) - a nod to the string-tied cardboard price tags
   used in real kirana shops, instead of a generic gradient ribbon.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&family=Dancing+Script:wght@600;700&display=swap');

:root {
    --ak-green-900: #163D2C;
    --ak-green-700: #1B5E3C;
    --ak-green-600: #1F7A4D;
    --ak-green-100: #E4F0E7;
    --ak-turmeric: #F2A93B;
    --ak-turmeric-dark: #C7841E;
    --ak-sindoor: #C1272D;
    --ak-cream: #FBF7EE;
    --ak-cream-deep: #F3ECDC;
    --ak-ink: #22231F;
    --ak-ink-soft: #6B6A62;
    --ak-line: #E7E1D2;

    --ak-font-display: 'Fraunces', Georgia, serif;
    --ak-font-body: 'Inter', -apple-system, sans-serif;
    --ak-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    --ak-font-script: 'Dancing Script', cursive;

    --ak-radius: 14px;
    --ak-shadow: 0 1px 2px rgba(22,61,44,0.06), 0 6px 20px rgba(22,61,44,0.08);
}

body {
    background: var(--ak-cream);
    color: var(--ak-ink);
    font-family: var(--ak-font-body);
}

/* Boxed layout on wide screens - the whole page (header bar included, not
   just the body content) stays inside a centered column instead of
   stretching edge-to-edge on very wide monitors. Below this width, layout
   is untouched (full responsive behaviour as before). */
@media (min-width: 1600px) {
    body {
        max-width: 1600px;
        margin: 0 auto;
        box-shadow: 0 0 60px rgba(22, 61, 44, 0.08);
    }
}

/* ---- Headings borrow the display face, used with restraint ---- */
h1, h2, h3, h4, h5, h6,
.osahan-location-drop p,
#addressModalLabel {
    font-family: var(--ak-font-display);
    font-weight: 600;
    color: var(--ak-ink);
}

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.osahan-main-nav {
    background: var(--ak-cream) !important;
    border-bottom: 1px solid var(--ak-line);
}

.osahan-header .logo-img {
    border-color: var(--ak-green-100) !important;
}

.osahan-location-drop p {
    font-family: var(--ak-font-body);
    font-size: 11px;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--ak-ink-soft) !important;
}

.osahan-location-drop span {
    font-weight: 600;
    font-size: 14px;
}

.search-box .form-control.product-search {
    background: #fff;
    border: 1.5px solid var(--ak-line);
    border-radius: 10px 0 0 10px;
    height: 46px;
}

.search-box .btn-success {
    background: var(--ak-green-600);
    border-color: var(--ak-green-600);
    border-radius: 0 10px 10px 0;
}

.bg-color-head {
    background: var(--ak-green-900) !important;
}

.bg-color-head .nav-link {
    font-family: var(--ak-font-body);
    font-weight: 500;
    letter-spacing: .01em;
}

.bg-color-head .nav-link:hover {
    color: var(--ak-turmeric) !important;
}

.bg-offer {
    background: var(--ak-turmeric) !important;
    color: var(--ak-green-900) !important;
    font-weight: 600;
    border-radius: 20px;
    margin: 6px 0;
}

/* cart / user pill buttons in header */
.icofont-size.bg-light,
.header-user {
    background: #fff !important;
    border-color: var(--ak-line) !important;
}

#cartCount, #mobile_header_cart_count {
    background: var(--ak-sindoor) !important;
}

.breadcrumb {
    background: transparent;
    padding-top: 10px;
}

.breadcrumb-item.active {
    color: var(--ak-ink-soft);
}

/* ==========================================================================
   SIDEBAR - category rail (shop.php #categoryList) & sub-category rail
   ========================================================================== */
.checkout-sidebar {
    border-radius: var(--ak-radius) !important;
    border: 1px solid var(--ak-line);
    box-shadow: var(--ak-shadow) !important;
}

.category-item {
    border-bottom: 1px solid var(--ak-line) !important;
    font-family: var(--ak-font-body);
    font-weight: 500;
    font-size: 13px;
    transition: background .15s ease;
    cursor: pointer;
    padding: 10px;
}

.category-item:hover {
    background: var(--ak-green-100);
}

.category-item.active {
    background: var(--ak-green-600) !important;
    color: #fff !important;
    font-weight: 600;
}

.category-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    padding: 4px;
    background: #fff;
    border: 1.5px solid var(--ak-line);
}

.category-item.active img {
    border-color: #fff;
}

/* sub-category chips injected by shop.php's loadSubCategories() */
.sub-category-item {
    border-bottom: 1px solid var(--ak-line) !important;
    font-family: var(--ak-font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--ak-ink-soft);
    transition: background .15s ease, color .15s ease;
}

.sub-category-item:hover {
    background: var(--ak-green-100);
}

.sub-category-item.active {
    background: var(--ak-turmeric) !important;
    color: var(--ak-green-900) !important;
    font-weight: 700;
}

.sub-category-item img {
    border-radius: 8px;
    background: #fff;
    padding: 3px;
    border: 1px solid var(--ak-line);
}

.back-to-categories {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
    font-family: var(--ak-font-body);
    font-weight: 600;
    font-size: 12px;
    color: var(--ak-green-700);
    border-bottom: 1px solid var(--ak-line);
    cursor: pointer;
}
.back-to-categories:hover {
    background: var(--ak-green-100);
}

/* ==========================================================================
   PRODUCT GRID - cards injected by shop.php's loadProducts()
   ========================================================================== */
.list-card {
    border-radius: var(--ak-radius) !important;
    border: 1px solid var(--ak-line);
    box-shadow: var(--ak-shadow) !important;
    transition: transform .15s ease, box-shadow .15s ease;
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(22,61,44,0.08), 0 12px 28px rgba(22,61,44,0.14) !important;
}

.list-card-image img {
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
}

.list-card h6 {
    font-family: var(--ak-font-body);
    font-weight: 600;
    font-size: 13px;
    line-height: 1.35;
    min-height: 2.7em;
    margin-top: 6px;
}

/* -- signature element: the die-cut price tag -- */
.price-tag {
    position: absolute;
    top: 10px;
    left: -2px;
    z-index: 5;
    background: var(--ak-turmeric);
    color: var(--ak-green-900);
    font-family: var(--ak-font-mono);
    font-weight: 600;
    font-size: 11px;
    line-height: 1;
    padding: 6px 10px 6px 16px;
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

.price-tag::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ak-cream);
}

.list-card .price {
    font-family: var(--ak-font-mono);
    font-weight: 700;
    font-size: 16px;
    color: var(--ak-green-700) !important;
    margin: 0;
}

.list-card .price-mrp {
    font-family: var(--ak-font-mono);
    font-size: 11px;
    color: var(--ak-ink-soft);
    text-decoration: line-through;
    margin-left: 6px;
}

/* variant selector chips */
.variantBox {
    border: 1px solid var(--ak-line);
    border-radius: 8px;
    padding: 4px 8px;
    margin-right: 6px;
    cursor: pointer;
    font-size: 11px;
}

.variantBox.active {
    border-color: var(--ak-green-600);
    background: var(--ak-green-100);
}

.variantBox.disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* add to cart button + qty stepper */
.addBtn {
    display: inline-block;
    background: var(--ak-green-600) !important;
    color: #fff !important;
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 12px;
    padding: 6px 14px !important;
    border: none !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease;
}

.addBtn:hover {
    background: var(--ak-green-700);
}

.cart-items-number {
    background: var(--ak-green-600);
    border-radius: 8px;
    overflow: hidden;
}

.cart-items-number .qty {
    background: #fff;
    border: none;
    text-align: center;
    font-family: var(--ak-font-mono);
    font-weight: 600;
    width: 32px;
    padding: 0;
}

.cart-items-number .qtyBtn {
    border-radius: 0 !important;
    background: var(--ak-green-600) !important;
    border: none !important;
}

/* ==========================================================================
   BOTTOM NAV (mobile) - mirrors the AK Mart customer app's own bottom nav:
   4 tabs (Home / Category / Buy Again / Basket), icon above label, active
   tab gets the brand-green icon + a soft rounded highlight rather than the
   previous plain "email/github/ko-fi" class-named 3-item nav.

   #mobileBottomNav itself is hidden on desktop (d-none, set in footer.php)
   and shown + pinned to the bottom of the viewport only below the 992px
   breakpoint, matching the same convention .mobile-nav (the header) uses.
   Previously this whole nav lived inside #main-nav, which belongs to the
   hc-offcanvas-nav hamburger-drawer plugin - that plugin's own CSS sets
   "#main-nav { display: none }" unconditionally as a base state (it expects
   to move #main-nav's contents into the slide-out drawer via JS), so the
   bottom nav was permanently invisible on every page regardless of screen
   size or any rule here. */
@media (max-width: 992px) {
    #mobileBottomNav {
        display: block !important;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
    }

    /* Room for the fixed bottom nav on every page, so content isn't hidden
       behind it. product-details.php adds extra padding on top of this for
       its own sticky add-to-cart bar (see that file). */
    body.fixed-bottom-padding {
        padding-bottom: 64px;
    }
}

#mobileBottomNav .app-style-nav {
    background: #fff;
    border-top: 1px solid var(--ak-line);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0;
    margin: 0;
    list-style: none;
}

#mobileBottomNav .app-style-nav li {
    flex: 1;
    text-align: center;
}

#mobileBottomNav .app-style-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--ak-ink-soft);
    text-decoration: none;
    padding: 4px 0;
    border-radius: 12px;
    transition: background .15s ease, color .15s ease;
}

#mobileBottomNav .app-style-nav i {
    font-size: 18px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--ak-line);
    border-radius: 10px;
    margin-bottom: 2px;
    transition: border-color .15s ease, color .15s ease;
}

#mobileBottomNav .app-style-nav span {
    font-family: var(--ak-font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
}

#mobileBottomNav .app-style-nav li.active a {
    color: var(--ak-green-700);
    background: transparent;
}

#mobileBottomNav .app-style-nav li.active i {
    border-color: var(--ak-green-600);
    color: var(--ak-green-600);
}

/* Basket badge - positioned over the Basket icon's top-right corner, same
   count/id the header's cart icon used before it moved into the bottom nav. */
#mobileBottomNav .app-style-nav a.position-relative {
    position: relative;
}
#mobileBottomNav .nav-cart-badge {
    position: absolute;
    top: -2px;
    right: 4px;
    font-size: 9px;
    font-family: var(--ak-font-mono);
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    line-height: 1.3;
}

/* Legacy selector kept for any other bottom-nav markup elsewhere on the site */
#mobileBottomNav .bottom-nav a {
    color: var(--ak-ink-soft);
    font-family: var(--ak-font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
}

#mobileBottomNav .bottom-nav .text-success,
#mobileBottomNav .bottom-nav .text-success i {
    color: var(--ak-green-600) !important;
}

/* ==========================================================================
   MOBILE HEADER - app-style sticky top bar, matches the customer app's
   persistent search+cart header instead of scrolling away with the page.
   ========================================================================== */
.mobile-nav {
    background: var(--ak-cream);
}

/* Only the green "Deliver in" card sticks to the top on scroll (keeps
   search/cart always reachable) - the service pills above it scroll away
   normally. Previously BOTH shared ".mobile-nav"'s sticky/top:0/z-index,
   which are also shared between the pills wrap and the green header - since
   they're both fixed to the exact same top:0 position, whichever one comes
   later in the DOM (the green header) rendered on top of and completely
   covered the pills every time. */
.mobile-app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* .mobile-nav .osahan-logo rule kept for any other page still using the
   old standalone logo class elsewhere. */
.mobile-nav .osahan-logo {
    height: 32px;
}

.mobile-nav .search-box .product-search {
    background: #fff;
    border-radius: 10px 0 0 10px;
}

/* Green header card - matches the customer app's header style, now holding
   the service pills, address/profile row, and search all in one card
   instead of scattered across separate white/green sections. Needs
   !important to win over .mobile-nav's cream background above, since both
   classes are on the same element and this one must take priority. */
.mobile-app-header {
    background: var(--ak-green-900) !important;
    padding: 12px 16px 12px;
    border-bottom: none;
}

.mah-username {
    display: inline-block;
    color: var(--ak-ink) !important;
    font-family: var(--ak-font-body);
    font-weight: 700;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.92);
    padding: 3px 12px;
    border-radius: 20px;
}

/* Address + delivery-time chip sit in one row (matches the reference's own
   address-bar + "X min" chip layout). Address pill takes remaining space so
   long addresses truncate with an ellipsis instead of pushing the chip off. */
.mah-addr-row {
    gap: 8px;
}
.mah-addr-row .mah-location-pill {
    flex: 1;
    min-width: 0;
}
.mah-time-chip {
    flex-shrink: 0;
    background: var(--ak-turmeric);
    color: var(--ak-green-900);
    font-family: var(--ak-font-mono);
    font-weight: 700;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    margin-top: 8px;
    white-space: nowrap;
}

/* Solid pill (not a transparent white-on-white overlay) so the address
   text is guaranteed to read clearly no matter what color sits behind it
   - the old rgba(255,255,255,0.12) + white text only worked on the
   original dark-green header and disappeared on light campaign colors. */
.mah-location-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ak-ink);
    font-family: var(--ak-font-body);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    margin-top: 8px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mah-location-pill:hover {
    color: var(--ak-ink);
    text-decoration: none;
    background: #fff;
}

.mobile-app-header .search-box .input-group {
    border-radius: 10px;
}

.mobile-app-header .search-box .product-search {
    border-radius: 0;
}

/* Service switcher tabs - 4 real destinations (AK Mart/Grocery/Value/Fresh),
   horizontally scrollable, matching the app-icon-strip pattern from the
   reference design but with AK Mart's own real pages, not decorative tabs.
   Sits on a plain white band at the very top of the page (matching the
   reference's own ordering), above the green "Deliver in" card below it. */
.service-tabs-wrap {
    padding: 4px 0 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    /* Without an explicit min-height, this was measuring at 0px height in
       practice (confirmed via DevTools box model: "434 x 0") despite
       containing a display:flex child with real content - forcing a floor
       here guarantees the pills always have room to actually render. */
    min-height: 90px;
}
.service-tabs-wrap::-webkit-scrollbar { display: none; }
.service-tabs {
    display: flex;
    gap: 10px;
}

/* Branded pill cards - icon/logo on top, label below, matching the visual
   idea from the reference (not its colors/branding): bold, chunky pills
   with a solid-fill active state instead of a thin border, and larger,
   more colorful icons so each destination reads clearly at a glance. */
.service-pill {
    flex: 1 1 0;
    max-width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--ak-line);
    border-radius: 16px;
    padding: 12px 18px;
    min-width: 78px;
    text-decoration: none;
    box-shadow: var(--ak-shadow);
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.service-pill:hover {
    text-decoration: none;
    transform: translateY(-1px);
}
.service-pill img {
    height: 26px;
    width: auto;
}
.service-pill i {
    font-size: 24px;
    width: 26px;
    text-align: center;
}
.service-pill span {
    font-family: var(--ak-font-body);
    font-weight: 700;
    font-size: 12px;
    color: var(--ak-ink);
}

/* Active pill: solid brand-green fill (matches the reference's solid pink
   "Minutes" pill) instead of just a highlighted border, so the currently
   selected destination is unmistakable. */
.service-pill.active {
    background: var(--ak-green-600);
    border-color: var(--ak-green-600);
}
.service-pill.active span {
    color: #fff;
}
.service-pill.active i {
    color: #fff !important;
}

/* Per-pill accent colors for the icon only (non-active state) - the
   reference's own pills each carry a distinct brand color (blue Flipkart,
   pink Minutes, etc.); here each accent maps to what the pill actually is,
   not an arbitrary color, and stays bold/saturated to read as "realistic"
   rather than muted. */
.service-pill-grocery i { color: var(--ak-green-700); }
.service-pill-value i { color: var(--ak-sindoor); }
.service-pill-fresh i { color: var(--ak-turmeric-dark); }

/* ==========================================================================
   Shared button overrides (bootstrap's default green replaced everywhere)
   ========================================================================== */
.btn-outline-success {
    color: var(--ak-green-700) !important;
    border-color: var(--ak-green-600) !important;
    font-family: var(--ak-font-body);
    font-weight: 600;
    border-radius: 8px;
}

.btn-outline-success:hover {
    background: var(--ak-green-600) !important;
    color: #fff !important;
}

.btn-success {
    background: var(--ak-green-600) !important;
    border-color: var(--ak-green-600) !important;
}

.text-success {
    color: var(--ak-green-700) !important;
}

/* ==========================================================================
   LOCATION PICKER - "Select your Location" bottom sheet (see footer.php +
   common.js), shared across every page via the site-wide theme file since
   the header/footer that trigger it are included everywhere.
   ========================================================================== */
.location-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(22,35,31,0.4);
    z-index: 1200;
    display: none;
}
.location-sheet-backdrop.show { display: block; }

.location-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    z-index: 1201;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .25s ease;
}
.location-sheet.show { transform: translateY(0); }

.location-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--ak-line);
}
.location-sheet-header h5 {
    font-family: var(--ak-font-display);
    font-weight: 600;
    font-size: 17px;
    margin: 0;
}
.location-sheet-header i {
    cursor: pointer;
    font-size: 18px;
    color: var(--ak-ink-soft);
}

.location-sheet-body {
    padding: 16px;
}

.location-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ak-cream);
    border: 1px solid var(--ak-line);
    border-radius: 10px;
    padding: 10px 14px;
}
.location-search-box i {
    color: var(--ak-ink-soft);
}
.location-search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-family: var(--ak-font-body);
    font-size: 14px;
}

.location-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--ak-line);
    cursor: pointer;
    font-family: var(--ak-font-body);
    font-size: 13px;
}
.location-suggestion-item:hover {
    background: var(--ak-green-100);
}
.location-suggestion-item i {
    color: var(--ak-green-600);
}

.location-current-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px;
    margin-top: 8px;
    cursor: pointer;
    font-family: var(--ak-font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--ak-green-700);
}
.location-current-btn i {
    font-size: 18px;
}

/* ==========================================================================
   COMPACT BROWSE HEADER - shared by shop.php and search.php. A focused
   browse/search view strips away the green "Deliver in" card, service
   pills, and bottom nav entirely (none of header.php/footer.php is included
   on these two pages) so results get full attention, matching the
   Flipkart Minutes reference for a category/search results screen.
   ========================================================================== */
.search-compact-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--ak-line);
    position: sticky;
    top: 0;
    z-index: 900;
}
.search-compact-header i.icofont-arrow-left {
    font-size: 20px;
    color: var(--ak-ink);
    cursor: pointer;
}
.search-compact-header .search-box {
    flex: 1;
}
.search-compact-header .input-group {
    border: 1.5px solid var(--ak-line);
    border-radius: 10px;
}

/* Animated rotating search placeholder (see initAnimatedSearchPlaceholder
   in common.js) - subtle color so the typing/erasing cycle reads as a soft,
   ambient hint rather than competing with real typed input. */
.product-search::placeholder {
    color: var(--ak-ink-soft);
    opacity: 0.85;
    transition: opacity .15s ease;
}
