/* Customer mobile shell only. Desktop styles and dimensions remain untouched. */
.kg-mobile-topbar, .kg-mobile-bottom, .kg-mobile-help { display: none; }
@media (max-width: 767px) {
    body.kg-customer { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
    .kg-customer .kg-desktop-header, .kg-customer .kg-announcement { display: none; }
    /* Keep the bar in normal flow: scrolling slides it out while the navbar sticks at top: 0.
       Do not collapse its height, which would change scrollY and cause threshold jitter. */
    .kg-customer .kg-announcement.kg-announcement-home { display: block; opacity: var(--announcement-opacity, 1); transition: opacity 100ms linear; }
    .kg-mobile-topbar { display: block; position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid #e5e7eb; color: #171717; }
    .kg-mobile-topbar-row { display: flex; align-items: center; gap: 2px; padding: 6px 8px; min-height: 58px; }
    .kg-mobile-brand { font-size: 17px; font-weight: 800; letter-spacing: -.6px; white-space: nowrap; }
    .kg-mobile-brand span { color: #4f46e5; }
    .kg-mobile-actions { display: flex; align-items: center; margin-left: auto; }
    .kg-mobile-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; font-size: 19px; }
    .kg-mobile-topbar .kg-mobile-notification-trigger { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: inherit; box-shadow: none; }
    .kg-mobile-topbar .kg-mobile-notification-badge,
    .kg-customer :is(.kg-mobile-topbar, .kg-product-header) .kg-mobile-cart-badge { position: absolute; top: 2px; right: 0; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 9999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
    /* Anchor the panel horizontally to the viewport, not the Bell's narrow wrapper.
       Auto top keeps its existing vertical placement beneath the trigger. */
    .kg-mobile-topbar .kg-notification-menu { position: fixed; left: auto; right: 12px; width: 24rem; min-width: 0; max-width: calc(100vw - 24px); }
    .kg-mobile-topbar .kg-notification-menu .min-w-0 { overflow-wrap: anywhere; }
    .kg-mobile-login { min-height: 44px; padding: 0 12px; font-size: 13px; font-weight: 700; color: #4f46e5; }
    .kg-mobile-nav-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex-shrink: 0; }
    .kg-mobile-bottom .kg-mobile-badge { position: absolute; top: -4px; left: calc(100% - 2px); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 9999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .kg-mobile-search { display: flex; margin: 0 12px 10px; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
    .kg-mobile-search input { width: 100%; min-width: 0; padding: 10px 12px; background: transparent; font-size: 16px; }
    .kg-mobile-search button { width: 44px; flex-shrink: 0; color: #4f46e5; }
    .kg-mobile-bottom { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 40; padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #e5e7eb; background: #fff; box-shadow: 0 -4px 20px #00000006; }
    .kg-mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 56px; border-radius: 12px; color: #737373; font-size: 10px; font-weight: 600; line-height: 14px; white-space: nowrap; }
    .kg-mobile-nav-item i { font-size: 19px; }
    .kg-mobile-nav-item.is-active { background: #eef2ff; color: #4f46e5; cursor: default; }
    .kg-mobile-help { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; position: fixed; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 39; width: 58px; height: 58px; border: 1px solid #e0e7ff; border-radius: 18px; background: #fff; color: #4f46e5; box-shadow: 0 4px 16px #00000012; font-size: 10px; font-weight: 600; }
    .kg-mobile-help i { font-size: 21px; }
    .kg-mobile-notifications { position: absolute; top: 58px; right: 8px; width: min(320px, calc(100vw - 16px)); max-height: 60dvh; overflow: auto; padding: 12px; border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; box-shadow: 0 12px 32px #00000018; }
    .kg-mobile-notification-title { display: flex; align-items: center; justify-content: space-between; }
    .kg-mobile-notifications p { padding: 12px 4px; font-size: 13px; color: #737373; }
    .kg-customer .kg-auth-backdrop, .kg-customer .kg-auth-modal { z-index: 90; }
    .kg-customer .lk-chat > button { display: none; }
    .kg-customer .lk-chat { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); right: 8px; }
    .kg-customer .lk-chat-panel, .kg-customer .lk-chat-panel.compact { width: calc(100vw - 16px); max-height: calc(100dvh - 150px - env(safe-area-inset-bottom, 0px)); }
    .kg-mobile-topbar button:focus-visible, .kg-mobile-topbar a:focus-visible, .kg-mobile-bottom :focus-visible, .kg-mobile-help:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
    .dark .kg-mobile-topbar, .dark .kg-mobile-bottom, .dark .kg-mobile-help, .dark .kg-mobile-notifications { background: #171717; border-color: #404040; color: #f5f5f5; }
    .dark .kg-mobile-nav-item { color: #a3a3a3; }
    .dark .kg-mobile-nav-item.is-active { background: #312e81; color: #e0e7ff; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .kg-customer .kg-announcement.kg-announcement-home { transition: none; }
}
