/* ============================================================
   Kurumsal Tema — V2
   Premium kurumsal web sitesi stil sistemi
   ============================================================ */

:root {
    --c-primary: var(--tema-renk, #b81726);
    --c-primary-rgb: var(--tema-renk-rgb, 184,23,38);
    --c-accent: var(--tema-renk, #b81726);
    --c-accent-rgb: var(--tema-renk-rgb, 184,23,38);
    --c-accent-hover: var(--tema-renk-hover, #9a1220);
    --c-dark: #1a1a2e;
    --c-body: #475569;
    --c-heading: #0f172a;
    --c-border: #e2e8f0;
    --c-bg: #f8fafc;
    --c-white: #ffffff;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: var(--c-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-heading);
    color: var(--c-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-top: 0;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); letter-spacing: -0.015em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

a { color: var(--c-primary); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--c-accent); }

img { max-width: 100%; height: auto; }

/* ============================================================
   HEADER SİSTEMİ
   ============================================================ */

/* ---------- Üst bilgi çubuğu ---------- */
.h-topbar {
    background: var(--c-dark);
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    letter-spacing: 0.01em;
    line-height: 1;
}
.h-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}
.h-topbar a { color: rgba(255,255,255,0.65); }
.h-topbar a:hover { color: var(--c-accent); }
.h-topbar-left,
.h-topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.h-topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.h-topbar-item i { font-size: 11px; color: var(--c-accent); }
.h-topbar-sep {
    width: 1px;
    height: 12px;
    background: rgba(255,255,255,0.12);
}
.h-social {
    display: flex;
    gap: 2px;
}
.h-social a {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    transition: all 0.2s var(--ease);
}
.h-social a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ---------- Ana header çubuğu ---------- */
.h-main {
    background: var(--c-white);
    position: relative;
    z-index: 100;
    transition: box-shadow 0.3s var(--ease);
}
.h-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

/* Sticky */
.h-main.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: var(--shadow);
    animation: hSlideDown 0.35s var(--ease);
}
@keyframes hSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---------- Logo ---------- */
.h-logo a {
    display: inline-flex;
    align-items: center;
}
.h-logo img {
    height: 40px;
    width: auto;
    transition: height 0.2s var(--ease);
}
.h-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--c-primary);
    letter-spacing: -0.03em;
}

/* ---------- Navigasyon ---------- */
.h-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}
.h-nav > li { position: relative; }
.h-nav > li > a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--c-heading);
    border-radius: 6px;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}
.h-nav > li > a:hover,
.h-nav > li.active > a {
    color: var(--c-primary);
    background: rgba(var(--c-primary-rgb), 0.04);
}

/* Dropdown */
/* Dropdown — 1. seviye (aşağı açılır) */
.h-nav .h-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s var(--ease);
    z-index: 200;
    list-style: none;
}
.h-nav > li:hover > .h-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown — 2+ seviye (sağa açılır) */
.h-dropdown .h-dropdown {
    top: -8px;
    left: 100%;
    transform: translateX(8px);
}
.h-dropdown li { position: relative; }
.h-dropdown li:hover > .h-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}
.h-dropdown li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 14px;
    color: var(--c-body);
    border-radius: 6px;
    transition: all 0.15s var(--ease);
    white-space: nowrap;
}
.h-dropdown li a:hover {
    background: var(--c-bg);
    color: var(--c-primary);
}
.h-has-sub > a { padding-right: 10px; }

/* ---------- CTA Buton ---------- */
.h-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--c-accent);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    white-space: nowrap;
}
.h-cta:hover {
    background: var(--c-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--c-accent-rgb), 0.3);
}

/* ---------- Header iletişim kutusu ---------- */
.h-contact-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
    margin-left: 20px;
    border-left: 1px solid var(--c-border);
}
.h-contact-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--c-primary-rgb), 0.06);
    border-radius: 8px;
    color: var(--c-primary);
    font-size: 14px;
    flex-shrink: 0;
}
.h-contact-text small {
    display: block;
    font-size: 11px;
    color: var(--c-body);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    margin-bottom: 3px;
}
.h-contact-text strong {
    font-size: 14px;
    color: var(--c-heading);
    font-weight: 700;
}

