/* ==========================================================
   GLOBAL MOBİL UYUM DÜZELTMELERİ
   Tüm sayfalara uygulanır (includes/header.php üzerinden)
   ========================================================== */

/* === GENEL KAB TEMİZLİK === */
html, body { overflow-x: hidden !important; max-width: 100% !important; }
body * { max-width: 100%; }

/* === TOPBAR (üst bilgi çubuğu) === */
@media (max-width: 768px) {
    .header-topbar { font-size: 11px; }
    .header-topbar-inner { padding: 6px 12px !important; gap: 12px !important; flex-wrap: wrap; justify-content: center !important; }
    .header-topbar .ht-left { flex-wrap: wrap; gap: 8px 10px; justify-content: center; }
    .header-topbar .ht-sep:nth-of-type(1),
    .header-topbar .ht-sep:nth-of-type(2),
    .header-topbar .ht-sep:nth-of-type(3),
    .header-topbar .ht-sep:nth-of-type(4) { display: none !important; }
    .header-topbar a span { display: inline !important; }
    .header-topbar > div:first-child a:nth-child(3),
    .header-topbar > div:first-child a:nth-child(4) { display: none !important; }
}

/* === ANA NAV === */
@media (max-width: 1024px) {
    .main-nav {
        display: none !important;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        margin: 0;
        gap: 2px;
        box-shadow: 0 12px 32px rgba(10,37,64,.12);
        border-bottom: 1px solid #e5e7eb;
        z-index: 9999;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }
    .main-nav.open { display: flex !important; }
    .main-nav a {
        width: 100% !important;
        padding: 13px 16px !important;
        font-size: 15px !important;
        justify-content: flex-start !important;
    }
    .mobile-toggle { display: flex !important; }
}

@media (max-width: 480px) {
    .header-container { height: 58px !important; padding: 0 12px !important; gap: 8px !important; }
    .header-user-info { display: none !important; }
    .header-user {
        padding: 0 !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        min-height: 40px !important;
        justify-content: center !important;
    }
    .header-user-avatar,
    .header-guest-avatar { width: 40px !important; height: 40px !important; font-size: 16px !important; }
    .header-actions { gap: 6px !important; }
    .logo-mark { width: 40px !important; height: 40px !important; font-size: 19px !important; }
    .logo-text strong { font-size: 15px !important; }
    .logo-text small { display: none !important; }
}

