/*
 * Duyuru şeridi, açılır pencere (popup) ve bülten formu.
 *
 * Şerit sayfanın en üstünde SABİT durur; header (hem saydam-absolute hem
 * sticky-fixed hali) onunla çakışmasın diye `--site-bar-h` kadar aşağı
 * itilir. Yüksekliği JS ölçer — metin iki satıra taştığında da doğru kalır.
 */

:root {
    --site-bar-h: 0px;
}

/* ============================================================ DUYURU ŞERİDİ */

.site-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    color: #fff;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.site-bar[hidden] {
    display: none;
}

.site-bar.is-open {
    transform: translateY(0);
}

/* Renk tonları: panelden seçilen "tone" değerine karşılık gelir. */
.site-bar--primary { background: linear-gradient(90deg, #155fff 0%, #4d86ff 100%); }
.site-bar--warning { background: linear-gradient(90deg, #b4460b 0%, #e2690f 100%); }
.site-bar--dark    { background: linear-gradient(90deg, #0b1220 0%, #1f2a44 100%); }
.site-bar--success { background: linear-gradient(90deg, #067647 0%, #10a25f 100%); }

.site-bar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 11px 44px 11px 16px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.site-bar__message {
    margin: 0;
    font-weight: 500;
}

.site-bar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    padding: 5px 14px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: background 0.2s ease, transform 0.2s ease;
}

.site-bar__link:hover {
    background: rgba(255, 255, 255, 0.26);
    color: #fff;
    transform: translateY(-1px);
}

.site-bar__close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    opacity: 0.75;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.site-bar__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.18);
}

/* Şerit açıkken sayfa ve header aşağı kayar — böylece çakışma olmaz. */
html.has-site-bar body {
    padding-top: var(--site-bar-h);
}

html.has-site-bar .header-nav-wrapper,
html.has-site-bar .header-sticky {
    top: var(--site-bar-h);
}

/*
 * Yukarıdaki kural yalnızca KAYDIRILINCA sabitlenen (.scroll-on) hâli
 * kapsıyordu. Sayfa henüz kaydırılmamışken temanın kendi header'ı zaten
 * `position:absolute; top:0`'dır (.header.header-2) — bu, en yakın
 * konumlanmış üst öğeye göre ölçülür ve body'nin padding-top'ını (şeridin
 * açtığı boşluk) hiç GÖRMEZ, o yüzden ilk açılışta / mobilde şeridin
 * altına değil ÜSTÜNE biniyordu. Header'ın kendisi de aynı payla aşağı
 * itilir.
 */
html.has-site-bar .header.header-2 {
    top: var(--site-bar-h);
}

/*
 * Kaydırınca tema kendi kuralını devreye sokuyor:
 * .header-nav-wrapper.header-sticky.scroll-on{position:fixed;top:0}. Üç
 * sınıf birleşimi yukarıdaki iki satırlı kuraldan daha özgül olduğu için
 * onu eziyor, header şeridin ALTINA değil tam üstüne 0'dan sabitleniyordu
 * — şerit gezinme çubuğunun üstüne biniyordu. Aynı üç sınıf burada tekrar
 * eşlenip !important ile kazandırılır (derlenmiş tema dosyasına dokunmadan
 * tek güvenli yol).
 */
html.has-site-bar .header-nav-wrapper.header-sticky.scroll-on {
    top: var(--site-bar-h) !important;
}

/* ========================================================= AÇILIR PENCERE */

.site-popup {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.site-popup[hidden] {
    display: none;
}

.site-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 14, 28, 0.62);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.site-popup.is-open .site-popup__backdrop {
    opacity: 1;
}

.site-popup__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 40px 80px rgba(9, 14, 28, 0.4);
    opacity: 0;
    transform: translateY(18px) scale(0.94);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-popup.is-open .site-popup__card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Görsel kartın üst köşelerine oturur, ayrı bir blok gibi durmaz. */
.site-popup__image {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 22px 22px 0 0;
}

.site-popup__content {
    padding: 30px 28px 28px;
    text-align: center;
}

.site-popup__card--with-image .site-popup__content {
    padding-top: 24px;
}

/*
 * Kapatma düğmesi görselsiz varyantta içerik kutusunun İÇİNDE, başlıkla
 * aynı satırda kalıyordu (üst boşluk yalnızca 12px, başlık onun altına
 * kadar uzanan tam genişlikte akıyordu) — uzun bir başlık düğmenin üstüne
 * biniyordu. Artık kartın kendi köşesine, içerik akışının DIŞINA oturur;
 * başlığa da sağdan pay bırakılır.
 */
.site-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    color: #55607a;
    background: #f3f5f9;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-popup__close:hover {
    background: #eef1f6;
    color: #0b1220;
    transform: rotate(90deg);
}

.site-popup__card--with-image .site-popup__close {
    color: #1f2937;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(9, 14, 28, 0.18);
}

.site-popup__heading {
    margin: 0 0 10px;
    padding-right: 30px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    color: #0b1220;
}

.site-popup__body {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.65;
    color: #55607a;
}

/* Tek başına duran çağrı butonu tam genişlik: kartta ortalanmış görünür. */
.site-popup__cta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
}

.site-popup__content .site-subscribe {
    text-align: left;
}

.site-popup__cta + .site-subscribe {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #eef1f6;
}

/* ============================================================ BÜLTEN FORMU */

.site-subscribe__alert {
    margin: 0 0 12px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.site-subscribe__alert[hidden] { display: none; }
.site-subscribe__alert.is-success { background: #ecfdf3; color: #067647; }
.site-subscribe__alert.is-error { background: #fef3f2; color: #b42318; }

/*
 * E-posta satırı ile güvenlik doğrulama kutusu aynı hizada yan yana durur:
 * captcha alta düşünce kutunun yüksekliğini artırıyordu. Dar alanda (popup,
 * mobil) sığmazsa flex-wrap ile kendiliğinden alta kayar.
 */
.site-subscribe__inline {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.site-subscribe__inline .site-subscribe__row {
    flex: 1 1 220px;
    margin-bottom: 0;
}

.site-subscribe__inline .cap {
    flex: 0 0 auto;
    margin: 0;
}

/*
 * Popup kartı dar (max-width: 440px, üstüne 28px iç boşluk) — satır +
 * captcha'yı yan yana sığdırmaya çalışmak ikisini de sıkıştırıp e-posta
 * kutusunu "dar/bozuk" gösteriyordu. Popup'ta ikisi HER ZAMAN alt alta,
 * tam genişlikte durur; footer'ın geniş sütununda yan yana kalmaya devam
 * eder.
 */
.site-popup .site-subscribe__inline {
    flex-direction: column;
    align-items: stretch;
}

.site-popup .site-subscribe__inline .site-subscribe__row,
.site-popup .site-subscribe__inline .cap {
    width: 100%;
    flex-basis: auto;
}

/* .cap-check kendi dosyasında width:auto !important taşıyor, aynı ağırlıkta ezilir. */
.site-popup .site-subscribe__inline .cap-check {
    width: 100% !important;
}

/*
 * Popup'ta e-posta kutusu + buton her zaman alt alta, tam genişlikte ve
 * kendi ölçüleriyle basılır — dar ekran medya sorgusuna (max-width:575px)
 * bağlı kalmak popup GENİŞ ekranda açıldığında (popup kendi başına zaten
 * dar bir kart, 440px) satır düzeninde kalıp kutuyu sıkıştırıyordu.
 */
.site-popup .site-subscribe__row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
}

.site-popup .site-subscribe__row input[type="email"] {
    box-sizing: border-box;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    border: 1px solid #e1e6ef;
    border-radius: 100px;
    background: #fff;
    font-size: 14px;
    line-height: normal;
}

.site-popup .site-subscribe__row button {
    box-sizing: border-box;
    width: 100%;
    height: 50px;
    padding: 0 22px;
    border-radius: 100px;
}

/*
 * Girdi ve buton tek bir hap (pill) içinde birleşik durur — ayrı ayrı
 * duran kutu + buton ikilisi dar kartlarda dağınık görünüyordu.
 */
.site-subscribe__row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e1e6ef;
    border-radius: 100px;
    padding: 4px 4px 4px 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-subscribe__row:focus-within {
    border-color: #155fff;
    box-shadow: 0 0 0 3px rgba(21, 95, 255, 0.12);
}

.site-subscribe__row input[type="email"] {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: 0;
    background: transparent;
    padding: 0 12px;
    font-size: 14px;
    color: #0b1220;
    outline: 0;
}

.site-subscribe__row input[type="email"]::placeholder {
    color: #98a2b3;
}

.site-subscribe__row button {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 22px;
    border-radius: 100px;
    white-space: nowrap;
    font-size: 14px;
}

/*
 * Tema, "form içindeki her button" için mutlak konumlu bir kural taşıyor
 * (örn. .site-popup form button). Hap tasarımında buton satırın içinde
 * durduğu için bu genel kural burada geri alınır. Footer'da İSTEYEREK tam
 * tersi yapılıyor (bkz. aşağı) — orada tema orijinaline dönülür.
 */
.site-popup .site-subscribe__row button,
.site-subscribe__row button {
    position: static;
    transform: none;
    top: auto;
    right: auto;
}

/* Tema butonu ok ikonu/animasyon taşıyor; dar satırda sadeleşir. */
.site-subscribe__row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.site-subscribe__row button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.site-subscribe__privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.55;
    color: #6b7280;
    /* Üstündeki satır/captcha grubuna yapışık durmasın diye üst boşluk. */
    margin: 14px 0 4px;
    cursor: pointer;
}

.site-subscribe__privacy input[type="checkbox"] {
    flex: 0 0 auto;
    width: 15px;
    min-width: 15px;
    max-width: 15px;
    height: 15px;
    min-height: 15px;
    margin: 2px 0 0;
    padding: 0;
    border-radius: 3px;
}

.site-subscribe__error {
    display: block;
    font-size: 12px;
    color: #dc3545;
    margin-bottom: 8px;
}

.site-subscribe__error[hidden] { display: none; }

.hp-field {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

/*
 * Footer'da hap tasarımı YERİNE temanın orijinal görünümü kullanılır: tek
 * satır giriş, buton satırın üstüne mutlak konumla biner
 * (.footer-top .subs-widget form button — tema kuralı, burada tekrar
 * serbest bırakılır). Bu seçici üç sınıf taşıdığı için tema kuralından daha
 * özgül; !important gerekmiyor.
 */
.footer .subs-widget .site-subscribe__row {
    display: block;
    position: relative;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.footer .subs-widget .site-subscribe__row:focus-within {
    border: 0;
    box-shadow: none;
}

.footer .subs-widget .site-subscribe__row input[type="email"] {
    width: 100%;
    height: 54px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 140px 0 30px;
    color: #fff;
}

.footer .subs-widget .site-subscribe__row input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.footer .subs-widget .site-subscribe__row button {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 26px;
    padding: 14px 24px;
}

.footer .subs-widget .site-subscribe__privacy {
    color: rgba(255, 255, 255, 0.7);
}

.footer .subs-widget .site-subscribe__privacy a {
    color: #fff;
}

/*
 * Güvenlik doğrulama kutusu e-posta satırının YANINDA durur (bkz.
 * .site-subscribe__inline) — karanlık footer zeminine göre kendi renk
 * değişkenleri (--cap-*) ezilir, beyaz bir kart gibi değil formun bir
 * parçası gibi görünür.
 */
.footer .subs-widget .cap {
    --cap-surface: rgba(255, 255, 255, 0.08);
    --cap-text: #fff;
    --cap-muted: rgba(255, 255, 255, 0.65);
    --cap-line: rgba(255, 255, 255, 0.2);
    --cap-track: rgba(255, 255, 255, 0.12);
    --cap-accent-soft: rgba(255, 255, 255, 0.12);
}

.footer .subs-widget .cap-check {
    height: 54px;
    padding: 0 18px;
}

.footer .subs-widget .cap-check-label {
    max-width: none;
}

@media (max-width: 420px) {
    .footer .subs-widget .cap-check-badge {
        display: none;
    }
}

/* ==================================================================== MOBİL */

@media (max-width: 575px) {
    .site-bar__inner {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 13px;
        padding: 10px 40px 10px 14px;
    }

    .site-popup__card {
        max-width: 100%;
        border-radius: 16px;
    }

    .site-popup__image {
        height: 150px;
        border-radius: 16px 16px 0 0;
    }

    .site-popup__content {
        padding: 22px 20px 20px;
    }

    .site-popup__heading {
        font-size: 20px;
    }

    /* Dar ekranda hap düzeni sıkışıyor; alt alta ama yuvarlak kalıyor. */
    .site-subscribe__row {
        flex-direction: column;
        gap: 8px;
        border-radius: 14px;
        padding: 8px;
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    .site-subscribe__row input[type="email"] {
        width: 100%;
        border: 1px solid #e1e6ef;
        border-radius: 100px;
        background: #fff;
        padding: 0 16px;
    }

    .site-subscribe__row button {
        width: 100%;
    }
}

/* Hareketi azaltma tercihine saygı. */
@media (prefers-reduced-motion: reduce) {
    .site-bar,
    .site-popup__backdrop,
    .site-popup__card {
        transition: none;
    }
}
