/* Shared portal header (Blinkit-style band) — load with customer-login-bottom-nav on portal pages */
:root {
    --bh-green: #2aa44a;
    --bh-green-dark: #22863a;
    --bh-green-soft: #e8f5ec;
    --bh-ink: #0f172a;
    --bh-muted: #64748b;
    --bh-line: #e5d8cf;
    --bh-card: #ffffff;
    --bh-surface-deep: #ffffff;
    --bh-orange-soft: #f6ece4;
    --bh-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    --bh-shadow-hover: 0 8px 28px rgba(15, 23, 42, 0.1);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --kf-app-gutter: var(--kf-space-2, 8px);
    --bh-layout-max: var(--kf-app-shell-max, 430px);
    /* Header bar fill — off-white hero; orange tokens are for Install button only */
    --kf-portal-header-chrome-bg: #ffffff;
    --kph-header-orange: #c2410c;
    --kph-header-orange-deep: #9a3412;
    --kph-header-orange-ink: #fff7ed;
    --kf-portal-bottom-chrome-bg: #1d7232;
    /* Deprecated alias kept for backward compatibility */
    --kf-portal-chrome-bg: var(--kf-portal-header-chrome-bg);
    /* Off-white app shell background */
    --kf-earth-green: #ffffff;
    --kf-page-bg: var(--kf-earth-green);
    --kf-shell-ink: rgba(32, 44, 30, 0.92);
    --kf-shell-muted: rgba(38, 52, 36, 0.72);
    /* Primary CTAs — overridden by portal-chrome.css (Admin → App Look) */
    --kf-cta-from: #f2d8c4;
    --kf-cta-mid: #e8c9ae;
    --kf-cta-to: #deb99a;
    --kf-cta-ink: #3f2d22;
    --kf-cta-shadow: rgba(170, 95, 55, 0.26);
    --kf-cta-shadow-strong: rgba(170, 95, 55, 0.36);
    --bh-page: var(--kf-earth-green);
    /* customer-app token — basket pages may omit customer-app.css */
    --ca-ink: #0f172a;
    /* Typography (--kf-app-font-family, --kf-app-fs-*): customer-app.css defaults + portal-chrome.css (App Look). Do not redefine here — order-sensitive pages would clobber admin sizes (e.g. header logo uses --kf-app-fs-heading). */
}

html:has(body.bh-page) {
    background: var(--kf-page-bg);
}

/* HTMX tab navigation — thin top progress while swapping #cph-main */
body.kf-portal-spa::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 12000;
    pointer-events: none;
    opacity: 0;
    background: #22c55e;
    transition: opacity 0.15s ease;
}

body.kf-portal-spa.kf-portal-loading::before {
    opacity: 1;
    animation: kf-portal-loading-bar 0.9s ease-in-out infinite;
}

@keyframes kf-portal-loading-bar {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.kf-portal-spa.kf-portal-loading::before {
        animation: none;
    }
}

body.bh-page {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--kf-app-font-family, 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif);
    font-size: var(--kf-app-fs-body, 0.875rem);
    line-height: 1.45;
    background: var(--kf-page-bg);
    color: var(--kf-shell-ink);
    -webkit-tap-highlight-color: transparent;
}

/* Dark text on warm card surfaces */
body.bh-page .bh-card,
body.bh-page .bh-card .bh-card__name {
    color: var(--bh-ink);
}

body.bh-page .ca-card {
    background: var(--bh-card);
    border-color: rgba(220, 196, 178, 0.72);
    color: var(--ca-ink, var(--bh-ink));
}

body.bh-page .ca-prose,
body.bh-page .ca-wrap,
body.bh-page .co-scroll {
    color: var(--ca-ink, var(--bh-ink));
}

body.bh-page .co-title {
    color: var(--kf-shell-ink);
}

body.bh-page .bh-ok {
    color: rgba(32, 52, 30, 0.82);
}

body.bh-page .bh-err {
    color: #fecaca;
}

body.bh-page .bh-empty,
body.bh-page .bh-hint {
    color: var(--kf-shell-muted);
}

/* Full-width hero — counteracts `.cph-shell` / `.bh-shell` gutter */
.kph {
    --kph-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --kph-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
    margin-inline: calc(-1 * var(--kf-app-gutter));
    margin-block: 0;
    width: calc(100% + 2 * var(--kf-app-gutter));
    max-width: none;
    box-sizing: border-box;
    position: relative;
    z-index: 940;
}

.kph-hero {
    --kph-hero-pad-x: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    overflow: hidden;
    padding: calc(12px + var(--safe-t)) 0 12px;
    border-radius: 0;
    background: linear-gradient(180deg, #fdfdfb 0%, #f4f3ee 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 6px 18px rgba(15, 23, 42, 0.12);
    border-bottom: 1px solid #dcdcd4;
    isolation: isolate;
}

/* Decorative layers — hidden on white header */
.kph-hero__bokeh {
    display: none;
}

.kph-hero__shimmer {
    display: none;
}

.kph-hero__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 48px;
    padding-inline: var(--kph-hero-pad-x);
    box-sizing: border-box;
}

.kph-hero__brand {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}

.kph-hero__brand--with-delivery {
    gap: 6px;
    padding-top: 1px;
}

