﻿/* =========================================================
   LANG SWITCH (THEME-SYNC) v5.8 - DESKTOP + MOBILE HEADER ✅
   - Desktop: #nav içinde (İletişim yanında) ✅
   - Mobile: navbar-header içinde hamburgerin SOLUNDA ✅
   - Bayraklar: dikdörtgen (NO CIRCLE) ✅
   - Icon büyütme ✅
   - Header beyaza dönünce icon siyah ✅ (CSS + JS fallback)
   - Mobile panel: soldaki boşluk HİÇ YOK ✅ (panel içerik kadar daralır)
   ========================================================= */


/* =========================
   DESKTOP (992+)
   ========================= */

#nav > li.lang-switch {
    float: left !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
}

    #nav > li.lang-switch > button.lang-btn {
        float: left !important;
        display: block !important;
        padding: 30px 12px !important;
        margin-left: -6px !important;
        background: transparent !important;
        border: 0 !important;
        outline: none !important;
        box-shadow: none !important;
        cursor: pointer !important;
        color: #fff !important;
        line-height: 1 !important;
        position: relative !important;
        top: 0 !important;
        transform: translateY(10px) !important;
    }

        /* ✅ ICON BÜYÜT (DESKTOP) */
        #nav > li.lang-switch > button.lang-btn i {
            font-size: 22px !important; /* 18 -> 22 */
            line-height: 1 !important;
            display: inline-block !important;
            vertical-align: middle !important;
            opacity: .95 !important;
        }

        #nav > li.lang-switch > button.lang-btn:hover,
        #nav > li.lang-switch > button.lang-btn:focus {
            color: #ca3d26 !important;
        }

/* İletişim hover güvenliği */
#nav > li.nav-contact > a:hover {
    color: #ca3d26 !important;
}


/* =========================
   STICKY (Desktop)
   ========================= */

.is-sticky #nav > li.lang-switch > button.lang-btn {
    padding: 20px 12px !important;
    margin-left: -6px !important;
    color: #1a1a1a !important; /* ✅ sticky’de siyah */
    transform: translateY(8px) !important;
}

    .is-sticky #nav > li.lang-switch > button.lang-btn:hover,
    .is-sticky #nav > li.lang-switch > button.lang-btn:focus {
        color: #ca3d26 !important;
    }


/* =========================
   DESKTOP PANEL
   ========================= */