/* === TÜM SAYFALAR İÇİN GENEL MOBİL DÜZELTMELER === */
@media (max-width: 1024px) {
    /* Container padding */
    body div[style*="max-width:1280px"],
    body .container[style*="max-width:1280px"] { padding-left: 16px !important; padding-right: 16px !important; }

    /* Sticky sidebar'ı devre dışı bırak */
    body aside[style*="position:sticky"] {
        position: static !important;
        top: auto !important;
    }

    /* 2 kolon ana yapı → 1 kolon */
    body div[style*="grid-template-columns:1fr 380px"],
    body div[style*="grid-template-columns:1fr 420px"],
    body div[style*="grid-template-columns:1fr 360px"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* 3+ kolon grid → 1 kolon */
    body div[style*="grid-template-columns:repeat(3,1fr)"],
    body div[style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Slider container taşma koruması */
    body div[style*="border-radius:16px;overflow:hidden"] {
        max-width: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    /* Container padding daha az */
    body div[style*="max-width:1280px"] { padding: 16px !important; }

    /* Genel başlıklar */
    body h1[style*="font-size:26px"],
    body h1[style*="font-size:28px"] { font-size: 22px !important; line-height: 1.3 !important; }
    body h1[style*="font-size:30px"],
    body h1[style*="font-size:32px"] { font-size: 24px !important; }
    body h1[style*="font-size:36px"] { font-size: 26px !important; }
    body h2[style*="font-size:18px"] { font-size: 16px !important; }
    body h2[style*="font-size:22px"] { font-size: 19px !important; }

    /* Fiyat kutuları */
    body strong[style*="font-size:30px"] { font-size: 26px !important; }
    body strong[style*="font-size:32px"],
    body strong[style*="font-size:36px"] { font-size: 28px !important; }

    /* Padding'ler */
    body div[style*="padding:24px"] { padding: 18px !important; }
    body div[style*="padding:32px"] { padding: 20px !important; }
    body div[style*="padding:40px"] { padding: 24px !important; }
    body div[style*="padding:28px"] { padding: 18px !important; }
    body div[style*="padding:14px 18px"] { padding: 12px 14px !important; }

    /* Margin'ler */
    body div[style*="margin-bottom:24px"] { margin-bottom: 16px !important; }
    body div[style*="margin-bottom:32px"] { margin-bottom: 20px !important; }

    /* Breadcrumb */
    body div[style*="font-size:13px"][style*="display:flex"][style*="align-items:center"] {
        font-size: 12px !important;
        flex-wrap: wrap;
    }

    /* 2 kolon side-by-side → 1 kolon */
    body div[style*="grid-template-columns:1fr 1fr"]:not([style*="minmax"]) {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    body div[style*="grid-template-columns:repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* auto-fit minmax(220px+) → 1 kolon */
    body div[style*="repeat(auto-fit,minmax(220px"],
    body div[style*="repeat(auto-fit,minmax(240px"],
    body div[style*="repeat(auto-fit,minmax(280px"],
    body div[style*="repeat(auto-fit,minmax(300px"],
    body div[style*="repeat(auto-fit,minmax(320px"] {
        grid-template-columns: 1fr !important;
    }
    body div[style*="repeat(auto-fit,minmax(180px"],
    body div[style*="repeat(auto-fit,minmax(200px"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Slider thumb kompakt */
    body div[id$="Slider"] .slider-thumb { flex: 0 0 70px !important; }
    body div[id$="Slider"] { padding: 4px 32px !important; }
    body div[style*="position:relative;padding:8px 12px"] { padding: 6px 4px !important; }

    /* Buton font */
    body button, body .rq-btn-primary, body .adm-btn, body .bk-input { font-size: 14px !important; }
    body .bk-input { padding: 9px 12px !important; font-size: 13px !important; }

    /* Aspect ratio küçült */
    body div[style*="aspect-ratio:16/9"] { aspect-ratio: 4/3 !important; }

    /* Hero ikonlar mobilde küçült */
    body i[style*="font-size:64px"] { font-size: 48px !important; }
    body i[style*="font-size:48px"] { font-size: 36px !important; }
}

@media (max-width: 480px) {
    body div[style*="max-width:1280px"] { padding: 12px !important; }

    body h1[style*="font-size:24px"][style*="font-weight:800"] { font-size: 20px !important; }
    body strong[style*="font-size:26px"] { font-size: 22px !important; }
    body strong[style*="font-size:28px"] { font-size: 24px !important; }

    body div[style*="padding:24px"] { padding: 14px !important; }
    body div[style*="padding:18px"] { padding: 14px !important; }

    body div[style*="aspect-ratio:4/3"] { aspect-ratio: 1 !important; }

    /* Slider thumb daha küçük */
    body div[id$="Slider"] .slider-thumb { flex: 0 0 60px !important; }
    body div[id$="Slider"] { padding: 4px 28px !important; }

    /* Hero ikon */
    body i[style*="font-size:64px"] { font-size: 40px !important; }
    body i[style*="font-size:48px"] { font-size: 32px !important; }
    body i[style*="font-size:80px"] { font-size: 56px !important; }

    /* 2 kolon minmax(180-200) → 1 kolon */
    body div[style*="repeat(auto-fit,minmax(180px"],
    body div[style*="repeat(auto-fit,minmax(200px"] {
        grid-template-columns: 1fr !important;
    }

    /* Tour programı sayı dairesi küçült */
    body div[style*="width:56px;height:56px"] { width: 48px !important; height: 48px !important; }
}

/* === HESABIM DASHBOARD === */
@media (max-width: 768px) {
    body .mp-page-head { flex-direction: column; align-items: flex-start !important; }
    body .mp-page-title { font-size: 22px !important; }
    body .mp-stats-grid,
    body div[style*="grid-template-columns:repeat(3,1fr)"]:not([style*="auto-fit"]) {
        grid-template-columns: 1fr !important;
    }
}

/* === ADMIN PANEL === */
@media (max-width: 1024px) {
    body .adm-sidebar {
        transform: translateX(-100%) !important;
        transition: transform .3s;
    }
    body .adm-sidebar.open { transform: translateX(0) !important; }
    body .adm-main { margin-left: 0 !important; }
    body .adm-sidebar-toggle { display: flex !important; }
}

@media (max-width: 768px) {
    body .adm-card-header { flex-direction: column; align-items: flex-start !important; gap: 12px !important; }
    body .adm-grid-3, body .adm-grid-4 { grid-template-columns: 1fr !important; }
    body .adm-table { font-size: 13px !important; }
    body .adm-table th, body .adm-table td { padding: 8px !important; }
}

/* === TABLET (768-1024) === */
@media (min-width: 768px) and (max-width: 1024px) {
    body div[style*="grid-template-columns:repeat(2,1fr)"] { grid-template-columns: 1fr 1fr !important; }
}

/* === FIX: Body scroll lock === */
body.no-scroll { overflow: hidden !important; }

/* === FIX: Taşan elemanlar için === */
body img, body video, body iframe { max-width: 100% !important; height: auto !important; }
body pre, body code { overflow-x: auto !important; max-width: 100% !important; white-space: pre-wrap; word-wrap: break-word; }
body table { display: block !important; overflow-x: auto !important; max-width: 100% !important; }