/* User greeting brand (avatar + Hi name + next delivery) */
.kph-hero__brand--user {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.kph-hero__avatar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(155deg, #22c55e 0%, #15803d 100%);
    box-shadow:
        0 2px 6px rgba(21, 128, 61, 0.32),
        inset 0 1px 1px rgba(255, 255, 255, 0.45),
        0 0 0 2px #ffffff;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s var(--kph-spring);
}

.kph-hero__avatar:active {
    transform: scale(0.95);
}

.kph-hero__avatar-initial {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.kph-hero__avatar-ico {
    stroke: currentColor;
}

.kph-hero__greet {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.kph-hero__hi {
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #14532d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.kph-hero__greet-sub {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.3;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.kph-hero__greet-date {
    font-weight: 800;
    color: #0f766e;
}

.kph-hero__delivery {
    margin: 0;
    max-width: min(100%, 17.5rem);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #475569;
}

.kph-hero__delivery-lead {
    display: block;
    margin-bottom: 1px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0d9488;
}

.kph-hero__delivery-detail {
    display: block;
    font-weight: 700;
    color: #14532d;
}

.kph-hero__delivery-city {
    font-weight: 800;
    color: #166534;
}

.kph-hero__delivery-sep {
    margin: 0 0.2em;
    font-weight: 700;
    color: #94a3b8;
}

.kph-hero__delivery-date {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.kph-hero__logo-link {
    display: inline-block;
    max-width: 100%;
    text-decoration: none;
    border-radius: 0;
    transition: transform 0.22s var(--kph-spring);
    -webkit-tap-highlight-color: transparent;
    transform-style: preserve-3d;
    perspective: 520px;
}

.kph-hero__logo-link:active {
    transform: scale(0.96);
}

.kph-hero__logo-link:focus-visible {
    outline: 2px solid rgba(34, 134, 58, 0.55);
    outline-offset: 3px;
}

.kph-hero__eyebrow {
    margin: 0;
    font-size: var(--kf-app-fs-small);
    font-weight: 600;
    color: var(--bh-muted, #64748b);
    letter-spacing: 0.02em;
}

.kph-hero__logo {
    margin: 0;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    box-sizing: border-box;
    vertical-align: middle;
    background: none;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform-style: preserve-3d;
    transform-origin: 50% 55%;
}

@media (prefers-reduced-motion: no-preference) {
    .kph-hero__logo {
        animation: none;
    }

    .kph-hero__logo-link:hover .kph-hero__logo {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kph-hero__logo {
        animation: none;
    }
}

@keyframes kph-logo-lively {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotateX(0deg) rotateZ(-0.4deg) rotateY(-2.5deg) scale(1);
    }
    40% {
        transform: translate3d(0, -2.5px, 4px) rotateX(2deg) rotateZ(0.25deg) rotateY(2.5deg) scale(1.028);
    }
    72% {
        transform: translate3d(0, -1px, 1.5px) rotateX(0.8deg) rotateZ(-0.15deg) rotateY(-1deg) scale(1.012);
    }
}

body.bh-page.with-login-bottom-nav .kph-hero__logo-img {
    max-width: min(176px, calc(100vw - 140px));
    max-height: clamp(38px, 8vw, 44px);
}

.kph-hero__logo-img {
    display: block;
    /* Do not tie height to parent font-size (breaks with App Look + custom logos). */
    max-height: clamp(38px, 8vw, 44px);
    max-width: min(176px, calc(100vw - 128px));
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    border-radius: 0;
    filter: none;
    flex-shrink: 1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.kph-hero__tag {
    margin: 6px 0 0;
    font-size: var(--kf-app-fs-small);
    font-weight: 500;
    line-height: 1.35;
    color: var(--bh-muted, #64748b);
    max-width: 16rem;
}

/* Welcome / delivery line under logo */
.kph-delivery-strip {
    margin: 0;
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #fff7ed;
    text-align: center;
    background: #fb923c;
    background-image: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
    border-top: 1px solid rgba(154, 52, 18, 0.25);
    border-bottom: 1px solid rgba(154, 52, 18, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
    box-sizing: border-box;
}

.kph-delivery-strip__text {
    display: block;
    color: inherit;
    -webkit-text-fill-color: currentColor;
}

.kph-delivery-strip--msg {
    min-height: 0;
    line-height: 1.35;
    font-size: 0.8125rem;
}

.kph-delivery-strip--bar {
    position: relative;
    overflow: hidden;
    padding: 0;
    min-height: 5px;
    line-height: 0;
    font-size: 0;
    background: #fb923c !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

.kph-delivery-strip__sheen {
    display: none;
}

/*
 * Unified portal chrome (all customer pages with `bh-page with-login-bottom-nav`).
 * Rounded slab + depth — native app dock feel.
 */
html:has(body.bh-page.with-login-bottom-nav) {
    scroll-padding-bottom: calc(28px + var(--ca-lnav-dock, 66px) + env(safe-area-inset-bottom, 0px));
}

/* Full-width chrome — match fixed bottom tab bar (no shell side gutter) */
body.bh-page.with-login-bottom-nav .bh-shell,
body.bh-page.with-login-bottom-nav .cph-shell {
    padding-left: 0;
    padding-right: 0;
}

body.bh-page.with-login-bottom-nav header.kph {
    margin-inline: 0;
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
    overflow: visible;
    box-sizing: border-box;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 6px 18px rgba(15, 23, 42, 0.14);
}

body.bh-page.with-login-bottom-nav .kph-wallet-tip {
    margin-inline: 0;
    margin-bottom: var(--kf-app-gutter);
    width: 100%;
    max-width: none;
}

body.bh-page.with-login-bottom-nav .kph-hero {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 6px 18px rgba(15, 23, 42, 0.12);
    border-bottom: 1px solid #dcdcd4;
}

body.bh-page.with-login-bottom-nav .kph-hero:has(.kph-storenav),
body.bh-page.with-login-bottom-nav .kph-hero:has(.kph-quicktabs) {
    padding-bottom: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

body.bh-page.with-login-bottom-nav .kph-hero:has(.kph-storenav),
body.bh-page.with-login-bottom-nav .kph-hero:has(.kph-quicktabs) {
    overflow: visible;
}

body.bh-page.with-login-bottom-nav .kph-delivery-strip--bar {
    margin: 0;
    padding: 0;
    min-height: 4px;
    line-height: 0;
    font-size: 0;
    border-top: none;
    border-bottom: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.bh-page.with-login-bottom-nav .kph-delivery-strip--msg {
    margin: 0;
    padding: 8px 14px;
    min-height: 0;
    line-height: 1.35;
    font-size: 0.8125rem;
    border-top: 1px solid rgba(154, 52, 18, 0.25);
    border-bottom: 1px solid rgba(154, 52, 18, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* Top tabs — Zepto-style store switcher */
.kph-hero:has(.kph-storenav),
.kph-hero:has(.kph-quicktabs) {
    padding-bottom: 0;
    overflow: visible;
}

.kph-hero .kph-storenav,
.kph-hero .kph-quicktabs {
    margin-inline: 0;
    margin-top: 12px;
    margin-bottom: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

header.kph:has(.kph-storenav) .kph-delivery-strip,
header.kph:has(.kph-quicktabs) .kph-delivery-strip {
    margin-top: 0;
}

/* Orange accent lives in the tab row; hide the duplicate full-header strip */
header.kph:has(.kph-storenav) .kph-delivery-strip--bar,
header.kph:has(.kph-quicktabs) .kph-delivery-strip--bar {
    display: none;
}

/* ── Store navigation (Natural+ · FarmFresh · Veggies) ── */
.kph-storenav {
    --kph-store-rail: #15803d;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0 0 5px;
    width: 100%;
    background: transparent;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

/* Full-width orange accent under tab row — masked only under selected tab(s) */
.kph-storenav::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background: #fb923c;
    z-index: 1;
    pointer-events: none;
}

.kph-storenav[data-kf-active-store='baskets'] { --kph-store-rail: #15803d; }
.kph-storenav[data-kf-active-store='farmfresh'] { --kph-store-rail: #b45309; }
.kph-storenav[data-kf-active-store='veggies'] { --kph-store-rail: #0f766e; }
.kph-storenav[data-kf-active-store='fruits'] { --kph-store-rail: #be123c; }
.kph-storenav[data-kf-active-store='grocery'] { --kph-store-rail: #4338ca; }

.kph-storenav__scroller {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 12px 10px 0;
}

.kph-storenav__scroller::-webkit-scrollbar {
    display: none;
}

.kph-storenav__list {
    display: flex;
    align-items: stretch;
    gap: 6px;
    min-width: min-content;
    padding: 0;
    position: relative;
    z-index: 2;
}

.kph-storenav__chip {
    --kph-store-accent: #15803d;
    --kph-store-mark: #15803d;
    --kph-store-soft: #ecfdf3;
    --kph-store-soft-border: rgba(21, 128, 61, 0.28);
    position: relative;
    flex: 0 0 auto;
    scroll-snap-align: center;
    width: clamp(74px, 21vw, 96px);
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 6px 7px 7px;
    border-radius: 0;
    border: 1px solid var(--kph-store-soft-border);
    background: var(--kph-store-soft);
    color: var(--kph-store-accent);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.22s ease,
        color 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.kph-storenav__chip--baskets {
    --kph-store-accent: #15803d;
    --kph-store-mark: #15803d;
    --kph-store-soft: #ecfdf3;
    --kph-store-soft-border: rgba(21, 128, 61, 0.32);
    width: clamp(108px, 32vw, 136px);
    min-height: 62px;
    padding-top: 8px;
}
.kph-storenav__chip--farmfresh {
    --kph-store-accent: #b45309;
    --kph-store-mark: #b45309;
    --kph-store-soft: #fffbeb;
    --kph-store-soft-border: rgba(180, 83, 9, 0.28);
    width: clamp(108px, 32vw, 136px);
    min-height: 62px;
    padding-top: 8px;
}
.kph-storenav__chip--veggies {
    --kph-store-accent: #0f766e;
    --kph-store-mark: #0d9488;
    --kph-store-soft: #f0fdfa;
    --kph-store-soft-border: rgba(15, 118, 110, 0.3);
}
.kph-storenav__chip--fruits {
    --kph-store-accent: #be123c;
    --kph-store-mark: #e11d48;
    --kph-store-soft: #fff1f2;
    --kph-store-soft-border: rgba(190, 18, 60, 0.28);
}
.kph-storenav__chip--grocery {
    --kph-store-accent: #4338ca;
    --kph-store-mark: #4f46e5;
    --kph-store-soft: #eef2ff;
    --kph-store-soft-border: rgba(67, 56, 202, 0.28);
}

.kph-storenav__chip-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 0;
    color: var(--kph-store-mark);
    background: color-mix(in srgb, var(--kph-store-mark) 14%, #ffffff);
    transition: color 0.2s ease, background 0.2s ease;
}

.kph-storenav__chip-mark svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kph-storenav__chip-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
    width: 100%;
}

.kph-storenav__chip-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
    color: #14532d;
    background: linear-gradient(180deg, #fef9c3 0%, #fde047 100%);
    border: 1px solid rgba(234, 179, 8, 0.55);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
    max-width: calc(100% + 12px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.kph-storenav__chip.kph-quicktabs__tab--active .kph-storenav__chip-badge,
.kph-storenav__chip[aria-current='page'] .kph-storenav__chip-badge {
    color: #422006;
    border-color: rgba(255, 255, 255, 0.45);
}

.kph-storenav__chip-title {
    display: block;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-align: center;
    color: var(--kph-store-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kph-storenav__chip--baskets .kph-storenav__chip-title,
.kph-storenav__chip--farmfresh .kph-storenav__chip-title {
    white-space: normal;
    font-size: 0.6875rem;
    line-height: 1.12;
}

.kph-storenav__chip.kph-quicktabs__tab--mini .kph-storenav__chip-title,
.kph-storenav__chip.kph-quicktabs__tab--midi .kph-storenav__chip-title,
.kph-storenav__chip.kph-quicktabs__tab--veggies .kph-storenav__chip-title {
    white-space: normal;
    font-size: clamp(0.8125rem, 3.6vw, 0.9375rem);
    line-height: 1.12;
}

.kph-storenav__chip-tag {
    display: block;
    max-width: 100%;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
    color: color-mix(in srgb, var(--kph-store-accent) 72%, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kph-storenav__chip:active {
    transform: scale(0.98);
}

.kph-storenav__chip.kph-quicktabs__tab--active,
.kph-storenav__chip[aria-current='page'] {
    background: var(--kph-store-accent);
    color: #ffffff;
    border-color: var(--kph-store-accent);
    transform: none;
    box-shadow:
        0 4px 12px color-mix(in srgb, var(--kph-store-accent) 32%, transparent),
        0 0 0 1px color-mix(in srgb, var(--kph-store-accent) 20%, #ffffff) inset;
    z-index: 4;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Page-colored bridge — hides orange accent only under the selected tab */
.kph-storenav__chip.kph-quicktabs__tab--active::after,
.kph-storenav__chip[aria-current='page']::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    transform: translateY(100%);
    background: var(--bh-page, #f7faf8);
    z-index: 5;
    pointer-events: none;
}

.kph-storenav__chip.kph-quicktabs__tab--active .kph-storenav__chip-mark,
.kph-storenav__chip[aria-current='page'] .kph-storenav__chip-mark {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

.kph-storenav__chip.kph-quicktabs__tab--active .kph-storenav__chip-title,
.kph-storenav__chip[aria-current='page'] .kph-storenav__chip-title,
.kph-storenav__chip.kph-quicktabs__tab--active .kph-storenav__chip-tag,
.kph-storenav__chip[aria-current='page'] .kph-storenav__chip-tag {
    color: #ffffff;
}

.kph-storenav__chip.kph-quicktabs__tab--active .kph-storenav__chip-tag,
.kph-storenav__chip[aria-current='page'] .kph-storenav__chip-tag {
    opacity: 0.88;
}

/* Featured Baskets chip — extra pop on white header */
.kph-storenav__chip--featured:not(.kph-quicktabs__tab--active):not([aria-current='page']) {
    box-shadow:
        0 2px 10px color-mix(in srgb, var(--kph-store-accent) 28%, transparent),
        0 0 0 1px color-mix(in srgb, var(--kph-store-accent) 35%, transparent);
}

.kph-storenav__chip--featured:not(.kph-quicktabs__tab--active):not([aria-current='page']) .kph-storenav__chip-tag {
    color: var(--kph-store-accent);
}

.kph-storenav__chip:focus-visible {
    outline: 2px solid var(--kph-store-accent);
    outline-offset: 2px;
}

.kph-storenav__rail {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .kph-storenav__chip.kph-quicktabs__tab--active,
    .kph-storenav__chip[aria-current='page'] {
        transform: none;
    }
}

@media (min-width: 420px) {
    .kph-storenav__list {
        justify-content: center;
        min-width: 100%;
    }

    .kph-storenav__chip {
        flex: 1 1 0;
        max-width: 100px;
    }

    .kph-storenav__chip--baskets,
    .kph-storenav__chip--farmfresh {
        flex: 1.35 1 0;
        max-width: 156px;
    }
}

@media (max-width: 359px) {
    .kph-storenav__scroller {
        padding-top: 10px;
    }

    .kph-storenav__chip {
        width: 70px;
        min-height: 54px;
        padding: 5px 6px 6px;
    }

    .kph-storenav__chip--baskets,
    .kph-storenav__chip--farmfresh {
        width: 102px;
        min-height: 58px;
        padding-top: 7px;
    }

    .kph-storenav__chip-title {
        font-size: 0.6875rem;
    }
}

body.bh-page.with-login-bottom-nav .kph-storenav,
body.bh-page.with-login-bottom-nav .kph-quicktabs {
    margin-top: 12px;
    margin-bottom: 0;
    width: 100%;
    max-width: none;
}

body.bh-page.with-login-bottom-nav header.kph:has(.kph-storenav) .kph-delivery-strip,
body.bh-page.with-login-bottom-nav header.kph:has(.kph-quicktabs) .kph-delivery-strip {
    margin-top: 0;
}

body.bh-page.with-login-bottom-nav header.kph:has(.kph-storenav) .kph-delivery-strip--bar,
body.bh-page.with-login-bottom-nav header.kph:has(.kph-quicktabs) .kph-delivery-strip--bar {
    display: none;
}

body.bh-page.with-login-bottom-nav header.kph:has(.kph-storenav),
body.bh-page.with-login-bottom-nav header.kph:has(.kph-quicktabs) {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

@media (min-width: 768px) {
    body.bh-page.with-login-bottom-nav header.kph {
        border-radius: 0;
    }
}

.kph-hero__top:has(.kph-hero__brand--with-delivery) {
    align-items: flex-start;
    min-height: 58px;
}

.kph-hero__top:has(.kph-hero__brand--with-delivery) .kph-hero__actions {
    padding-top: 2px;
}

.kph-hero__actions {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    max-width: min(100%, calc(100% - 88px));
}

.kph-profile-btn {
    color: #0369a1;
}

.kph-profile-btn:active {
    color: #0c4a6e;
}

.kph-wallet.kph-icon-btn,
.kph-wallet-btn {
    color: #15803d;
}

.kph-wallet__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #15803d;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.35);
    pointer-events: none;
    z-index: 2;
}

.kph-wallet {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    height: 34px;
    padding: 0 9px 0 8px;
    border-radius: 0;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 1px 3px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(34, 197, 94, 0.1);
    color: #0f1f14;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    overflow: visible;
    transition:
        transform 0.2s var(--kph-spring),
        box-shadow 0.2s var(--kph-ease-out);
}

.kph-wallet.kph-icon-btn {
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    gap: 0;
    overflow: visible;
}

.kph-wallet__glow {
    position: absolute;
    inset: -50%;
    background: rgba(74, 222, 128, 0.22);
    pointer-events: none;
    opacity: 0.65;
}

@media (prefers-reduced-motion: no-preference) {
    .kph-wallet__glow {
        animation: kph-wallet-pulse 3.2s ease-in-out infinite;
    }

    @keyframes kph-wallet-pulse {
        0%,
        100% {
            opacity: 0.45;
            transform: scale(1);
        }
        50% {
            opacity: 0.75;
            transform: scale(1.05);
        }
    }
}

a.kph-wallet:active {
    transform: scale(0.96);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 2px 8px rgba(0, 0, 0, 0.12);
}

.kph-wallet__icon {
    position: relative;
    z-index: 1;
    display: flex;
    color: #15803d;
}

@media (prefers-reduced-motion: no-preference) {
    .kph-wallet__icon svg {
        animation: kph-wallet-icon 2.4s ease-in-out infinite;
    }

    @keyframes kph-wallet-icon {
        0%,
        100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-1px);
        }
    }
}

.kph-wallet__amt {
    position: relative;
    z-index: 1;
    font-size: calc(var(--kf-app-fs-small, 0.8125rem) * 0.9);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.kph-wallet__chev {
    position: relative;
    z-index: 1;
    display: flex;
    margin-left: -2px;
    color: rgba(15, 31, 20, 0.38);
    transition: transform 0.2s var(--kph-ease-out), color 0.2s;
}

a.kph-wallet:active .kph-wallet__chev {
    transform: translateX(2px);
    color: rgba(15, 31, 20, 0.55);
}

.kph-pwa-install {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    max-width: 7.5rem;
    padding: 0 12px;
    height: 36px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: var(--kph-header-orange-deep, #9a3412);
    color: var(--kph-header-orange-ink, #fff7ed);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 2px 10px rgba(124, 45, 18, 0.45),
        0 0 0 1px rgba(154, 52, 18, 0.35);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s var(--kph-spring), box-shadow 0.2s var(--kph-ease-out);
}

.kph-pwa-install::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.28);
    pointer-events: none;
    opacity: 0.85;
}

.kph-pwa-install__ico,
.kph-pwa-install__label {
    position: relative;
    z-index: 1;
}

.kph-pwa-install__ico {
    flex-shrink: 0;
    filter: drop-shadow(0 1px 1px rgba(67, 20, 7, 0.35));
}

@media (prefers-reduced-motion: no-preference) {
    .kph-pwa-install:not([hidden]) {
        animation: kph-pwa-install-glow 2.6s ease-in-out infinite;
    }

    @keyframes kph-pwa-install-glow {
        0%,
        100% {
            box-shadow:
                0 1px 0 rgba(255, 255, 255, 0.22) inset,
                0 2px 10px rgba(124, 45, 18, 0.45),
                0 0 0 1px rgba(154, 52, 18, 0.35);
        }
        50% {
            box-shadow:
                0 1px 0 rgba(255, 255, 255, 0.3) inset,
                0 3px 14px rgba(124, 45, 18, 0.55),
                0 0 0 2px rgba(234, 88, 12, 0.45);
        }
    }
}

.kph-pwa-install[hidden] {
    display: none !important;
}

.kph-pwa-install:active {
    transform: scale(0.96);
    background: #7c2d12;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 1px 6px rgba(124, 45, 18, 0.4),
        0 0 0 1px rgba(154, 52, 18, 0.35);
}

.kph-pwa-install:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.kph-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 0;
    color: #0f1f14;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 1px 3px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s var(--kph-spring), box-shadow 0.2s var(--kph-ease-out);
    -webkit-tap-highlight-color: transparent;
}

.kph-icon-btn::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    pointer-events: none;
    opacity: 0.7;
}

.kph-icon-btn:active {
    transform: scale(0.93);
}

.kph-icon-btn:focus-visible {
    outline: 2px solid rgba(34, 134, 58, 0.55);
    outline-offset: 3px;
}

.kph-cart-btn {
    width: 42px;
    min-width: 42px;
    padding: 0;
    gap: 0;
}

.kph-cart-btn__label {
    display: none !important;
}

.kph-cart-btn__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
    pointer-events: none;
}

.kph-cart-btn__badge[hidden] {
    display: none !important;
}

@media (max-width: 360px) {
    .kph-cart-btn {
        width: 42px;
        padding: 0;
    }
}

.kph-notify-btn__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
    pointer-events: none;
}

.kph-notify-btn__badge[hidden] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .kph-hero__bokeh--a,
    .kph-hero__bokeh--b,
    .kph-hero__shimmer,
    .kph-delivery-strip--bar,
    .kph-delivery-strip__sheen,
    .kph-wallet__glow,
    .kph-wallet__icon svg {
        animation: none !important;
    }
}

/* Narrow column for header + page body when not using .bh-shell */
.cph-shell {
    width: 100%;
    max-width: var(--bh-layout-max, 420px);
    margin: 0 auto;
    padding: calc(var(--kf-app-gutter) + var(--safe-t)) var(--kf-app-gutter) var(--kf-app-gutter);
    box-sizing: border-box;
    background: transparent;
}

@media (max-width: 767.98px) {
    .cph-shell {
        max-width: none;
    }
}

/* No gap above chrome — notch / status bar clears inside `.kph-hero` (.bh-shell: customer-basket-home.css) */
body:has(.cph-shell > header.kph) .cph-shell {
    padding-top: 0;
}

.cph-shell--login {
    padding-bottom: var(--kf-app-gutter);
    position: relative;
    z-index: 5;
}

body.bh-page.with-login-bottom-nav .cph-shell {
    padding-bottom: calc(24px + var(--ca-lnav-dock, 74px) + env(safe-area-inset-bottom, 0px));
}

body.with-login-bottom-nav .cph-shell.cph-shell--login {
    padding-bottom: var(--kf-app-gutter);
}

/* Portal main: uniform section rhythm — quick-commerce gutter + stack gap */
body.bh-page:not(.bh-page--embed) main#cph-main.cph-main {
    display: flex;
    flex-direction: column;
    gap: var(--kf-app-gutter);
    padding-block: var(--kf-app-gutter);
    padding-inline: 0;
    min-width: 0;
    box-sizing: border-box;
}

/* Embeds / non-portal mains keep block flow */
main#cph-main.cph-main {
    min-width: 0;
}

body.bh-page--embed main#cph-main.cph-main {
    display: block;
    gap: unset;
    padding-block: 0;
}

/* Section / in-page header chrome: 5px inset (stack spacing = main `gap`) */
body.bh-page:not(.bh-page--embed) main#cph-main.cph-main > section,
body.bh-page:not(.bh-page--embed) main#cph-main.cph-main > header {
    padding: var(--kf-app-gutter);
    box-sizing: border-box;
}

/**
 * Desktop: centered “phone” column — thin bezel + inset highlights (same language as bottom tab bar).
 * Applies to main scroll column; bottom nav + pay bar get matching edges in their stylesheets.
 */
@media (min-width: 768px) {
    body.bh-page.with-login-bottom-nav .cph-shell,
    body.bh-page.with-login-bottom-nav .bh-shell {
        border-left: 1px solid rgba(0, 0, 0, 0.08);
        border-right: 1px solid rgba(0, 0, 0, 0.08);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.55),
            inset 1px 0 0 rgba(255, 255, 255, 0.22),
            inset -1px 0 0 rgba(0, 0, 0, 0.06),
            inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    }
}

@media (max-width: 767.98px) {
    body.bh-page.with-login-bottom-nav .cph-shell,
    body.bh-page.with-login-bottom-nav .bh-shell {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }
}

/* Low balance — full-bleed strip directly under portal header (all logged-in portal pages) */
.kph-wallet-tip {
    margin: 0 calc(-1 * var(--kf-app-gutter)) 10px;
    width: calc(100% + 2 * var(--kf-app-gutter));
    max-width: none;
    box-sizing: border-box;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    border-radius: 0;
    background: #fffbeb;
    border-bottom: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 6px 18px rgba(180, 83, 9, 0.08);
}

.kph-wallet-tip__text {
    margin: 0;
    font-size: var(--kf-app-fs-small);
    font-weight: 600;
    line-height: 1.45;
    color: #78350f;
    text-align: center;
    width: 100%;
}

.kph-wallet-tip__link {
    align-self: center;
    font-size: var(--kf-app-fs-small);
    font-weight: 700;
    color: #92400e;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kph-wallet-tip__link:active {
    opacity: 0.85;
}

@media (max-width: 380px) {
    .kph-hero {
        --kph-hero-pad-x: 10px;
    }

    .kph-hero__top {
        padding-inline: var(--kph-hero-pad-x);
    }

    .kph-hero__actions {
        gap: 5px;
        max-width: min(100%, calc(100% - 76px));
    }

    body.bh-page.with-login-bottom-nav .kph-hero__logo-img {
        max-width: min(156px, calc(100vw - 48px));
        max-height: 40px;
    }

    .kph-hero__delivery {
        font-size: 0.62rem;
        max-width: min(100%, 14.5rem);
    }

    .kph-hero__delivery-lead {
        font-size: 0.54rem;
        letter-spacing: 0.1em;
    }

    .kph-wallet.kph-icon-btn {
        width: 42px;
        min-height: 42px;
        padding: 0;
    }

    .kph-wallet__badge {
        font-size: 0.54rem;
        top: -4px;
        right: -5px;
        max-width: 3.25rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .kph-wallet__amt {
        font-size: 0.625rem;
    }

    .kph-pwa-install {
        padding: 0 7px;
        max-width: 5.25rem;
    }

    .kph-pwa-install__ico {
        width: 14px;
        height: 14px;
    }
}

@media (min-width: 381px) {
    .kph-pwa-install {
        max-width: 6.5rem;
        padding-inline: 10px;
    }
}

/* Staff support view — read-only customer portal */
.kf-staff-support-banner {
    position: relative;
    z-index: 20;
    max-width: var(--bh-layout-max, 420px);
    margin: 0 auto;
    padding: 8px var(--kf-app-gutter, 8px) 0;
    box-sizing: border-box;
}

.kf-staff-support-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(234, 179, 8, 0.45);
    background: #fffbeb;
    box-shadow: 0 2px 10px rgba(180, 83, 9, 0.08);
}

.kf-staff-support-banner__text {
    margin: 0;
    flex: 1 1 12rem;
    font-family: var(--kf-app-font-family, inherit);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: #78350f;
}

.kf-staff-support-banner__sep {
    margin-inline: 4px;
    opacity: 0.5;
}

.kf-staff-support-banner__badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #92400e;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(234, 179, 8, 0.35);
    vertical-align: middle;
}

.kf-staff-support-banner__meta {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    font-weight: 500;
    color: #a16207;
}

.kf-staff-support-banner__actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

.kf-staff-support-banner__link {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    color: #78350f;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(180, 83, 9, 0.25);
}

.kf-staff-support-banner__link--exit {
    color: #fff;
    background: #b45309;
    border-color: #92400e;
}

.kf-staff-support-banner__link:active {
    transform: scale(0.98);
}

/* Farmer thank-you strip — bottom of header (logged-in customers) */
header.kph .kph-farmer-thanks {
    display: block !important;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 6px 14px 7px;
    text-align: center;
    background-color: #ea580c !important;
    background-image: linear-gradient(180deg, #fb923c 0%, #ea580c 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: visible;
}

header.kph .kph-farmer-thanks__text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 auto;
    max-width: 40rem;
    font-family: var(--kf-app-font-family, 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif);
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: 0.01em;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    white-space: normal;
}

header.kph .kph-farmer-thanks[lang='hi'] .kph-farmer-thanks__text,
header.kph .kph-farmer-thanks[lang='pa'] .kph-farmer-thanks__text {
    font-family: 'Noto Sans Devanagari', 'Noto Sans Gurmukhi', 'Nirmala UI', 'Mangal', 'Gurmukhi MN', var(--kf-app-font-family, system-ui), sans-serif;
}

body.bh-page.with-login-bottom-nav header.kph:has(.kph-farmer-thanks) {
    overflow: visible;
}

body.bh-page.with-login-bottom-nav header.kph .kph-farmer-thanks {
    padding: 6px 12px 7px;
}

body.bh-page.with-login-bottom-nav header.kph .kph-farmer-thanks__text {
    font-size: 0.75rem !important;
}

/* Category icons row (full width; no logo) */
.kph-hero__top--with-cats {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    min-height: 0;
    padding-right: 0;
}

.kph-hero__top--with-cats .kph-cats {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
}

.kph-hero__top--with-cats .kph-cats__scroller {
    padding: 0 4px 2px;
}

.kph-hero__top--with-cats .kph-cats__list {
    min-width: 0;
    padding-top: 0;
}

/* Logo + search (top of header) */
.kph-hero__search-row {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 var(--kph-hero-pad-x, 14px) 0;
    box-sizing: border-box;
    background: transparent;
    border-bottom: 0;
}

.kph-hero__search-row--logo-only {
    justify-content: flex-start;
}

.kph-hero__search-row--box-actions {
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.kph-hero__search-row--box-actions .kph-hero__logo-link--search {
    flex: 0 1 auto;
    max-width: min(150px, 42vw);
}

.kph-box-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 2px;
    margin-left: auto;
    flex: 0 0 auto;
}

.kph-box-actions__link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 46px;
    padding: 2px 4px;
    text-decoration: none;
    color: #14532d;
    font-family: var(--kf-app-font-family), system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.kph-box-actions__link:active {
    opacity: 0.72;
}

.kph-box-actions__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: inherit;
}

.kph-box-actions__icon svg {
    width: 20px;
    height: 20px;
}

.kph-box-actions__label {
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
    color: #334155;
}

.kph-box-actions__badge {
    position: absolute;
    top: -2px;
    right: 2px;
    min-width: 1.1rem;
    padding: 1px 4px;
    border-radius: 0;
    background: #166534;
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

button.kph-box-actions__link {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

/* /box — You / Wallet / Orders bottom sheet */
.kph-box-sheet {
    position: fixed;
    inset: 0;
    z-index: 12250;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: auto;
}

.kph-box-sheet[hidden] {
    display: none !important;
    pointer-events: none;
}

.kph-box-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.kph-box-sheet__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--bh-layout-max, 430px);
    height: min(88dvh, 760px);
    margin: 0 auto;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 -14px 40px rgba(15, 23, 42, 0.2);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.kph-box-sheet--open .kph-box-sheet__backdrop {
    opacity: 1;
}

.kph-box-sheet--open .kph-box-sheet__panel {
    transform: translateY(0);
}

.kph-box-sheet__handle {
    flex: 0 0 auto;
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: #cbd5e1;
}

.kph-box-sheet__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 10px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.kph-box-sheet__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.kph-box-sheet__close {
    appearance: none;
    border: 0;
    background: #f1f5f9;
    color: #334155;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.kph-box-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    background: #f8fafc;
}

.kph-box-sheet__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

body.kph-box-sheet-open {
    overflow: hidden;
}

/* Pages loaded inside /box account sheet — hide portal chrome */
html.kf-portal-embed .kph,
html.kf-portal-embed .kph-cats-row,
html.kf-portal-embed .kph-wallet-tip,
html.kf-portal-embed .ca-lnav,
html.kf-portal-embed .kf-floating-cart,
html.kf-portal-embed .kph-contact-bar {
    display: none !important;
}

html.kf-portal-embed body.with-login-bottom-nav .bh-shell,
html.kf-portal-embed body.with-login-bottom-nav .cph-shell {
    padding-bottom: 12px !important;
    padding-top: 0 !important;
}

html.kf-portal-embed body {
    background: #fff !important;
}

html.kf-portal-embed .bh-shell,
html.kf-portal-embed .cph-main,
html.kf-portal-embed .mh-main {
    max-width: none !important;
    margin: 0 !important;
}

header.kph:has(.kph-hero__search-row) {
    overflow: visible;
}

/* Contact / social strip — bigger & bolder (matches login bottom bar) */
header.kph .kph-contact-bar,
.kph-contact-bar {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: calc(8px + var(--safe-t, 0px)) 0 8px;
    background: linear-gradient(180deg, #14532d 0%, #166534 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #ecfdf5;
    box-sizing: border-box;
}

header.kph .kph-contact-bar__inner,
.kph-contact-bar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
    min-height: 40px;
    padding: 0 var(--kph-hero-pad-x, 10px);
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: hidden;
}

.kph-contact-bar__inner::-webkit-scrollbar {
    display: none;
}

header.kph .kph-contact-bar__actions,
header.kph .kph-contact-bar__social,
.kph-contact-bar__actions,
.kph-contact-bar__social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 0 0 auto;
    min-width: 0;
}

.kph-contact-bar__actions {
    flex-wrap: nowrap;
}

header.kph .kph-contact-bar__link,
.kph-contact-bar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 7px 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(236, 253, 245, 0.92);
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

header.kph .kph-contact-bar__link + .kph-contact-bar__link,
.kph-contact-bar__link + .kph-contact-bar__link {
    position: relative;
    padding-left: 10px;
    margin-left: 2px;
}

header.kph .kph-contact-bar__link + .kph-contact-bar__link::before,
.kph-contact-bar__link + .kph-contact-bar__link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 16px;
    transform: translate(-0.5px, -50%);
    background: rgba(255, 255, 255, 0.18);
}

.kph-contact-bar__link:hover,
.kph-contact-bar__link:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.kph-contact-bar__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    opacity: 0.95;
}

header.kph .kph-contact-bar__ico svg,
.kph-contact-bar__ico svg {
    width: 16px !important;
    height: 16px !important;
}

.kph-contact-bar__link--wa {
    color: #bbf7d0;
}

.kph-contact-bar__link--phone {
    font-weight: 800;
}

header.kph .kph-contact-bar__social,
.kph-contact-bar__social {
    flex: 0 0 auto;
    gap: 6px;
    margin-left: 0;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
}

header.kph .kph-contact-bar__social-link,
.kph-contact-bar__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: rgba(236, 253, 245, 0.9);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

header.kph .kph-contact-bar__social-link svg,
.kph-contact-bar__social-link svg {
    width: 16px !important;
    height: 16px !important;
}

.kph-contact-bar__social-link:hover,
.kph-contact-bar__social-link:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

@media (max-width: 379.98px) {
    header.kph .kph-contact-bar__link,
    .kph-contact-bar__link {
        padding: 6px 6px;
        font-size: 0.84rem !important;
    }

    header.kph .kph-contact-bar__link + .kph-contact-bar__link,
    .kph-contact-bar__link + .kph-contact-bar__link {
        padding-left: 8px;
    }

    header.kph .kph-contact-bar__social-link,
    .kph-contact-bar__social-link {
        width: 30px !important;
        height: 30px !important;
    }
}

header.kph:has(.kph-contact-bar) .kph-hero:has(.kph-hero__search-row) {
    padding-top: 8px;
}

.kph-hero:has(.kph-hero__search-row) {
    padding-top: calc(8px + var(--safe-t));
    padding-bottom: 2px;
    overflow: visible;
}

/* Category strip — sticks to top while logo/search/tagline scroll away */
.kph-cats-row {
    position: sticky;
    top: 0;
    z-index: 950;
    margin-inline: calc(-1 * var(--kf-app-gutter, 8px));
    margin-bottom: 0;
    width: calc(100% + 2 * var(--kf-app-gutter, 8px));
    max-width: none;
    padding: 8px var(--kph-hero-pad-x, 14px) 10px;
    background: linear-gradient(180deg, #fdfdfb 0%, #f4f3ee 100%);
    border-bottom: 1px solid #dcdcd4;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

/* Search dropdown lives in the header; raise the whole header above the sticky
   category strip while results are open (sibling stacking contexts). */
header.kph.kph--search-open,
body.bh-page.with-login-bottom-nav header.kph.kph--search-open,
body.mh-page.with-login-bottom-nav header.kph.kph--search-open {
    z-index: 980;
}

header.kph.kph--search-open + .kph-cats-row,
body.kph-search-open .kph-cats-row,
body.bh-page.with-login-bottom-nav.kph-search-open .kph-cats-row,
body.mh-page.with-login-bottom-nav.kph-search-open .kph-cats-row {
    z-index: 900;
}

body.bh-page.with-login-bottom-nav .kph-cats-row {
    margin-inline: 0;
    width: 100%;
}

.kph-cats-row .kph-cats {
    margin: 0;
    width: 100%;
    padding: 0;
}

.kph-cats-row .kph-cats__scroller {
    padding: 0;
}

.kph-hero__logo-link--search {
    flex: 1 1 auto;
    min-width: 0;
}

.kph-hero__search-row .kph-hero__logo-img,
body.bh-page.with-login-bottom-nav .kph-hero__search-row .kph-hero__logo-img {
    max-width: min(168px, 48vw);
    max-height: 48px;
}

/* /box: logo-only header — make brand mark more prominent */
body.bh-box-page .kph-hero__search-row--logo-only .kph-hero__logo-link--search {
    flex: 0 1 auto;
    max-width: min(220px, 62vw);
}

body.bh-box-page .kph-hero__search-row--box-actions .kph-hero__logo-link--search {
    max-width: min(200px, 52vw);
}

body.bh-box-page .kph-hero__search-row .kph-hero__logo-img,
body.bh-box-page.with-login-bottom-nav .kph-hero__search-row .kph-hero__logo-img,
body.bh-box-page.bh-page.with-login-bottom-nav .kph-hero__logo-img {
    max-width: min(220px, 62vw);
    max-height: clamp(52px, 12vw, 64px);
}

.kph-search {
    position: relative;
    flex: 0 1 200px;
    width: 100%;
    max-width: min(200px, 42vw);
    min-width: 132px;
    margin-left: auto;
}

.kph-search__field {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kph-search__field:focus-within {
    border-color: #1d7232;
    box-shadow: 0 0 0 2px rgba(29, 114, 50, 0.12);
}

.kph-search__ico {
    flex: 0 0 auto;
    color: #94a3b8;
    display: inline-flex;
}

.kph-search__ico svg {
    width: 15px;
    height: 15px;
}

.kph-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #0f172a;
    padding: 7px 0;
    letter-spacing: 0.01em;
}

.kph-search__input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.kph-search__results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 960;
    max-height: min(58vh, 360px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #ffffff;
    border: 1px solid #e2e5dc;
    border-radius: 0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    padding: 4px;
}

.kph-search__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.kph-search__item:hover,
.kph-search__item:focus-visible {
    background: #f3f6f0;
    outline: none;
}

.kph-search__thumb {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 0;
    object-fit: cover;
    background: #f1f5f0;
}

.kph-search__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.1rem;
}

.kph-search__meta {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kph-search__name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kph-search__price {
    font-size: 0.78rem;
    font-weight: 600;
    color: #166534;
}

.kph-search__empty,
.kph-search__hint {
    padding: 14px 12px;
    font-size: 0.88rem;
    color: #64748b;
    text-align: center;
}

/* ── Amazon-style top category strip (keeps bottom tab bar) ── */
.kph-cats {
    margin: 8px -2px 0;
    padding: 0;
    width: calc(100% + 4px);
    box-sizing: border-box;
}

.kph-cats__scroller {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 0 2px 2px;
}

.kph-cats__scroller::-webkit-scrollbar {
    display: none;
}

.kph-cats__list {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    width: max-content;
    min-width: 100%;
    padding: 4px 6px 0;
    box-sizing: border-box;
}

.kph-cats__item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 70px;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-decoration: none;
    color: #0f172a;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s ease;
}

.kph-cats__item:active {
    opacity: 0.85;
}

.kph-cats__item:focus-visible {
    outline: none;
}

.kph-cats__item:focus-visible .kph-cats__icon {
    outline: 2px solid #1d7232;
    outline-offset: 2px;
}

.kph-cats__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 49px;
    height: 49px;
    border-radius: 0;
    background: transparent;
    color: #166534;
    overflow: hidden;
    box-sizing: border-box;
    /* Transparent border keeps size stable when selected */
    border: 2px solid transparent;
}

.kph-cats__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kph-cats__item--photo .kph-cats__icon {
    background: transparent;
}

.kph-cats__item--contain .kph-cats__icon {
    background: #fffaf3;
    padding: 3px;
}

.kph-cats__item--contain .kph-cats__photo {
    object-fit: contain;
}

.kph-cats__icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kph-cats__item--fruits .kph-cats__icon {
    color: #be123c;
}

.kph-cats__item--grocery .kph-cats__icon {
    color: #4338ca;
}

.kph-cats__item--baskets .kph-cats__icon {
    color: #c2410c;
}

.kph-cats__item--baskets {
    width: auto;
    min-width: 76px;
    max-width: 96px;
}

.kph-cats__item--baskets .kph-cats__label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.12;
    max-width: 96px;
}

.kph-cats__item--farmers .kph-cats__icon {
    color: #15803d;
}

.kph-cats__item:not(.kph-cats__item--photo) .kph-cats__icon {
    background: rgba(15, 23, 42, 0.04);
}

.kph-cats__label {
    display: block;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #475569;
}

.kph-cats__item--active .kph-cats__icon,
.kph-cats__item[aria-current='page'] .kph-cats__icon {
    border-color: #1d7232;
}

.kph-cats__item--active .kph-cats__label,
.kph-cats__item[aria-current='page'] .kph-cats__label {
    color: #14532d;
    font-weight: 700;
}

.kph-hero__top--signin {
    justify-content: flex-end;
}

/* Keep the thin accent bar hidden when category row follows; text strip stays visible. */
header.kph:has(+ .kph-cats-row) .kph-delivery-strip--bar,
body:has(.kph-cats-row) header.kph .kph-delivery-strip--bar {
    display: none;
}

header.kph:has(+ .kph-cats-row) .kph-delivery-strip--msg,
body:has(.kph-cats-row) header.kph .kph-delivery-strip--msg {
    display: block;
}

@media (min-width: 480px) {
    .kph-cats__item {
        width: 76px;
    }

    .kph-cats__icon {
        width: 54px;
        height: 54px;
    }

    .kph-cats__label {
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kph-cats__item {
        transition: none;
    }
}
