/* PWA & native-like mobile shell */
:root {
    --pwa-theme: #3D3834;
    --pwa-tab-height: 64px;
    --pwa-header-height: 60px;
    --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
    --pwa-safe-top: env(safe-area-inset-top, 0px);
}

html.pwa-standalone,
body.pwa-standalone {
    overscroll-behavior-y: contain;
}

body {
    -webkit-tap-highlight-color: transparent;
}

/* Mobile app header */
.pwa-app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: calc(var(--pwa-header-height) + var(--pwa-safe-top));
    padding-top: var(--pwa-safe-top);
    background: linear-gradient(165deg, #423C37 0%, #35312D 100%);
    color: #FAF8F5;
    box-shadow: 0 2px 12px rgba(61, 56, 52, 0.18);
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
}

.pwa-app-header .btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pwa-app-header .brand-logo {
    height: 48px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.pwa-cart-badge {
    position: absolute;
    top: -4px;
    inset-inline-start: -4px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    line-height: 18px;
    padding: 0 4px;
}

/* Bottom tab bar */
.pwa-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: calc(var(--pwa-tab-height) + var(--pwa-safe-bottom));
    padding-bottom: var(--pwa-safe-bottom);
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.pwa-tabbar .tab-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: #6c757d;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 2px 0;
    position: relative;
    min-width: 0;
}

.pwa-tabbar .tab-link i {
    font-size: 20px;
}

.pwa-tabbar .tab-link.active {
    color: var(--pwa-theme);
}

.pwa-tabbar .tab-badge {
    position: absolute;
    top: 2px;
    inset-inline-start: calc(50% + 8px);
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    line-height: 16px;
    padding: 0 4px;
}

/* Content spacing on mobile */
@media (max-width: 991.98px) {
    .store-main {
        padding-bottom: calc(var(--pwa-tab-height) + var(--pwa-safe-bottom) + 52px);
    }

    .pwa-hide-mobile {
        display: none !important;
    }

    .pwa-mobile-search {
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
}

@media (min-width: 992px) {
    .pwa-show-mobile-only {
        display: none !important;
    }
}

.pwa-standalone .pwa-hide-standalone {
    display: none !important;
}

/* Install banners */
.pwa-install-banner,
.pwa-ios-hint {
    border-radius: 14px;
    border: 1px solid rgba(242, 139, 0, 0.25);
    background: linear-gradient(135deg, #fff8ef 0%, #fff 100%);
}

.pwa-drawer .offcanvas-header {
    background: var(--pwa-theme);
    color: #fff;
}

.pwa-drawer .list-group-item {
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 14px 16px;
}

.pwa-drawer .list-group-item i {
    width: 22px;
    color: var(--pwa-theme);
}

/* Auth quick buttons */
.auth-quick-stack .btn {
    border-radius: 12px;
}

.auth-quick-inline .btn,
.auth-quick-inline a {
    border-radius: 999px;
    font-size: 13px;
}

/* Desktop PWA install chip */
.pwa-desktop-install {
    border-radius: 999px;
    font-size: 13px;
}

/* Offline page */
.pwa-offline-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Smooth page feel */
.store-main {
    min-height: 50vh;
}

/* Category bar under main nav */
.store-categories-bar {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.store-categories-bar--desktop {
    box-shadow: inset 0 4px 8px -6px rgba(0, 0, 0, 0.08);
}

.store-categories-bar--mobile {
    background: #fafafa;
}

.store-categories-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 2px;
}

.store-categories-scroll::-webkit-scrollbar {
    display: none;
}

.store-categories-bar--desktop .store-categories-scroll {
    flex-wrap: wrap;
    overflow-x: visible;
}

.store-category-chip {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
    .pwa-tabbar .tab-link,
    .pwa-app-header .btn-icon {
        transition: transform 0.15s ease, background 0.15s ease;
    }

    .pwa-tabbar .tab-link:active,
    .pwa-app-header .btn-icon:active {
        transform: scale(0.94);
    }
}