/* ---------- Hamburger ---------- */
.h-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 16px;
    color: var(--c-heading);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.h-toggle:hover { background: var(--c-border); }

/* ---------- Navigasyon bar (ayrı çubuk) ---------- */
.h-navbar {
    background: var(--c-primary);
}
.h-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
}
.h-navbar .h-nav > li > a {
    color: rgba(255,255,255,0.85);
    border-radius: 0;
    padding: 14px 18px;
}
.h-navbar .h-nav > li > a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ---------- Orta bar (logo orta) ---------- */
.h-center-bar {
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    padding: 22px 0;
}

/* ============================================================
   FOOTER SİSTEMİ
   ============================================================ */
.f-main {
    background: var(--c-dark);
    color: rgba(255,255,255,0.6);
    padding: 64px 0 40px;
    font-size: 14px;
    line-height: 1.8;
}
.f-main h5 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 22px;
    padding-bottom: 14px;
    position: relative;
}
.f-main h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--c-accent);
    border-radius: 1px;
}
.f-main a { color: rgba(255,255,255,0.6); }
.f-main a:hover { color: var(--c-accent); }

.f-logo {
    height: 36px;
    margin-bottom: 18px;
    /* Logo tipi ayardan seçildiği için filter gerekmez */
}

.f-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.f-links li { padding: 4px 0; }
.f-links li a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s var(--ease);
}
.f-links li a::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.2s;
    flex-shrink: 0;
}
.f-links li a:hover::before { background: var(--c-accent); }
.f-links li a:hover { padding-left: 4px; }

.f-contact-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.f-contact-item i {
    color: var(--c-accent);
    margin-top: 4px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.f-social {
    display: flex;
    gap: 6px;
    margin-top: 20px;
}
.f-social a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    transition: all 0.25s var(--ease);
}
.f-social a:hover {
    background: var(--c-accent);
    color: #fff;
    transform: translateY(-2px);
}

.f-bottom {
    background: rgba(0,0,0,0.25);
    padding: 16px 0;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}
.f-bottom a { color: rgba(255,255,255,0.5); }
.f-bottom a:hover { color: var(--c-accent); }