#nav > li.lang-switch .lang-panel {
    display: none !important; /* KAPALIYKEN layout’a girmez */
    float: none !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 10px !important;
    width: 260px !important;
    background: #fff !important;
    border-radius: 0 !important;
    box-shadow: 0 18px 40px rgba(0,0,0,.22) !important;
    overflow: hidden !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    transform: translateY(6px) !important;
    pointer-events: none !important;
    transition: opacity .18s ease, transform .18s ease !important;
}

    #nav > li.lang-switch .lang-panel.is-open {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }

    #nav > li.lang-switch .lang-panel .lang-item {
        float: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 12px !important;
        font-weight: 800 !important;
        letter-spacing: .6px !important;
        text-transform: uppercase !important;
        line-height: 18px !important;
        font-size: 12.5px !important;
        border-bottom: 1px solid rgba(0,0,0,.06) !important;
        border-right: 1px solid rgba(0,0,0,.06) !important;
        color: #ca3d26 !important;
        background: #fff !important;
        text-decoration: none !important;
        margin: 0 !important;
    }

        #nav > li.lang-switch .lang-panel .lang-item:nth-child(2n) {
            border-right: 0 !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item:nth-last-child(1),
        #nav > li.lang-switch .lang-panel .lang-item:nth-last-child(2) {
            border-bottom: 0 !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item:hover {
            background: rgba(202,61,38,.08) !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item.is-current {
            background: rgba(202,61,38,.08) !important;
        }

        /* FLAGS (NO CIRCLE) */
        #nav > li.lang-switch .lang-panel .lang-item small {
            font-size: 0 !important;
            letter-spacing: 0 !important;
            line-height: 0 !important;
        }

            #nav > li.lang-switch .lang-panel .lang-item small::before {
                content: "";
                display: inline-block !important;
                width: 20px !important;
                height: 14px !important;
                background-size: cover !important;
                background-position: center !important;
                border-radius: 2px !important; /* dikdörtgen */
                overflow: hidden !important;
                box-shadow: 0 0 0 1px rgba(0,0,0,.10) inset !important;
                transform: translateY(2px) !important;
            }

        #nav > li.lang-switch .lang-panel .lang-item[data-lang="tr"] small::before {
            background-image: url("/dawat/img/flags/tr.svg") !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item[data-lang="en"] small::before {
            background-image: url("/dawat/img/flags/gb.svg") !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item[data-lang="ar"] small::before {
            background-image: url("/dawat/img/flags/sa.svg") !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item[data-lang="de"] small::before {
            background-image: url("/dawat/img/flags/de.svg") !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item[data-lang="ru"] small::before {
            background-image: url("/dawat/img/flags/ru.svg") !important;
        }

        #nav > li.lang-switch .lang-panel .lang-item[data-lang="fr"] small::before {
            background-image: url("/dawat/img/flags/fr.svg") !important;
        }


/* =========================
   MOBILE/TABLET: #nav içindeki dil satırı menü içinde kalsın
   ========================= */

@media (max-width: 991px) {

    ul#nav > li.lang-switch {
        float: none !important;
        width: 100% !important;
        position: relative !important;
    }

        ul#nav > li.lang-switch > button.lang-btn {
            float: none !important;
            width: 100% !important;
            text-align: left !important;
            padding: 10px !important;
            margin-left: 0 !important;
            transform: none !important;
            color: #fff !important;
            height: auto !important;
            line-height: inherit !important;
        }

            ul#nav > li.lang-switch > button.lang-btn:hover {
                color: #ca3d26 !important;
            }

        ul#nav > li.lang-switch .lang-panel {
            display: block !important;
            position: static !important;
            width: 100% !important;
            margin-top: 0 !important;
            transform: none !important;
            box-shadow: none !important;
            opacity: 1 !important;
            pointer-events: auto !important;
            max-height: 0 !important;
            overflow: hidden !important;
            transition: max-height .2s ease !important;
            background: transparent !important;
        }

            ul#nav > li.lang-switch .lang-panel.is-open {
                max-height: 420px !important;
            }

            ul#nav > li.lang-switch .lang-panel .lang-item {
                border-right: 0 !important;
                border-bottom: 1px solid rgba(255,255,255,.10) !important;
                background: transparent !important;
                color: #fff !important;
            }

                ul#nav > li.lang-switch .lang-panel .lang-item:hover {
                    background: rgba(255,255,255,.06) !important;
                    color: #ca3d26 !important;
                }

                ul#nav > li.lang-switch .lang-panel .lang-item.is-current {
                    background: rgba(255,255,255,.06) !important;
                    color: #ca3d26 !important;
                }

                ul#nav > li.lang-switch .lang-panel .lang-item small::before {
                    box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset !important;
                    border-radius: 2px !important;
                    width: 20px !important;
                    height: 14px !important;
                }
}


/* =========================
   MOBILE HEADER: hamburgerin SOLUNA dünya ikonu ✅
   Bu element: .navbar-header içindeki .lang-switch.lang-switch-mobile
   ========================= */

.lang-switch.lang-switch-mobile {
    display: none !important;
}

