/* Maava Storefront — mobile app shell polish */

@media (max-width: 767.98px) {
    :root {
        --maava-mobile-nav-height: 76px;
        --maava-mobile-nav-gap: 10px;
    }

    html {
        scroll-padding-bottom: calc(var(--maava-mobile-nav-height) + 24px);
    }

    body:has(.mobile-footer) {
        padding-bottom: calc(var(--maava-mobile-nav-height) + 28px + env(safe-area-inset-bottom));
    }

    .store-entrance,
    .rs-banner-showcase,
    .rs-offer-section,
    .smart-category-zone,
    .smart-best-sellers,
    .ai-new-arrivals,
    .most-viewed-section,
    .tech-popular,
    .article-latest,
    .partner {
        scroll-margin-bottom: calc(var(--maava-mobile-nav-height) + 24px);
    }

    .store-hero {
        padding-top: 7px !important;
    }

    .store-hero-container {
        width: calc(100% - 12px) !important;
        gap: 10px !important;
    }

    .store-main-window,
    .seller-pick {
        border-radius: 20px !important;
        box-shadow: 0 12px 34px rgba(0,0,0,.08) !important;
    }

    .storeHeroSwiper,
    .store-hero-slide {
        height: 330px !important;
    }

    .store-hero-content {
        right: 18px !important;
        bottom: 56px !important;
        width: calc(100% - 36px) !important;
    }

    .store-hero-content h2 {
        font-size: clamp(21px, 6vw, 27px) !important;
        line-height: 1.35 !important;
    }

    .store-hero-action {
        min-height: 36px;
        padding: 8px 12px !important;
    }

    .seller-product-image {
        background: #fafafa !important;
        box-shadow: inset 0 0 0 1px rgba(0,0,0,.025);
    }

    .seller-product-title,
    .smart-product-title,
    .ai-product-title,
    .mv-title {
        line-height: 1.75 !important;
    }

    .smart-category-zone {
        padding-bottom: 22px !important;
    }

    .smart-category-track {
        gap: 8px !important;
        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch;
    }

    .smart-category-card {
        box-shadow: 0 5px 18px rgba(0,0,0,.045) !important;
    }

    .smart-product-card,
    .ai-product-card,
    .mv-card,
    .tech-product-card {
        box-shadow: 0 7px 24px rgba(0,0,0,.06) !important;
    }

    .mobile-footer {
        position: fixed !important;
        z-index: 9990 !important;
        left: 10px !important;
        right: 10px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        height: var(--maava-mobile-nav-height) !important;
        margin: 0 !important;
        padding: 7px 6px !important;
        border: 1px solid rgba(15,23,42,.08) !important;
        border-radius: 22px !important;
        background: rgba(255,255,255,.94) !important;
        box-shadow: 0 16px 42px rgba(15,23,42,.16), 0 3px 12px rgba(15,23,42,.06) !important;
        backdrop-filter: blur(22px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
    }

    .mobile-footer .container {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        padding: 0 !important;
    }

    .mobile-footer .footer-menu,
    .mobile-footer .footer-menu ul {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: stretch !important;
        justify-content: space-around !important;
        gap: 3px !important;
        list-style: none !important;
    }

    .mobile-footer .menu-item {
        position: relative !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        padding: 5px 2px !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        transition: transform .2s ease, background .2s ease !important;
    }

    .mobile-footer .menu-item:active {
        transform: scale(.94) !important;
    }

    .mobile-footer .menu-item img {
        position: relative !important;
        z-index: 2 !important;
        width: 22px !important;
        height: 22px !important;
        object-fit: contain !important;
        margin: 0 !important;
        opacity: .72 !important;
        transition: transform .2s ease, opacity .2s ease !important;
    }

    .mobile-footer .menu-item span {
        position: relative !important;
        z-index: 2 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        color: #64748b !important;
        font-size: 8.5px !important;
        line-height: 1.35 !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    .mobile-footer .menu-item:first-child {
        background: rgba(15,23,42,.055) !important;
    }

    .mobile-footer .menu-item:first-child img {
        opacity: 1 !important;
        transform: translateY(-1px) scale(1.04) !important;
    }

    .mobile-footer .menu-item:first-child span {
        color: #111827 !important;
    }

    .mobile-footer .menu-link {
        position: absolute !important;
        inset: 0 !important;
        z-index: 10 !important;
        display: block !important;
    }

    .mobile-footer .menu-item:first-child::before {
        content: "";
        position: absolute;
        top: 3px;
        left: 50%;
        width: 20px;
        height: 3px;
        transform: translateX(-50%);
        border-radius: 99px;
        background: #111827;
        opacity: .9;
    }

    /* AI Sales — premium floating consultation button */
    .maava-ai-chat-fab {
        position: fixed !important;
        right: 14px !important;
        bottom: 67px !important;
        z-index: 10020 !important;
        min-height: 58px !important;
        padding: 5px 16px 5px 7px !important;
        gap: 10px !important;
        border: 1px solid rgba(22,131,255,.18) !important;
        border-radius: 20px !important;
        background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%) !important;
        color: #17324d !important;
        box-shadow: 0 14px 34px rgba(15,23,42,.18), 0 4px 12px rgba(22,131,255,.13) !important;
        backdrop-filter: blur(18px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        letter-spacing: -.1px !important;
        cursor: pointer !important;
        transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
    }

    .maava-ai-chat-fab::before {
        content: "";
        position: absolute;
        right: 7px;
        top: 7px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #20b26b;
        box-shadow: 0 0 0 3px rgba(32,178,107,.13);
    }

    .maava-ai-chat-fab::after {
        content: "پاسخ‌گویی آنلاین";
        position: absolute;
        right: 62px;
        bottom: 5px;
        color: #20a565;
        font-size: 8px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        pointer-events: none;
    }

    .maava-ai-chat-fab img {
        width: 46px !important;
        height: 46px !important;
        flex: 0 0 46px !important;
        border: 2px solid #e9f4ff !important;
        box-shadow: 0 4px 12px rgba(15,23,42,.10) !important;
    }

    .maava-ai-chat-fab span {
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        margin-top: -5px !important;
    }

    .maava-ai-chat-fab:hover {
        transform: translateY(-2px) !important;
        border-color: rgba(22,131,255,.32) !important;
        box-shadow: 0 18px 40px rgba(15,23,42,.21), 0 4px 14px rgba(22,131,255,.15) !important;
    }

    .maava-ai-chat-fab:active {
        transform: translateY(0) scale(.97) !important;
    }

    .telegram-popup1 {
        bottom: calc(var(--maava-mobile-nav-height) + 18px + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 390px) {
    :root {
        --maava-mobile-nav-height: 72px;
    }

    .mobile-footer {
        left: 7px !important;
        right: 7px !important;
        border-radius: 20px !important;
    }

    .mobile-footer .menu-item img {
        width: 20px !important;
        height: 20px !important;
    }

    .mobile-footer .menu-item span {
        font-size: 8px !important;
    }

    .maava-ai-chat-fab {
        right: 10px !important;
        bottom: 67px !important;
        min-height: 54px !important;
        padding-right: 13px !important;
    }

    .maava-ai-chat-fab img {
        width: 42px !important;
        height: 42px !important;
        flex-basis: 42px !important;
    }

    .maava-ai-chat-fab::after {
        right: 57px;
        bottom: 4px;
        font-size: 7px;
    }
}
