/* ==========================================================================
   Ata Döküm - Çerez Onay Banner'ı ve Tercih Merkezi
   z-index düzeni: banner 1042 (Bootstrap modal 1050/1055, offcanvas 1045,
   sepet çekmecesi 1400 ve mobil alt barların altında kalır; alt barların
   üzerine --cc-bottom-offset ile konumlanır). Tercih penceresi 1065.
   ========================================================================== */
:root {
    --cc-bottom-offset: 0px;
}

.cc-banner {
    position: fixed;
    left: 18px;
    bottom: 24px;
    width: 380px;
    max-width: calc(100vw - 36px);
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.16);
    padding: 18px 20px 16px;
    z-index: 1042;
    animation: ccSlideUp .3s ease;
}

.cc-banner[hidden],
.cc-dialog[hidden] {
    display: none !important;
}

/* Herhangi bir modal / sepet çekmecesi / tercih penceresi açıkken banner gizlenir */
body.modal-open .cc-banner,
body.cart-drawer-open .cc-banner,
body.cc-dialog-open .cc-banner {
    display: none !important;
}

@keyframes ccSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.cc-banner-title {
    font-size: .9rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #0f172a;
}

.cc-banner-text {
    font-size: .78rem;
    line-height: 1.5;
    color: #475569;
    margin: 0 0 12px;
}

.cc-banner-text a,
.cc-dialog a {
    color: var(--accent, #A9342B);
    text-decoration: underline;
}

/* Eşit ağırlıklı (equal prominence) butonlar */
.cc-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.cc-btn {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--primary, #1D201F);
    background: var(--primary, #1D201F);
    color: #ffffff;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: opacity .15s ease, box-shadow .15s ease;
}

.cc-btn:hover {
    opacity: .88;
}

.cc-btn:focus-visible,
.cc-switch input:focus-visible + .cc-switch-track,
.footer-cookie-prefs:focus-visible {
    outline: 3px solid var(--accent, #A9342B);
    outline-offset: 2px;
}

/* ── Tercih penceresi ── */
.cc-dialog {
    position: fixed;
    inset: 0;
    z-index: 1065;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
}

.cc-dialog-panel {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
    padding: 22px 22px 18px;
    color: #1e293b;
}

.cc-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.cc-dialog-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.cc-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.cc-dialog-intro {
    font-size: .82rem;
    line-height: 1.55;
    color: #475569;
    margin: 0 0 14px;
}

.cc-cat {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.cc-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cc-cat-name {
    font-size: .88rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.cc-cat-desc {
    font-size: .76rem;
    line-height: 1.5;
    color: #64748b;
    margin: 6px 0 0;
}

.cc-always {
    font-size: .72rem;
    font-weight: 600;
    color: #15803d;
    white-space: nowrap;
}

/* Erişilebilir toggle (gerçek checkbox + görsel iz) */
.cc-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}

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

.cc-switch-track {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: background .2s ease;
}

.cc-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s ease;
}

.cc-switch input:checked + .cc-switch-track {
    background: var(--accent, #A9342B);
}

.cc-switch input:checked + .cc-switch-track::after {
    transform: translateX(20px);
}

.cc-dialog-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.cc-dialog-foot {
    font-size: .74rem;
    color: #64748b;
    margin: 12px 0 0;
    text-align: center;
}

/* ── Mobil / tablet: kompakt alt sayfa (bottom sheet), sabit alt barların üstünde ── */
@media (max-width: 991.98px) {
    .cc-banner {
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
        bottom: calc(var(--cc-bottom-offset, 0px) + 8px);
        padding: 12px 14px 12px;
        border-radius: 14px;
    }

    .cc-banner-title {
        font-size: .84rem;
        margin-bottom: 4px;
    }

    .cc-banner-text {
        font-size: .74rem;
        line-height: 1.45;
        margin-bottom: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .cc-btn {
        min-height: 40px;
        font-size: .76rem;
        padding: 8px 6px;
    }

    .cc-dialog {
        align-items: flex-end;
        padding: 0;
    }

    .cc-dialog-panel {
        max-width: none;
        max-height: 88vh;
        border-radius: 18px 18px 0 0;
        padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 359.98px) {
    .cc-actions,
    .cc-dialog-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner {
        animation: none;
    }
}
