/* ============================================================================
   KVKK Çerez Yönetimi & Analitik — Banner / Modal / FAB stil tanımları.

   Partvendo theme paletiyle uyumlu (fallback'ler default değerler):
   - var(--pv-color-primary, #f99b27)         → ana turuncu
   - var(--pv-color-primary-hover, #d97700)   → koyu turuncu
   - var(--brand-navy, #1f2f4a)               → lacivert
   - var(--pv-color-on-primary, #ffffff)      → beyaz

   KVKK Temmuz 2025 m.7 gereği: "Kabul Et / Reddet / Tercihler" butonları
   görsel olarak EŞİT (aynı boyut, renk, font).
   ========================================================================= */

#kvkk-consent-banner,
#kvkk-consent-modal,
#kvkk-consent-fab {
    /* Banner ve modal kendi kapsayıcısı; outside box-sizing'ı bozma. */
    box-sizing: border-box;
    font-family: inherit;
}

#kvkk-consent-banner *,
#kvkk-consent-modal * {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   BANNER (sticky bottom)
   ------------------------------------------------------------------------ */
.kvkk-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    background: #ffffff;
    color: #1f2f4a;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    border-top: 3px solid var(--pv-color-primary, #f99b27);
    transform: translateY(100%);
    transition: transform 0.32s ease-out;
}

.kvkk-consent-banner--visible {
    transform: translateY(0);
}

.kvkk-consent-banner--hidden {
    transform: translateY(100%);
    pointer-events: none;
}

.kvkk-consent-banner__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.kvkk-consent-banner__text {
    flex: 1 1 360px;
    min-width: 0;
}

.kvkk-consent-banner__title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-navy, #1f2f4a);
}

.kvkk-consent-banner__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4a4a4a;
}

