/*
 * Cookie Consent Banner (T-20260816-07, Issue #1593)
 * Alt sabit banner — iki katmanli: 1. seviye (Kabul/Reddet/Yonet), 2. seviye (kategori switch'leri).
 * z-index: sticky ogelerin (~90) USTUNDE, app-install-banner'in (500) ve modal backdrop'larin
 * (lp-modal-backdrop 1050, mp-modal-backdrop 2600) ALTINDA.
 * Renkler YALNIZ design system token'larindan (binderim-tokens.css: --bg-canvas, --fg-1,
 * --border-1, --color-brand ...) -- proje kurali §2.3, hex YAZILMAZ. language-switcher.css
 * (ayni epic, T-20260816-01) ile AYNI token seti.
 */

.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 480;
    display: none;
    background: var(--bg-canvas);
    color: var(--fg-1);
    border-top: 1px solid var(--border-1);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}

.cookie-consent-banner.is-visible {
    display: block;
}

/* /cerez-tercihleri sayfasinda gomulu (fixed degil, sayfa akisinda) gorunur. */
.cookie-consent-banner.cookie-consent-embedded {
    position: static;
    display: block;
    border: 1px solid var(--border-1);
    border-radius: 12px;
    box-shadow: none;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
}

.cookie-consent-form {
    max-width: 980px;
    margin: 0 auto;
}

.cookie-consent-text {
    margin: 0 0 12px 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--fg-2);
}

.cookie-consent-link {
    color: var(--color-brand);
    text-decoration: underline;
    white-space: nowrap;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* "Reddet" ile "Kabul Et" GORSEL olarak esit agirlikta -- UK ICO kurali (reddetmek kabul etmek
   kadar kolay gorunmeli). Ikisi de .cookie-consent-btn temel sinifini + DOLU (filled) arka plan
   kullanir (.cookie-consent-btn-primary / .cookie-consent-btn-reject) -- PR #1608 review yesil
   kalem: eskiden "Reddet" .cookie-consent-btn-secondary (bos/outline, dusuk vurgu) kullaniyordu,
   bu da "Kabul Et"i (dolu, marka rengi) GORSEL olarak daha belirgin kiliyordu -- boyut/padding
   ayni olsa da renk-doygunlugu farki tek basina agirlik dengesizligi yaratir. "Yonet" (uculu
   secenek, karari ERTELER) TEK BASINA .cookie-consent-btn-secondary kalir -- Kabul/Reddet
   ikilisiyle KARISTIRILMAMASI icin bilerek daha dusuk vurgulu. */
.cookie-consent-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-1);
    background: var(--bg-canvas);
    color: var(--fg-1);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.cookie-consent-btn:hover {
    border-color: var(--color-brand);
}

.cookie-consent-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.cookie-consent-btn:active {
    transform: scale(0.97);
}

.cookie-consent-btn-primary {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: var(--fg-on-brand);
}

.cookie-consent-btn-primary:hover {
    background: var(--color-brand-hover);
    border-color: var(--color-brand-hover);
}

.cookie-consent-btn-secondary {
    background: var(--bg-canvas);
    color: var(--fg-1);
}

/* "Reddet" -- .cookie-consent-btn-primary ile AYNI doygunlukta dolu arka plan (marka rengi
   yerine notr slate-700/800), boylece iki eylem GORSEL olarak esit agirlikta olur. */
.cookie-consent-btn-reject {
    background: var(--fg-1);
    border-color: var(--fg-1);
    color: var(--bg-canvas);
}

.cookie-consent-btn-reject:hover {
    background: var(--fg-2);
    border-color: var(--fg-2);
}

.cookie-consent-level2 {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-consent-level2[hidden] {
    display: none;
}

.cookie-consent-category {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cookie-consent-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cookie-consent-category-title {
    font-weight: 700;
    font-size: 0.9rem;
}

.cookie-consent-category-desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--fg-3);
}

/* Touch target >= 44px switch */
.cookie-consent-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 44px;
    height: 44px;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.cookie-consent-switch input {
    position: absolute;
    opacity: 0;
    width: 44px;
    height: 44px;
    margin: 0;
    cursor: pointer;
}

.cookie-consent-switch-track {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--border-2);
    transition: background-color 0.15s ease;
}

.cookie-consent-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-canvas);
    box-shadow: var(--shadow-xs);
    transition: transform 0.15s ease;
}

.cookie-consent-switch input:checked + .cookie-consent-switch-track {
    background: var(--color-brand);
}

.cookie-consent-switch input:checked + .cookie-consent-switch-track::after {
    transform: translateX(18px);
}

.cookie-consent-switch input:focus-visible + .cookie-consent-switch-track {
    outline: none;
    box-shadow: var(--focus-ring);
}

.cookie-consent-switch-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cookie-consent-switch-disabled input {
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .cookie-consent-actions {
        justify-content: stretch;
    }

    .cookie-consent-btn {
        flex: 1 1 auto;
    }

    .cookie-consent-banner.cookie-consent-embedded {
        max-width: 100%;
    }
}
