/* ═══════════════════════════════════════════════════════════════
   YÖN V1 — Mobil uyumluluk & dokunmatik düzeltmeler v6.6
   ═══════════════════════════════════════════════════════════════ */

/* Temel dokunmatik */
body.yon-v1-theme {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(13, 148, 136, 0.12);
}

body.yon-v1-theme.yon-modal-open {
    overflow: hidden !important;
    touch-action: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

html.yon-modal-open {
    overflow: hidden !important;
    height: 100%;
}

body.yon-v1-theme button,
body.yon-v1-theme .nav-item,
body.yon-v1-theme .nav-center,
body.yon-v1-theme .menu-toggle,
body.yon-v1-theme .header-btn,
body.yon-v1-theme .yon-action-btn,
body.yon-v1-theme .yon-cat-chip,
body.yon-v1-theme .category-card-h,
body.yon-v1-theme .product-card-h,
body.yon-v1-theme .table-card,
body.yon-v1-theme .hero-nav-btn,
body.yon-v1-theme .hero-dot,
body.yon-v1-theme .yon-search-item,
body.yon-v1-theme .footer-cta-btn,
body.yon-v1-theme .mega-quick-btn,
body.yon-v1-theme .mega-cat-head,
body.yon-v1-theme .waiter-option,
body.yon-v1-theme .subcat-card,
body.yon-v1-theme #productsPage .product-card,
body.yon-v1-theme .lang-btn-trigger,
body.yon-v1-theme button.header-btn {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Z-index katmanları — mobil çakışma düzeltmesi */
body.yon-v1-theme .app-header {
    z-index: 350 !important;
}

body.yon-v1-theme .yon-scroll-progress {
    z-index: 360 !important;
}

body.yon-v1-theme .sidebar-overlay.show {
    z-index: 440 !important;
}

body.yon-v1-theme .mega-menu.open {
    z-index: 450 !important;
}

body.yon-v1-theme .bottom-nav.yon-bottom-nav {
    z-index: 400 !important;
}

body.yon-v1-theme .yon-fab-top {
    z-index: 390 !important;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}

body.yon-v1-theme .modal-overlay {
    z-index: 500 !important;
    align-items: flex-end !important;
    padding: 0 !important;
    overscroll-behavior: contain;
}

body.yon-v1-theme .modal-overlay.show {
    display: flex !important;
}

body.yon-v1-theme .modal-content {
    max-height: min(92dvh, 92vh) !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    transform: translateZ(0);
}

body.yon-v1-theme #langDropdown,
body.yon-v1-theme .yon-theme-panel.open {
    z-index: 600 !important;
}

body.yon-v1-theme .yon-home-search-wrap {
    z-index: 45 !important;
    position: relative !important;
}

body.yon-v1-theme .yon-search-results {
    z-index: 50 !important;
    max-height: min(50vh, 320px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Alt navigasyon — inner grid düzeltmesi */
body.yon-v1-theme .bottom-nav.yon-bottom-nav {
    display: block !important;
    grid-template-columns: none !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: max(8px, env(safe-area-inset-left)) !important;
    padding-right: max(8px, env(safe-area-inset-right)) !important;
}

body.yon-v1-theme .yon-bottom-nav-inner {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    width: 100% !important;
    max-width: var(--yon-shell-max, 480px) !important;
    margin: 0 auto !important;
}

body.yon-v1-theme .yon-bottom-nav .nav-item,
body.yon-v1-theme .yon-bottom-nav .nav-center {
    min-height: 48px !important;
    -webkit-tap-highlight-color: transparent;
}

body.yon-v1-theme .yon-bottom-nav .nav-icon-wrap {
    min-width: 44px !important;
    min-height: 40px !important;
}

body.yon-v1-theme .yon-bottom-nav .nav-item:active .nav-icon-wrap,
body.yon-v1-theme .yon-bottom-nav .nav-center:active {
    transform: scale(0.94);
    opacity: 0.88;
}

/* Header — küçük ekran */
body.yon-v1-theme .app-header {
    padding-left: max(8px, env(safe-area-inset-left)) !important;
    padding-right: max(8px, env(safe-area-inset-right)) !important;
    grid-template-columns: 44px 1fr auto !important;
}

body.yon-v1-theme .menu-toggle,
body.yon-v1-theme .header-btn {
    min-width: 44px !important;
    min-height: 44px !important;
}

body.yon-v1-theme .header-logo {
    overflow: hidden;
    text-overflow: ellipsis;
}

body.yon-v1-theme .bz-name,
body.yon-v1-theme .yon-welcome-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* iOS input zoom önleme */
body.yon-v1-theme input,
body.yon-v1-theme select,
body.yon-v1-theme textarea,
body.yon-v1-theme .form-control {
    font-size: 16px !important;
}

@media (min-width: 768px) {
    body.yon-v1-theme input,
    body.yon-v1-theme select,
    body.yon-v1-theme textarea,
    body.yon-v1-theme .form-control {
        font-size: 0.9rem !important;
    }
}

/* Hero — mobil */
body.yon-v1-theme .hero-cinema {
    position: relative;
    touch-action: pan-y pinch-zoom;
}

body.yon-v1-theme .hero-panels {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
}

body.yon-v1-theme .hero-panel {
    scroll-snap-align: center;
}

body.yon-v1-theme .hero-nav-btn {
    width: 44px !important;
    height: 44px !important;
    z-index: 15 !important;
    background: rgba(11, 18, 32, 0.55) !important;
    color: #fff !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

body.yon-v1-theme .hero-dot {
    min-width: 28px !important;
    min-height: 8px !important;
    padding: 8px 4px !important;
}

body.yon-v1-theme .yon-nova-hero-block[data-hero-mode="slide"] .hero-panels {
    touch-action: pan-y;
}

/* Kategori & ürün kaydırma */
body.yon-v1-theme .yon-cat-strip,
body.yon-v1-theme .yon-contact-bar,
body.yon-v1-theme .product-scroll {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
}

body.yon-v1-theme .yon-cat-chip {
    scroll-snap-align: start;
    flex-shrink: 0;
}

body.yon-v1-theme .product-card-h {
    scroll-snap-align: start;
}

/* Ana içerik — alt nav boşluğu */
body.yon-v1-theme .yon-shell,
body.yon-v1-theme .mobile-shell {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
}

body.yon-v1-theme .main-content {
    overflow-x: hidden;
    max-width: 100%;
}

/* Grid — dar ekran */
@media (max-width: 380px) {
    body.yon-v1-theme .categories-grid {
        grid-template-columns: 1fr !important;
    }

    body.yon-v1-theme .category-card-h {
        display: grid !important;
        grid-template-columns: 100px 1fr auto !important;
        align-items: center !important;
        min-height: 88px !important;
    }

    body.yon-v1-theme .category-card-h .cat-img-wrap {
        height: 72px !important;
        max-height: 72px !important;
        width: 100px !important;
    }

    body.yon-v1-theme .yon-quick-actions {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    body.yon-v1-theme .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 359px) {
    body.yon-v1-theme .yon-bottom-nav .nav-label,
    body.yon-v1-theme .yon-bottom-nav .nav-center-label {
        font-size: 0.48rem !important;
    }

    body.yon-v1-theme .yon-bottom-nav .nav-center.yon-nav-fab {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Ürünler sayfası */
body.yon-v1-theme .products-page .page-header,
body.yon-v1-theme #subCategoriesPage .page-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--e-surface, #fff);
}

body.yon-v1-theme .products-page {
    display: none;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body.yon-v1-theme #productsPage[style*="block"],
body.yon-v1-theme #subCategoriesPage[style*="block"] {
    display: block !important;
}

body.yon-v1-theme #productsPage .product-list {
    display: flex !important;
    flex-direction: column !important;
}

body.yon-v1-theme #productsPage .product-card {
    display: flex !important;
    align-items: center !important;
}

body.yon-v1-theme .waiter-option {
    min-height: 56px !important;
}

body.yon-v1-theme .waiter-option:active,
body.yon-v1-theme .subcat-card:active,
body.yon-v1-theme #productsPage .product-card:active {
    transform: scale(0.98);
    opacity: 0.92;
}

body.yon-v1-theme button.header-btn {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    cursor: pointer;
    line-height: 1;
}

body.yon-v1-theme .lang-btn-trigger {
    background: var(--e-surface-2, #f1f5f9);
    border: 1px solid var(--e-border, #dde4ee) !important;
    padding: 6px 10px !important;
}

body.yon-v1-theme .swal2-container {
    z-index: 10050 !important;
}

body.yon-v1-theme .back-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.yon-v1-theme #productsPage .products-grid {
    padding-bottom: 24px;
}

/* Mega menü — tam ekran mobil */
@media (max-width: 480px) {
    body.yon-v1-theme .mega-menu {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.yon-v1-theme .mega-menu-body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* Modal gövde kaydırma */
body.yon-v1-theme .modal-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

body.yon-v1-theme .yon-cart-items,
body.yon-v1-theme .yon-product-modal-body,
body.yon-v1-theme .yon-table-modal-body {
    -webkit-overflow-scrolling: touch;
}

/* Dokunma geri bildirimi */
body.yon-v1-theme .yon-action-btn:active,
body.yon-v1-theme .category-card-h:active,
body.yon-v1-theme .product-card-h:active,
body.yon-v1-theme .table-card:active,
body.yon-v1-theme .yon-search-item:active,
body.yon-v1-theme .order-btn:active,
body.yon-v1-theme .add-cart-btn:active {
    transform: scale(0.98);
    opacity: 0.92;
}

/* Tema paneli — mobil konum */
body.yon-v1-theme .yon-theme-panel {
    min-width: 150px !important;
}

/* Hero stack — mobil metin */
@media (max-width: 480px) {
    body.yon-v1-theme .hero-title-stack {
        max-width: 94% !important;
        padding: 10px 14px !important;
    }

    body.yon-v1-theme .hero-t-em {
        font-size: clamp(1rem, 5vw, 1.35rem) !important;
    }

    body.yon-v1-theme .hero-layout-stack .hero-panel {
        width: 88% !important;
    }

    body.yon-v1-theme .hero-layout-billboard .hero-panels-wrap {
        height: clamp(240px, 50vw, 320px) !important;
    }
}

/* Güven & iletişim şeritleri */
body.yon-v1-theme .yon-trust-strip {
    flex-wrap: wrap;
    justify-content: center;
}

body.yon-v1-theme .yon-contact-bar {
    -webkit-overflow-scrolling: touch;
}

/* Masa seçimi grid mobil */
@media (max-width: 360px) {
    body.yon-v1-theme .table-selection-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Landscape — kısa ekran */
@media (max-height: 500px) and (orientation: landscape) {
    body.yon-v1-theme .modal-content {
        max-height: 96dvh !important;
    }

    body.yon-v1-theme .yon-bottom-nav .nav-center.yon-nav-fab {
        margin-top: -12px !important;
        width: 48px !important;
        height: 48px !important;
    }
}