@media (max-width: 767px) {

    .navbar-header {
        position: relative !important;
    }

    .lang-switch.lang-switch-mobile {
        display: block !important;
        position: absolute !important;
        top: 50% !important;
        right: 62px !important; /* hamburgerin soluna */
        transform: translateY(-50%) !important;
        z-index: 10002 !important;
    }

        .lang-switch.lang-switch-mobile > button.lang-btn {
            padding: 8px !important;
            margin: 0 !important;
            background: transparent !important;
            border: 0 !important;
            outline: none !important;
            box-shadow: none !important;
            color: #fff !important; /* default (hero üstü siyah) */
            line-height: 1 !important;
            cursor: pointer !important;
        }

            /* ✅ ICON BÜYÜT (MOBILE) */
            .lang-switch.lang-switch-mobile > button.lang-btn i {
                font-size: 24px !important; /* 18 -> 24 */
                opacity: .98 !important;
            }

    /* ✅ Header beyaza dönünce ikon siyah (CSS) */
    .is-sticky .lang-switch.lang-switch-mobile > button.lang-btn,
    .is-sticky .lang-switch.lang-switch-mobile > button.lang-btn i {
        color: #111 !important;
    }

    /* ✅ JS fallback class (tema sticky class’ı farklıysa) */
    .lang-switch.lang-switch-mobile.lang-dark > button.lang-btn,
    .lang-switch.lang-switch-mobile.lang-dark > button.lang-btn i {
        color: #111 !important;
    }

    .lang-switch.lang-switch-mobile .lang-panel {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        right: 0 !important;
        left: auto !important;
        /* ✅ SOLDAN BOŞLUK YOK: panel içerik kadar dar */
        width: max-content !important;
        min-width: 168px !important;
        max-width: 220px !important;
        background: #1f1f1f !important;
        box-shadow: 0 12px 30px rgba(0,0,0,.45) !important;
        display: none !important;
        z-index: 10003 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

        .lang-switch.lang-switch-mobile .lang-panel.is-open {
            display: block !important;
        }

        /* ✅ Satır: [YAZI][BAYRAK] sağa yaslı + içerik kadar */
        .lang-switch.lang-switch-mobile .lang-panel .lang-item {
            display: inline-grid !important; /* inline => içerik kadar */
            grid-template-columns: max-content max-content !important; /* yazı | bayrak */
            align-items: center !important;
            column-gap: 10px !important;
            justify-content: end !important;
            width: 100% !important;
            padding: 10px 6px 10px 10px !important; /* sağ boşluk minimum */
            border-bottom: 1px solid rgba(255,255,255,.10) !important;
            color: #fff !important;
            text-decoration: none !important;
            font-weight: 700 !important;
            letter-spacing: .4px !important;
            text-transform: uppercase !important;
            font-size: 12px !important;
            text-align: right !important;
        }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item:hover {
                background: rgba(255,255,255,.06) !important;
                color: #ca3d26 !important;
            }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item.is-current {
                background: rgba(255,255,255,.06) !important;
                color: #ca3d26 !important;
            }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item small {
                font-size: 0 !important;
                margin: 0 !important;
                justify-self: end !important;
                flex: none !important;
            }

                .lang-switch.lang-switch-mobile .lang-panel .lang-item small::before {
                    content: "";
                    display: inline-block !important;
                    width: 20px !important;
                    height: 14px !important;
                    background-size: cover !important;
                    background-position: center !important;
                    border-radius: 2px !important;
                    box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset !important;
                    transform: translateY(1px) !important;
                }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item[data-lang="tr"] small::before {
                background-image: url("/dawat/img/flags/tr.svg") !important;
            }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item[data-lang="en"] small::before {
                background-image: url("/dawat/img/flags/gb.svg") !important;
            }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item[data-lang="ar"] small::before {
                background-image: url("/dawat/img/flags/sa.svg") !important;
            }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item[data-lang="de"] small::before {
                background-image: url("/dawat/img/flags/de.svg") !important;
            }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item[data-lang="ru"] small::before {
                background-image: url("/dawat/img/flags/ru.svg") !important;
            }

            .lang-switch.lang-switch-mobile .lang-panel .lang-item[data-lang="fr"] small::before {
                background-image: url("/dawat/img/flags/fr.svg") !important;
            }
}


/* =========================================================
   GOOGLE TRANSLATE - ULTRA HARD HIDE
   ========================================================= */

.goog-te-banner-frame,
iframe.goog-te-banner-frame,
body > .goog-te-banner-frame,
body > iframe.goog-te-banner-frame,
body > div.goog-te-banner-frame,
body > div.skiptranslate,
.skiptranslate > iframe,
.skiptranslate {
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    border: 0 !important;
}

iframe[src*="translate.google"],
iframe[src*="translate.googleapis"],
iframe[src*="google.com/translate"] {
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    border: 0 !important;
}

html, body {
    top: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

    body[style*="top"],
    body[style*="margin-top"],
    html[style*="top"],
    html[style*="margin-top"] {
        top: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover,
.goog-text-highlight,
.goog-logo-link,
.goog-te-gadget,
.goog-te-gadget *,
.goog-te-spinner-pos {
    display: none !important;
    visibility: hidden !important;
}


/* =========================================================
   v5.8.1 — MOBILE LANG PANEL: soldaki boşluğu kesin bitir
   ========================================================= */
@media (max-width: 767px) {

    /* panel içerik kadar */
    .lang-switch.lang-switch-mobile .lang-panel {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        right: 0 !important;
        left: auto !important;
    }

        /* SATIRLARIN 100% GENİŞLEMESİNİ KIR */
        .lang-switch.lang-switch-mobile .lang-panel .lang-item {
            display: inline-flex !important; /* inline => içerik kadar */
            width: auto !important; /* ✅ 100% ez */
            max-width: none !important;
            justify-content: flex-end !important; /* sağa yasla */
            align-items: center !important;
            gap: 10px !important;
            padding: 10px 6px 10px 10px !important;
            text-align: right !important;
            white-space: nowrap !important; /* tek satır */
        }

            /* bayrak en sağda */
            .lang-switch.lang-switch-mobile .lang-panel .lang-item small {
                margin: 0 !important;
                flex: 0 0 auto !important;
            }

                /* bazen tema small'a width verir -> kır */
                .lang-switch.lang-switch-mobile .lang-panel .lang-item small::before {
                    margin: 0 !important;
                }
}


/* =========================================================
   FIX — Mobile menü içinde görünen (desktop) dil ikonunu kapat
   Sadece .lang-switch-mobile kalsın ✅
   ========================================================= */
@media (max-width: 991px) {

    /* #nav içindeki desktop switch (menü içindeki dünya ikonu) KAPANIR */
    ul#nav > li.lang-switch {
        display: none !important;
    }
}
