/* ==========================================================================
   MyChoice.uz — Native iPhone App Mobile Experience
   Apple-level mobile UX · max-width: 1024px
   ========================================================================== */

@media (max-width: 1024px) {
    :root {
        --mc-app-header: 52px;
        --mc-app-bottom: 64px;
        --mc-app-radius: 16px;
        --mc-app-touch: 48px;
    }

    html.is-mobile {
        scroll-behavior: smooth;
    }

    body.mc-redesign.has-mobile-bottom-nav {
        padding-bottom: calc(var(--mc-app-bottom) + env(safe-area-inset-bottom, 0px));
        -webkit-overflow-scrolling: touch;
    }

    /* ── Compact header ── */
    .mc-header.site-header {
        height: var(--mc-app-header);
        background: rgba(255, 255, 255, 0.92);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }

    .mc-header__grid {
        height: var(--mc-app-header);
        padding: 0 16px;
        gap: 8px;
    }

    .mc-logo__text,
    .logo-text {
        font-size: 17px;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

    .mc-actions__icons .mc-icon-btn--track {
        display: none;
    }

    .mc-header__tg {
        display: none;
    }

    .mc-burger {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.04);
    }

    /* Hide heavy pre-hero block — hero shows offer immediately */
    .mc-top-scroll {
        display: none !important;
    }

    main {
        padding-top: var(--mc-app-header) !important;
    }

    /* ── Mobile nav sheet (native feel) ── */
    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 240;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .mobile-nav-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(88vw, 320px);
        z-index: 250;
        background: #fff;
        transform: translateX(-105%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.12);
        padding: calc(var(--mc-app-header) + 12px) 20px 24px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav.active {
        transform: translateX(0);
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .mobile-link {
        display: flex;
        align-items: center;
        min-height: var(--mc-app-touch);
        padding: 0 14px;
        font-size: 16px;
        font-weight: 600;
        color: var(--mc-text);
        border-radius: 12px;
        transition: background 0.2s ease;
    }

    .mobile-link:active {
        background: rgba(0, 0, 0, 0.06);
        transform: scale(0.98);
    }

    .mobile-nav-links .btn-primary {
        margin-top: 16px;
        min-height: 52px;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 700;
    }

    body.mobile-nav-open {
        overflow: hidden;
        touch-action: none;
    }

    /* ── Hero: offer + CTAs first ── */
    .hero-v2 {
        padding: 16px 0 28px;
        min-height: auto;
    }

    .hero-v2__grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .hero-v2__visual {
        order: -1;
    }

    .hero-v2__phone {
        max-height: 220px;
        width: auto;
        margin: 0 auto;
        display: block;
        filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.12));
    }

    .hero-v2__content {
        text-align: left;
    }

    .hero-v2 .mc-section-label {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .hero-v2 .mc-display {
        font-size: clamp(1.65rem, 6.5vw, 2rem);
        line-height: 1.12;
        letter-spacing: -0.035em;
    }

    .hero-v2__subhead {
        font-size: 15px;
        line-height: 1.55;
        margin-top: 10px;
        color: var(--mc-text-secondary);
    }

    .hero-v2__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 20px;
    }

    .hero-v2__actions .mc-btn {
        min-height: 52px;
        padding: 14px 16px;
        font-size: 15px;
        font-weight: 700;
        border-radius: 14px;
        justify-content: center;
    }

    .hero-v2__actions .mc-btn:active {
        transform: scale(0.97);
    }

    .btn-card-nasiya {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Compact benefit chips under CTAs */
    .hero-v2__chips {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin-top: 16px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .hero-v2__chips::-webkit-scrollbar {
        display: none;
    }

    .hero-chip {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        font-size: 11px;
        font-weight: 600;
        color: var(--mc-text-secondary);
        background: rgba(0, 0, 0, 0.04);
        border-radius: 100px;
        white-space: nowrap;
    }

    .hero-chip svg {
        color: var(--mc-success);
        flex-shrink: 0;
    }

    .trust-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 20px;
    }

    .trust-stat {
        padding: 12px 6px;
        border-radius: 12px;
    }

    .trust-stat__num {
        font-size: 1.1rem;
    }

    .trust-stat__label {
        font-size: 10px;
        margin-top: 4px;
    }

    /* ── Section rhythm ── */
    .mc-section {
        padding: 40px 0;
    }

    .mc-section-header {
        text-align: left;
        margin-bottom: 20px;
    }

    .mc-headline {
        font-size: clamp(1.35rem, 5vw, 1.65rem);
    }

    .mc-subhead {
        font-size: 14px;
        margin-top: 6px;
    }

    /* ── Horizontal swipe rails ── */
    .mc-hscroll {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 4px 0 12px;
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        scrollbar-width: none;
    }

    .mc-hscroll::-webkit-scrollbar {
        display: none;
    }

    .mc-hscroll > * {
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    .bestsellers-grid.mc-hscroll .bs-card {
        width: min(78vw, 300px);
    }

    .why-grid.mc-hscroll .why-card {
        width: min(72vw, 260px);
        min-height: 160px;
    }

    .services-grid.mc-hscroll .service-card {
        width: min(80vw, 300px);
    }

  .stories-grid.mc-hscroll .story-card {
        width: min(85vw, 320px);
    }

    /* ── Premium product cards (catalog) ── */
    #catalog .catalog-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    #catalog .product-card {
        border-radius: var(--mc-app-radius);
        overflow: hidden;
        border: 1px solid var(--mc-border);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
        padding: 0;
        display: grid;
        grid-template-columns: 120px 1fr;
        grid-template-rows: auto auto;
        gap: 0;
        min-height: 140px;
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    #catalog .product-card:active {
        transform: scale(0.985);
    }

    #catalog .product-badge,
    #catalog .btn-compare-toggle {
        z-index: 2;
    }

    #catalog .product-badge {
        top: 8px;
        left: 8px;
        font-size: 10px;
        padding: 4px 8px;
    }

    #catalog .btn-compare-toggle {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    #catalog .product-image-wrap {
        grid-row: 1 / 3;
        height: 140px;
        min-height: 140px;
        background: linear-gradient(180deg, #f8f8fa 0%, #f0f0f2 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
    }

    #catalog .product-img {
        max-height: 116px;
        width: auto;
        object-fit: contain;
    }

    #catalog .product-info {
        padding: 12px 14px 12px 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        min-width: 0;
    }

    #catalog .product-title {
        font-size: 15px;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: -0.02em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #catalog .product-page-link {
        display: none;
    }

    #catalog .product-specs {
        display: none;
    }

    #catalog .product-pricing {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-top: 4px;
    }

    #catalog .price-nasiya {
        display: none;
    }

    #catalog .price-nasiya-num {
        font-size: 17px;
        font-weight: 800;
        color: var(--mc-accent);
        letter-spacing: -0.02em;
    }

    #catalog .price-nasiya-num::before {
        content: "Nasiya ";
        font-size: 11px;
        font-weight: 600;
        color: var(--mc-text-muted);
    }

    #catalog .price-cash {
        font-size: 12px;
        color: var(--mc-text-secondary);
    }

    #catalog .product-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 0 12px 12px;
        margin: 0;
    }

    #catalog .product-actions .btn-quick-buy {
        display: none;
    }

    #catalog .product-actions .btn-card-calc {
        display: none;
    }

    #catalog .product-actions .btn-card-buy,
    #catalog .product-actions .btn-card-nasiya {
        min-height: 44px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 700;
    }

    #catalog .product-actions .btn-card-nasiya {
        background: rgba(0, 0, 0, 0.05);
        color: var(--mc-text);
        border: 1px solid var(--mc-border);
    }

    /* Bestseller cards mobile */
    .bs-card {
        border-radius: var(--mc-app-radius);
        overflow: hidden;
    }

    .bs-card__img-wrap {
        height: 200px;
    }

    .bs-card__monthly {
        font-size: 18px;
        font-weight: 800;
        color: var(--mc-accent);
    }

    .bs-card__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .bs-card__actions .bs-card__detail {
        display: none;
    }

    .bs-card__actions .mc-btn {
        min-height: 44px;
        font-size: 13px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    /* ── Live activity compact ── */
    .live-activity__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 0 4px;
    }

    .live-activity__counters {
        width: 100%;
        justify-content: flex-start;
    }

    /* ── Reviews: native swipe ── */
    .reviews-carousel-wrapper {
        margin: 0 -20px;
        padding: 0 20px;
    }

    .reviews-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        transform: none !important;
        scrollbar-width: none;
    }

    .reviews-track::-webkit-scrollbar {
        display: none;
    }

    .review-card {
        scroll-snap-align: center;
        min-width: min(88vw, 340px) !important;
        max-width: min(88vw, 340px) !important;
        border-radius: var(--mc-app-radius);
        padding: 24px;
    }

    .reviews-nav {
        margin-top: 16px;
    }

    /* ── Product drawer → bottom sheet ── */
    .drawer-overlay {
        align-items: flex-end;
        justify-content: center;
    }

    .drawer-window {
        max-width: 100%;
        height: min(92vh, 720px);
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
        border-left: none;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    }

    .drawer-overlay.active .drawer-window {
        transform: translateY(0);
    }

    .drawer-window::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 4px;
        margin: 0 auto 16px;
    }

    .drawer-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .drawer-left-col {
        position: static;
    }

    .drawer-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.06);
        border-radius: 50%;
        font-size: 24px;
    }

    /* ── Premium bottom action bar ── */
    .mobile-bottom-nav {
        display: flex;
        align-items: stretch;
        gap: 6px;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.94);
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        backdrop-filter: saturate(180%) blur(24px);
        -webkit-backdrop-filter: saturate(180%) blur(24px);
        box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04), 0 -12px 40px rgba(0, 0, 0, 0.08);
    }

    .mbn-item {
        flex: 1;
        flex-direction: column;
        gap: 4px;
        min-height: 52px;
        padding: 8px 4px;
        border-radius: 14px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: -0.01em;
        color: var(--mc-text-secondary);
        transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
    }

    .mbn-item:active {
        transform: scale(0.94);
    }

    .mbn-item svg {
        width: 22px;
        height: 22px;
        opacity: 1;
    }

    .mbn-item--nasiya {
        background: #000;
        color: #fff;
    }

    .mbn-item--nasiya svg {
        stroke: #fff;
    }

    .mbn-item--tradein {
        background: rgba(0, 0, 0, 0.06);
        color: var(--mc-text);
    }

    .mbn-item--telegram {
        background: rgba(0, 136, 204, 0.1);
        color: #0088cc;
    }

    .mbn-item--telegram svg {
        fill: #0088cc;
        stroke: none;
    }

    .mbn-call,
    .mbn-item--call {
        background: rgba(0, 200, 83, 0.12);
        color: #00a844;
    }

    .mbn-call svg,
    .mbn-item--call svg {
        stroke: #00a844;
    }

  .mbn-item.active:not(.mbn-item--nasiya):not(.mbn-item--telegram):not(.mbn-call) {
        color: var(--mc-text);
        background: rgba(0, 0, 0, 0.05);
    }

    /* Hide old sticky CTA — bottom bar replaces it */
    .mobile-sticky-cta {
        display: none !important;
    }

    .floating-contact-menu {
        display: none !important;
    }

    /* ── Floating premium CTA pill ── */
    .mc-float-cta {
        position: fixed;
        right: 16px;
        bottom: calc(var(--mc-app-bottom) + 16px + env(safe-area-inset-bottom, 0px));
        z-index: 1150;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 18px;
        background: #000;
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        border-radius: 100px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
        text-decoration: none;
        opacity: 0;
        transform: translateY(12px) scale(0.95);
        pointer-events: none;
        transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .mc-float-cta.is-visible {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .mc-float-cta:active {
        transform: scale(0.96);
    }

    /* ── Category filters horizontal ── */
    .category-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .category-grid::-webkit-scrollbar {
        display: none;
    }

    .category-card {
        flex-shrink: 0;
        scroll-snap-align: start;
        min-width: 100px;
    }

    /* ── Compare / modals above bottom bar ── */
    .compare-tray.active {
        bottom: calc(var(--mc-app-bottom) + env(safe-area-inset-bottom, 0px));
    }

    .modal-overlay.active .modal-window,
    .search-overlay.active {
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* ── Touch targets global ── */
    .mc-btn,
    .btn,
    button,
    .category-card,
    .period-btn {
        min-height: 44px;
    }

    /* ── Finder card ── */
    .finder-card {
        border-radius: var(--mc-app-radius);
        padding: 20px;
    }

    .finder-options {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .finder-option {
        min-height: 52px;
        border-radius: 14px;
        font-size: 15px;
    }

    /* ── Trade wizard ── */
    .trade-wizard__steps {
        scroll-snap-type: x mandatory;
    }

    /* ── Footer compact ── */
    .enriched-footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    /* ── Haptic tap feedback ── */
    .mc-tap:active {
        opacity: 0.85;
    }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
    .hero-v2__phone {
        animation: none;
    }

    .mc-float-cta,
    .mobile-nav,
    .drawer-window {
        transition: none;
    }
}

/* Dark mode mobile */
@media (max-width: 1024px) {
    [data-theme="dark"] .mc-header.site-header {
        background: rgba(0, 0, 0, 0.92);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    [data-theme="dark"] .mobile-nav {
        background: #111;
    }

    [data-theme="dark"] .mobile-bottom-nav {
        background: rgba(18, 18, 18, 0.94);
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    [data-theme="dark"] #catalog .product-card {
        background: #1a1a1c;
        border-color: rgba(255, 255, 255, 0.08);
    }

    [data-theme="dark"] #catalog .product-image-wrap {
        background: linear-gradient(180deg, #222 0%, #1a1a1c 100%);
    }

    [data-theme="dark"] .mbn-item--tradein {
        background: rgba(255, 255, 255, 0.08);
        color: #f5f5f7;
    }
}