.kvkk-consent-banner__policy-link {
    color: var(--pv-color-primary, #f99b27);
    text-decoration: underline;
    margin-left: 4px;
    font-weight: 500;
}

.kvkk-consent-banner__policy-link:hover {
    color: var(--pv-color-primary-hover, #d97700);
}

.kvkk-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   BUTONLAR — KVKK m.7 eşit görsel ağırlık
   ------------------------------------------------------------------------ */
.kvkk-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 42px;
    padding: 0 18px;
    border: 2px solid var(--brand-navy, #1f2f4a);
    border-radius: 6px;
    background: #ffffff;
    color: var(--brand-navy, #1f2f4a);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.kvkk-consent-btn:hover {
    background: var(--brand-navy, #1f2f4a);
    color: #ffffff;
}

.kvkk-consent-btn:focus-visible {
    outline: 3px solid var(--pv-color-primary, #f99b27);
    outline-offset: 2px;
}

/* "Eşit" sınıfı — flex container içinde tüm butonlar aynı genişliğe akar. */
.kvkk-consent-btn--equal {
    flex: 1 1 auto;
}

/* Primary CTA (modal'da Kaydet) — diğer butonlarla aynı boyut/font, sadece
   renk farkı. KVKK m.7 ihlali değil; "kabul et"e karşı görsel avantaj yok. */
.kvkk-consent-btn--primary {
    border-color: var(--pv-color-primary, #f99b27);
    background: var(--pv-color-primary, #f99b27);
    color: var(--pv-color-on-primary, #ffffff);
}

.kvkk-consent-btn--primary:hover {
    background: var(--pv-color-primary-hover, #d97700);
    border-color: var(--pv-color-primary-hover, #d97700);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   MODAL
   ------------------------------------------------------------------------ */
.kvkk-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 9995;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.kvkk-consent-modal--visible {
    opacity: 1;
    pointer-events: auto;
}

.kvkk-consent-modal--hidden {
    opacity: 0;
    pointer-events: none;
}

.kvkk-consent-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 47, 74, 0.55);
}

.kvkk-consent-modal__dialog {
    position: relative;
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.kvkk-consent-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.kvkk-consent-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-navy, #1f2f4a);
}

.kvkk-consent-modal__close {
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 4px 8px;
}

.kvkk-consent-modal__close:hover {
    color: var(--brand-navy, #1f2f4a);
}

.kvkk-consent-modal__body {
    padding: 20px 24px;
}

.kvkk-consent-modal__intro {
    margin: 0 0 18px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4a4a4a;
}

.kvkk-consent-modal__policy,
.kvkk-consent-modal__contact {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #555;
}

.kvkk-consent-modal__policy a,
.kvkk-consent-modal__contact a {
    color: var(--pv-color-primary, #f99b27);
    text-decoration: underline;
}

.kvkk-consent-modal__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 10px 10px;
}

/* --------------------------------------------------------------------------
   KATEGORİ KARTI (modal içinde)
   ------------------------------------------------------------------------ */
.kvkk-consent-category {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #ffffff;
}

.kvkk-consent-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 12px;
}

.kvkk-consent-category__name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-navy, #1f2f4a);
}

.kvkk-consent-category__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #5a5a5a;
}

.kvkk-consent-category__status--always-on {
    font-size: 12px;
    font-weight: 700;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #c8e6c9;
}

/* --------------------------------------------------------------------------
   TOGGLE SWITCH
   ------------------------------------------------------------------------ */
.kvkk-consent-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.kvkk-consent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kvkk-consent-toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #c0c0c0;
    border-radius: 24px;
    transition: background-color 0.15s ease;
}

.kvkk-consent-toggle__slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.kvkk-consent-toggle input:checked + .kvkk-consent-toggle__slider {
    background-color: var(--pv-color-primary, #f99b27);
}

.kvkk-consent-toggle input:checked + .kvkk-consent-toggle__slider::before {
    transform: translateX(20px);
}

.kvkk-consent-toggle input:focus-visible + .kvkk-consent-toggle__slider {
    outline: 3px solid var(--pv-color-primary, #f99b27);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   FAB (sürekli erişim ikonu) — sağ alt, WhatsApp ikonunun ÜSTÜNDE
   Partvendo WhatsApp float konumu:
     desktop : right 18, bottom 112, icon 56x56 → üst kenar 168
     ≤1024px : right 12, bottom 96,  icon 52x52 → üst kenar 148
   FAB'i WhatsApp ile aynı görsel dilde yapıyoruz: beyaz kart + brand renkli
   ikon, rounded-square, hafif gölge. WhatsApp boyutuyla orantılı tutuyoruz.
   ------------------------------------------------------------------------ */
.kvkk-consent-fab {
    position: fixed;
    bottom: 180px;            /* WhatsApp üst kenarı 168 + 12 gap (görsel sıkı durur) */
    right: 18px;              /* WhatsApp ile aynı sağ kenar hizası */
    z-index: 1101;            /* WhatsApp z-index 1100; banner z-index 9990. */
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 16px;      /* WhatsApp 18px — biraz daha sıkı tutuyoruz, ikon daha kompakt */
    border: 1px solid rgba(31, 47, 74, 0.18);
    background: #ffffff;
    color: var(--pv-color-primary, #f99b27);
    display: none;            /* JS gösteriyor — sadece kullanıcı bir kez rıza verdikten sonra */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(249, 155, 39, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.15s ease;
}

.kvkk-consent-fab--visible {
    display: inline-flex;
}

.kvkk-consent-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(249, 155, 39, 0.32);
    color: var(--pv-color-primary-hover, #d97700);
}

.kvkk-consent-fab:focus-visible {
    outline: 3px solid var(--pv-color-primary, #f99b27);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   MOBİL DAVRANIŞI
   ------------------------------------------------------------------------ */
@media (max-width: 720px) {
    .kvkk-consent-banner__inner {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .kvkk-consent-banner__actions {
        flex-direction: column;
    }

    .kvkk-consent-btn {
        width: 100%;
        min-width: 0;
    }

    .kvkk-consent-modal__footer {
        flex-direction: column;
    }

    .kvkk-consent-fab {
        /* Tablet/mobile WhatsApp: bottom 96, icon 52x52 → üst kenar 148 + 12 gap */
        bottom: 160px;
        right: 12px;
        width: 48px;
        height: 48px;
        min-width: 48px;
        border-radius: 14px;
    }
}
