/**
 * Arogyasthal — Mobile App Experience
 * Native shopping-app layout for viewports ≤ 992px
 */
:root {
    --app-bottom-nav-h: 64px;
    --app-header-h: 68px;
    --app-sticky-action-h: 68px;
}

@media (max-width: 992px) {
    html {
        -webkit-text-size-adjust: 100%;
        overflow-x: hidden;
        overflow-y: visible;
        height: auto;
    }
    body.storefront-body.app-shell {
        padding-bottom: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100%;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pinch-zoom;
    }
    .app-main {
        min-height: calc(100vh - var(--app-header-h) - var(--app-bottom-nav-h));
        overflow: visible;
        touch-action: auto;
        position: relative;
        z-index: 1;
    }

    /* ── Compact sticky header ── */
    .site-promo-bar { display: none; }
    .main-header {
        position: sticky;
        top: 0;
        z-index: 1040;
        background: rgba(255, 255, 255, 0.94) !important;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--sf-border) !important;
        box-shadow: 0 1px 0 rgba(255,255,255,.9), 0 4px 20px rgba(10, 51, 36, 0.07) !important;
    }
    .header-container {
        height: var(--app-header-h);
        padding: 0 12px;
        gap: 6px;
    }
    .logo1 { flex: 1; min-width: 0; text-align: center; order: 2; }
    .logo1 .logo-full { display: none; }
    .logo1 .logo-compact {
        display: inline-block;
        max-height: 44px;
        max-width: 210px;
        height: 44px;
        margin: 0 auto;
        object-position: center;
    }
    .menu-toggle { order: 1; flex-shrink: 0; }
    .header-nav { display: none !important; }
    .header-search-form { display: none !important; }
    .header-actions {
        order: 3;
        gap: 4px;
    }
    .header-actions .icon-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
    .search-toggle-btn { display: inline-flex !important; }
    .user-dropdown .dropdown-menu {
        position: fixed;
        top: calc(var(--app-header-h) + 8px);
        right: 12px;
        left: auto;
        min-width: 200px;
    }

    /* ── Bottom navigation ── */
    .app-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        height: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--sf-border);
        box-shadow: 0 -4px 24px rgba(10, 51, 36, 0.08);
    }
    .app-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: var(--app-bottom-nav-h);
        padding: 6px 4px;
        color: var(--sf-text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: .02em;
        transition: color var(--sf-transition), transform var(--sf-transition);
        -webkit-tap-highlight-color: transparent;
    }
    .app-nav-item i { font-size: 20px; line-height: 1; transition: transform var(--sf-transition); }
    .app-nav-item.active {
        color: var(--sf-green-700);
    }
    .app-nav-item.active i {
        transform: scale(1.08);
        color: var(--sf-green-600);
    }

    /* ── Mobile menu ── */
    .mobile-menu:not(.active) {
        pointer-events: none !important;
        visibility: hidden !important;
        clip-path: inset(0 100% 0 0) !important;
    }
    .mobile-menu-overlay:not(.active) {
        display: none !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }
    .mobile-menu {
        width: min(320px, 92vw);
        padding-bottom: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 16px));
        transform: none !important;
        left: calc(-1 * min(320px, 92vw));
        right: auto;
        transition: left .3s ease, visibility .3s;
    }
    .mobile-menu.active {
        left: 0;
        transform: none !important;
        visibility: visible !important;
        clip-path: none !important;
        pointer-events: auto !important;
    }
    .mobile-menu-overlay { z-index: 1060; }
    .mobile-menu { z-index: 1070; }
    body.menu-open .app-bottom-nav { display: none; }

    /* ── Search overlay ── */
    .search-box:not(.active) {
        display: none !important;
        pointer-events: none !important;
    }
    .search-box {
        top: calc(var(--app-header-h) + 6px);
        left: 12px;
        right: 12px;
        z-index: 1045;
    }

    /* ── Footer compact ── */
    .site-footer { margin-bottom: 0; }
    .footer-container { padding: 36px 16px 28px; gap: 24px; }
    .floating-whatsapp {
        bottom: calc(var(--app-bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    .store-chat {
        left: 12px;
        bottom: calc(var(--app-bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
        z-index: 1040;
    }
    .store-chat-toggle {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        font-size: 20px;
    }
    .store-chat-toggle span { display: none; }
    .store-chat-panel {
        left: 0;
        bottom: 58px;
        width: min(calc(100vw - 24px), 340px);
        max-height: min(62vh, 420px);
    }
    body.has-sticky-actions .store-chat,
    body.has-sticky-actions .floating-whatsapp {
        bottom: calc(var(--app-bottom-nav-h) + var(--app-sticky-action-h) + 12px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Home hero ── */
    .hero-section .carousel,
    .hero-section .carousel-inner,
    .hero-section .carousel-item {
        height: min(220px, 42vw) !important;
        max-height: 220px !important;
    }
    .hero-section .carousel-item img {
        height: min(220px, 42vw) !important;
        object-fit: cover;
    }
    .hero-section .carousel-indicators { margin-bottom: 6px; }
    .hero-section .carousel-indicators button {
        width: 8px;
        height: 8px;
        border-radius: 50%;
    }

    /* ── Home sections — app-style spacing ── */
    .home-section,
    .product-grid-section,
    .benefits-section,
    .shop-category-section,
    .reviews-faq,
    .home-offer-section,
    .home-cta {
        padding-left: 0;
        padding-right: 0;
    }
    .section-title {
        font-size: clamp(1.25rem, 4.5vw, 1.5rem);
        padding: 0 16px;
    }
    .section-subtitle {
        font-size: 13px;
        padding: 0 16px;
        margin-bottom: 16px;
    }
    .product-grid-section.container-fluid,
    .home-section.container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .product-grid-section .section-title,
    .product-grid-section .view-all-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Horizontal swipe rows — allow vertical page scroll through these areas */
    .product-grid1,
    .benefits-grid,
    .promo-cards-row .row,
    .shop-category-section .row.g-4 > .col-lg-6:last-child .row,
    .slider-wrapper .slider-track,
    .review-slider .review-track,
    .mobile-shop-tags,
    .product-gallery-thumbs {
        touch-action: pan-x pan-y;
        -webkit-overflow-scrolling: touch;
    }

    /* Hero carousel must not block vertical page scroll */
    .hero-section,
    .hero-section .carousel,
    .hero-section .carousel-inner,
    .hero-section .carousel-item {
        touch-action: pan-y pinch-zoom;
    }

    /* Horizontal swipe rows */
    .product-grid1 {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding: 0 16px 8px;
        grid-template-columns: unset !important;
        scrollbar-width: none;
    }
    .product-grid1::-webkit-scrollbar { display: none; }
    .product-grid1 .product-card {
        flex: 0 0 min(78vw, 280px);
        scroll-snap-align: start;
        min-height: 160px;
    }

    .shop-category-section .row.g-4 > .col-lg-6:last-child .row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        margin: 0;
        padding: 0 16px 8px;
        scrollbar-width: none;
    }
    .shop-category-section .row.g-4 > .col-lg-6:last-child .row::-webkit-scrollbar { display: none; }
    .shop-category-section .row.g-4 > .col-lg-6:last-child .row > [class*="col-"] {
        flex: 0 0 min(72vw, 260px);
        scroll-snap-align: start;
        max-width: none;
        padding: 0;
    }

    .promo-cards-row .row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        margin: 0;
        padding: 0 16px 8px;
        scrollbar-width: none;
    }
    .promo-cards-row .row::-webkit-scrollbar { display: none; }
    .promo-cards-row .col-md-4 {
        flex: 0 0 min(85vw, 300px);
        scroll-snap-align: start;
        max-width: none;
    }

    .slider-wrapper .slider-track,
    .review-slider .review-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .slider-wrapper .slider-track::-webkit-scrollbar,
    .review-slider .review-track::-webkit-scrollbar { display: none; }
    .video-card { flex: 0 0 min(78vw, 280px) !important; scroll-snap-align: start; }
    .review-card { flex: 0 0 min(88vw, 340px) !important; scroll-snap-align: start; }

    .benefits-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding: 0 16px 8px;
        scrollbar-width: none;
    }
    .benefits-grid::-webkit-scrollbar { display: none; }
    .benefit-card {
        flex: 0 0 min(72vw, 240px);
        scroll-snap-align: start;
    }

    /* ── Product grid — 2 columns ── */
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
        padding: 0 12px;
    }
    .product-card1 {
        padding: 10px;
        border-radius: 12px;
        border-color: var(--sf-border);
        box-shadow: var(--sf-shadow);
    }
    .product-card1:hover { transform: none; }
    .product-img-frame { aspect-ratio: 1; border-radius: 10px; }
    .product-img-frame > a { padding: 8px; }
    .product-img-frame.has-product-bg > a { padding: 10%; }
    .product-title1 {
        font-size: 12px;
        -webkit-line-clamp: 2;
        line-height: 1.35;
    }
    .current-price { font-size: 14px !important; }
    .original-price, .discount-percent { font-size: 10px; }
    .rating { font-size: 11px; }
    .product-card-actions { gap: 6px; }
    .product-card-actions .btn-wishlist,
    .product-card-actions .btn-whatsapp {
        min-height: 36px;
        font-size: 14px;
    }
    .product-card-buttons { gap: 6px; }
    .product-button1,
    .btn-buy-now {
        font-size: 11px;
        padding: 8px 6px;
        min-height: 36px;
    }

    /* ── Shop page ── */
    .page-banner {
        min-height: 100px;
        padding: 28px 16px;
    }
    .shop-layout {
        padding: 0 0 24px;
        gap: 0;
    }
    .mobile-shop-toolbar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--sf-border);
        position: sticky;
        top: var(--app-header-h);
        z-index: 100;
    }
    .mobile-shop-toolbar .mobile-filter-btn,
    .mobile-shop-toolbar .mobile-tag-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 14px;
        border-radius: 999px;
        border: 1px solid var(--sf-border);
        background: var(--sf-white);
        font-size: 13px;
        font-weight: 600;
        color: var(--sf-text);
        text-decoration: none;
        white-space: nowrap;
        cursor: pointer;
        transition: background var(--sf-transition), border-color var(--sf-transition), color var(--sf-transition), box-shadow var(--sf-transition);
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-shop-toolbar .mobile-filter-btn:active,
    .mobile-shop-toolbar .mobile-tag-chip:active {
        transform: scale(0.98);
    }
    .mobile-shop-toolbar .mobile-filter-btn i { color: var(--sf-green-700); }
    .mobile-shop-tags {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        flex: 1;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-shop-tags::-webkit-scrollbar { display: none; }
    .mobile-tag-chip.active {
        background: var(--sf-gradient-brand);
        color: var(--sf-white);
        border-color: transparent;
        box-shadow: 0 2px 10px rgba(10, 51, 36, 0.16);
    }
    .shop-content {
        padding: 16px 0 0;
    }
    .shop-content .section-title {
        font-size: 1.2rem;
        padding: 0 16px;
        text-align: left !important;
    }
    .shop-content > .text-muted { padding: 0 16px; font-size: 13px; }
    .shop-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
        top: auto;
        max-height: min(72vh, 520px);
        z-index: 1080;
        border-radius: 16px 16px 0 0;
        transform: translateY(110%);
        transition: transform .28s ease;
        overflow-y: auto;
        box-shadow: 0 -8px 40px rgba(12, 61, 42, .18);
        padding: 20px 16px 24px;
        pointer-events: none;
    }
    body.shop-filters-open .shop-sidebar { transform: translateY(0); }
    body.shop-filters-open .shop-sidebar { pointer-events: auto; }
    .shop-filter-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(12, 61, 42, .45);
        z-index: 1075;
        pointer-events: none;
    }
    body.shop-filters-open .shop-filter-overlay {
        display: block;
        pointer-events: auto;
    }
    .shop-sidebar-handle {
        display: block;
        width: 40px;
        height: 4px;
        background: var(--sf-cream-dark);
        border-radius: 999px;
        margin: 0 auto 16px;
    }

    /* ── Product detail ── */
    .product-detail-page {
        padding: 12px 16px calc(var(--app-bottom-nav-h) + var(--app-sticky-action-h) + 24px);
    }
    .product-detail-page .breadcrumb { font-size: 12px; margin-bottom: 12px !important; }
    .product-gallery-wrap { margin-bottom: 16px; }
    .product-detail-main {
        aspect-ratio: 1;
        max-height: none;
        border-radius: 14px;
        touch-action: pan-y pinch-zoom;
    }
    .product-detail-main img { object-fit: contain; max-height: 100%; }
    .product-gallery-thumbs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 10px 0 4px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .product-gallery-thumbs::-webkit-scrollbar { display: none; }
    .product-gallery-thumb {
        flex: 0 0 64px;
        scroll-snap-align: start;
    }
    .pdp-info h1 {
        font-size: clamp(1.2rem, 4.5vw, 1.45rem);
        line-height: 1.35;
    }
    .pdp-price-box {
        background: var(--sf-green-50);
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 12px;
    }
    .pdp-buy-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .pdp-info .pdp-buy-row { display: none; }
    .mobile-page-head {
        padding: 16px 16px 8px;
    }
    .mobile-page-head h1 {
        font-family: var(--sf-display);
        font-size: 1.35rem;
        margin: 0 0 4px;
        color: var(--sf-green-900);
    }
    .mobile-page-head p {
        margin: 0;
        font-size: 13px;
        color: var(--sf-text-muted);
    }
    .pdp-sticky-bar {
        display: flex !important;
        bottom: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
        z-index: 1045;
        padding: 10px 12px;
        gap: 10px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--sf-border);
    }
    .pdp-sticky-bar .product-button1,
    .pdp-sticky-bar .btn-buy-now {
        flex: 1;
        min-height: 46px;
        font-size: 13px;
    }

    /* ── Cart — app cards ── */
    .cart-page { padding: 16px 16px calc(var(--app-bottom-nav-h) + var(--app-sticky-action-h) + 24px); }
    .cart-page-title { font-size: 1.35rem; margin-bottom: 16px; }
    .cart-layout { gap: 16px; }
    .cart-items-card .table-responsive { display: none; }
    .cart-mobile-list { display: flex; flex-direction: column; gap: 12px; }
    .cart-mobile-item {
        display: flex;
        gap: 12px;
        padding: 14px;
        background: var(--sf-white);
        border: 1px solid var(--sf-border);
        border-radius: 14px;
        box-shadow: var(--sf-shadow);
    }
    .cart-mobile-item img {
        width: 72px;
        height: 72px;
        object-fit: contain;
        object-position: center;
        border-radius: 10px;
        background: var(--sf-cream);
        flex-shrink: 0;
    }
    .cart-mobile-item img.has-product-bg {
        background-color: #f4efe4;
        background-image: var(--product-stage-bg);
        background-size: cover;
        background-position: center;
    }
    .cart-mobile-item-body { flex: 1; min-width: 0; }
    .cart-mobile-item-body strong {
        display: block;
        font-size: 14px;
        line-height: 1.35;
        margin-bottom: 6px;
        overflow-wrap: anywhere;
    }
    .cart-mobile-item-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .cart-summary-card {
        border-radius: 14px;
        padding: 20px;
    }
    .cart-summary-row.total {
        font-size: 1.15rem;
        background: var(--sf-green-50);
        margin: 8px -12px 0;
        padding: 12px;
        border-radius: 10px;
    }
    .mobile-sticky-bar {
        display: flex !important;
        bottom: calc(var(--app-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
        z-index: 1045;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--sf-border);
    }

    /* ── Checkout ── */
    .checkout-page,
    .payment-page {
        padding: 16px 16px calc(var(--app-bottom-nav-h) + 24px);
    }
    .checkout-steps {
        gap: 6px;
        margin-bottom: 20px;
    }
    .checkout-step {
        padding: 8px 12px;
        font-size: 11px;
    }
    .checkout-step i { font-size: 12px; }
    .checkout-form-card,
    .checkout-summary-card,
    .payment-card {
        padding: 18px;
        border-radius: 14px;
        margin-bottom: 16px;
    }
    .checkout-form-card .form-control,
    .checkout-form-card .form-select,
    .auth-card .form-control {
        min-height: 48px;
        font-size: 16px;
    }
    .payment-option {
        padding: 14px;
        border-radius: 12px;
    }
    .btn-place-order {
        width: 100%;
        min-height: 52px;
        font-size: 16px;
        border-radius: 12px;
    }
    .payment-qr-wrap {
        padding: 16px;
        border-radius: 12px;
        background: var(--sf-cream);
    }
    .payment-qr-img {
        max-width: min(260px, 80vw);
        width: 100%;
        height: auto;
        margin: 0 auto;
        display: block;
    }
    .payment-receipt-preview {
        max-height: 280px;
        object-fit: contain;
    }

    /* ── Account / Auth ── */
    .account-page { padding: 16px 16px calc(var(--app-bottom-nav-h) + 24px); }
    .account-page .col-lg-4 { display: none; }
    .account-page .col-lg-8 { width: 100%; }
    .order-card {
        border-radius: 14px !important;
        margin-bottom: 12px !important;
    }
    .order-card .card-body { padding: 16px !important; }
    .order-card h5 { font-size: 1rem; }
    .order-card .badge { font-size: 10px; }
    .auth-page {
        min-height: calc(100vh - var(--app-header-h) - var(--app-bottom-nav-h) - 40px);
        padding: 16px 16px calc(var(--app-bottom-nav-h) + 16px);
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }
    .auth-card {
        width: 100%;
        max-width: 420px;
        padding: 24px 20px;
        border-radius: 16px;
    }
    .auth-card .form-control { min-height: 48px; font-size: 16px; }
    .btn-auth { min-height: 50px; font-size: 16px; width: 100%; }
    .btn-google { min-height: 50px; font-size: 16px; }
    .auth-page--split { padding: 12px 12px calc(var(--app-bottom-nav-h) + 12px); }
    .auth-shell { border-radius: 18px; }
    .auth-welcome { order: 2; padding: 22px 20px 18px; }
    .auth-welcome-title { font-size: 1.28rem; }
    .auth-welcome-lead { font-size: 13px; margin-bottom: 12px; }
    .auth-perks { gap: 8px; }
    .auth-perks li { font-size: 13px; }
    .auth-page--split .auth-card { order: 1; padding: 22px 18px 26px; }

    /* ── About / Policy pages ── */
    .page-hero { padding: 36px 16px 32px; }
    .page-hero-title { font-size: 1.5rem; }
    .about-quick-nav { top: var(--app-header-h); }
    .about-section { padding: 40px 16px; }
    .about-intro { padding: 32px 16px; }
    .policy-page { padding: 24px 0 32px; }
    .policy-layout { padding: 0 12px; }
    .policy-sidebar { display: none; }
    .policy-main { min-width: 0; }
    .policy-content-card { padding: 18px; border-radius: 14px; }

    /* ── Wishlist ── */
    .wishlist-page { padding: 16px 16px calc(var(--app-bottom-nav-h) + 24px); }

    /* ── Alerts ── */
    .store-alert { margin: 12px 16px !important; font-size: 14px; }
}

@media (min-width: 993px) {
    .mobile-shop-toolbar,
    .shop-filter-overlay,
    .shop-sidebar-handle,
    .cart-mobile-list { display: none !important; }
}

@media (max-width: 992px) {
    .cart-mobile-list { display: flex; }
}

/* Fine-tune small phones */
@media (max-width: 430px) {
    .product-grid { gap: 8px; padding: 0 10px; }
    .product-card1 { padding: 8px; }
    .app-nav-item { font-size: 9px; }
    .app-nav-item i { font-size: 18px; }
}

@media (max-width: 360px) {
    .header-actions .icon-btn { width: 34px; height: 34px; }
    .logo1 .logo-compact { max-width: 160px; height: 40px; max-height: 40px; }
}