/* Dil seçici */
.f-lang-switcher a:hover { opacity:1!important; background:rgba(255,255,255,0.12); color:#fff; }

/* ============================================================
   GENEL BİLEŞENLER
   ============================================================ */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-bg { background: var(--c-bg); }

.btn-primary-custom {
    background: var(--c-accent);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    transition: all 0.25s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary-custom:hover {
    background: var(--c-accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--c-accent-rgb), 0.25);
}

/* ============================================================
   RESPONSİVE
   ============================================================ */
/* Desktop varsayılan — h-nav-wrap görünür kalmalı */
@media (min-width: 992px) {
    .h-nav-wrap {
        display: flex !important;
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: auto !important;
        max-width: none !important;
        align-items: center;
        flex: 1 1 auto;
    }
    /* Menü içinde CTA butonu en sağa, ul.h-nav sola yapışsın */
    .h-nav-wrap > ul.h-nav { margin-right: auto; }
    .h-nav-wrap > .h-cta { margin-left: auto !important; }
    /* Logo-orta tasarımında flex:1 vermiyoruz (centered nav bozulmasın) */
    .h-navbar-inner[style*="justify-content:center"] .h-nav-wrap,
    .h-navbar-inner[style*="justify-content: center"] .h-nav-wrap { flex: 0 0 auto; }
    .h-navbar-inner[style*="justify-content:center"] .h-nav-wrap > ul.h-nav,
    .h-navbar-inner[style*="justify-content: center"] .h-nav-wrap > ul.h-nav { margin-right: 0; }
    .h-mobile-logo, .h-mobile-cta, .h-mobile-iletisim,
    .h-mobile-sosyal, .h-mobile-dil, .h-mobile-extras,
    .h-nav-close, .h-nav-backdrop {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .h-toggle { display: flex; margin-left: auto; }

    /* Slide-in sidebar (sağdan açılır) */
    .h-nav-wrap {
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto !important;
        width: 320px;
        max-width: 85vw;
        background: var(--c-white);
        border-top: none;
        box-shadow: none;
        padding: 64px 0 24px;
        z-index: 9999;
        transform: translateX(100%);
        transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
        overflow-y: auto;
        display: block !important;
        visibility: hidden;
    }
    .h-nav-wrap.open {
        transform: translateX(0);
        box-shadow: -8px 0 32px rgba(0,0,0,0.18);
        visibility: visible;
    }

    /* Backdrop */
    .h-nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }
    .h-nav-backdrop.open {
        opacity: 1;
        visibility: visible;
    }

    /* Sidebar içi kapat butonu (JS ile inject) */
    .h-nav-close {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1px solid var(--c-border);
        background: var(--c-bg);
        color: var(--c-heading);
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }
    .h-nav-close:hover { background: var(--c-border); }

    /* Sidebar içindeki nav — desktop navbar renklerini devralır */
    .h-nav {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0;
        padding: 0;
        margin: 0;
        list-style: none;
        width: 100%;
    }
    .h-nav > li {
        border-bottom: 1px solid rgba(127,127,127,0.15);
        width: 100%;
    }
    .h-nav > li > a {
        padding: 14px 24px;
        border-radius: 0;
        font-size: 15px;
        display: block;
        width: 100%;
    }
    .h-nav .h-dropdown,
    .h-nav .h-dropdown .h-dropdown {
        position: static;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        list-style: none;
        background: var(--c-bg);
        transition: all 0.25s ease;
        min-width: 0;
    }
    .h-nav .h-dropdown.open {
        opacity: 1;
        visibility: visible;
        max-height: 1000px;
        padding: 0;
    }
    .h-nav .h-dropdown li a {
        padding: 12px 36px;
        display: block;
        font-size: 14px;
        opacity: 0.85;
    }
    .h-nav .h-dropdown {
        background: rgba(0,0,0,0.08);
    }
    .h-contact-box { display: none; }
    .h-cta {
        margin: 16px 24px 0;
        width: calc(100% - 48px);
        justify-content: center;
    }
    .h-topbar-left { display: none; }
    .h-center-info { display: none !important; }

    /* Body scroll lock when menu open */
    body.h-nav-locked { overflow: hidden; }
}
@media (max-width: 767.98px) {
    .h-topbar { display: none; }
    .section { padding: 48px 0; }
    .f-main { padding: 40px 0 24px; }
}

/* ============================================================
   GENEL MOBİL İYİLEŞTİRMELERİ — Tüm modüllere uygulanır
   ============================================================ */
@media (max-width: 991.98px) {
    /* Container padding biraz azalsın */
    .container { padding-left: 16px; padding-right: 16px; }

    /* Yatay overflow önle (taşan öğeler için) */
    body { overflow-x: hidden; }

    /* Tablo: yatay scroll */
    [data-block-id] table { display: block; max-width: 100%; overflow-x: auto; }

    /* Resimler her zaman responsive */
    [data-block-id] img:not([style*="position:absolute"]):not([style*="position: absolute"]) {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 767.98px) {
    /* Daha küçük dikey boşluk */
    .section { padding: 36px 0; }
    .f-main { padding: 32px 0 20px; }

    /* Tüm blok modülleri içindeki büyük başlıkları küçült */
    [data-block-id] h1 { font-size: clamp(1.5rem, 5vw, 2rem) !important; line-height: 1.25 !important; }
    [data-block-id] h2 { font-size: clamp(1.3rem, 4.5vw, 1.75rem) !important; line-height: 1.3 !important; }
    [data-block-id] h3 { font-size: clamp(1.15rem, 4vw, 1.5rem) !important; line-height: 1.35 !important; }
    [data-block-id] h4 { font-size: clamp(1rem, 3.5vw, 1.25rem) !important; }

    /* Footer widget grid → tek kolon */
    .f-main .col-md-6 { width: 100%; max-width: 100%; flex: 0 0 100%; }
    .f-main h5 { margin-top: 24px; }

    /* Form alanları full width + büyük dokunma alanı */
    [data-block-id] input[type="text"],
    [data-block-id] input[type="email"],
    [data-block-id] input[type="tel"],
    [data-block-id] input[type="number"],
    [data-block-id] input[type="search"],
    [data-block-id] input[type="date"],
    [data-block-id] textarea,
    [data-block-id] select {
        font-size: 16px !important; /* iOS auto-zoom önle */
        min-height: 44px;
        width: 100%;
    }
    [data-block-id] textarea { min-height: 96px; }

    /* Form submit butonları için minimum dokunma alanı (44x44 Apple guideline)
       Slider dot, toggle, h-toggle, navigasyon butonlarına uygulanmaz */
    [data-block-id] button[type="submit"],
    [data-block-id] input[type="submit"],
    [data-block-id] input[type="button"] {
        min-height: 44px;
    }

    /* Section blok dikey boşluk azalsın */
    [data-block-type="section_blok"] > div[style*="padding"] {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    /* CTA bar kompakt section'lar zaten 20px padding kullanıyor — dokunmuyoruz */
    [data-block-id] [style*="padding:20px 0"] { padding: 20px 0 !important; }
    [data-block-id] [style*="padding:10px 0"] { padding: 10px 0 !important; }
    [data-block-id] [style*="padding:0px 0"] { padding: 0 !important; }

    /* Dar kolonları stack'le (col-md-6 sayfa builder kolonları) */
    .row > [class*="col-md-"] { margin-bottom: 16px; }

    /* Slider yüksekliği makul kalsın */
    .site-slider { min-height: 320px; }
    .site-slider h1 { font-size: clamp(1.4rem, 5vw, 2rem) !important; }

    /* Slider prev/next okları → alt orta (pagination ile yan yana) */
    .site-slider .slider-nav-prev {
        top: auto !important;
        bottom: 16px !important;
        left: calc(50% - 100px) !important;
        right: auto !important;
        transform: none !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }
    .site-slider .slider-nav-next {
        top: auto !important;
        bottom: 16px !important;
        right: calc(50% - 100px) !important;
        left: auto !important;
        transform: none !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }
    /* Pagination dots dikey hizayı eşitle */
    .site-slider > div[style*="bottom:24px"] {
        bottom: 24px !important;
    }

    /* Galeri resimleri arası boşluk azalt */
    [data-block-type*="galeri"] [style*="gap:24px"] { gap: 12px !important; }
    [data-block-type*="galeri"] [style*="gap:32px"] { gap: 16px !important; }

    /* Harita yüksekliği */
    [data-block-type="harita_blok"] [style*="height"] { max-height: 320px; }

    /* Kart/grid bloklar tek kolon */
    [data-block-id] [style*="grid-template-columns"]:not([style*="grid-template-columns:1fr"]) {
        grid-template-columns: 1fr !important;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 479.98px) {
    .container { padding-left: 12px; padding-right: 12px; }

    [data-block-id] h1 { font-size: clamp(1.3rem, 6vw, 1.75rem) !important; }
    [data-block-id] h2 { font-size: clamp(1.15rem, 5vw, 1.5rem) !important; }

    /* Yatay buton grupları wrap */
    [data-block-id] [style*="display:flex"][style*="gap"] { flex-wrap: wrap !important; }

    /* Footer sosyal butonlar küçülsün */
    .f-social a { width: 36px !important; height: 36px !important; }

    /* Section padding minimum */
    [data-block-type="section_blok"] > div[style*="padding"] {
        padding-top: 32px !important;
        padding-bottom: 32px !important;
    }
}
