/* ===================================
    Mady Dans - Çerez Tercih Paneli
    (KVKK + Google Consent Mode v2)
====================================== */

.mady-cookie-consent {
    /*
     * Marka pembesi (--base-color: #ff41b2) beyaz üzerinde ~3.16:1 kontrast verir ve
     * WCAG AA (metin için 4.5:1) eşiğini geçemez. Panelin tüm metin/buton kontrastı
     * gerektiren yerlerinde aynı ton ailesinden, beyazla ~6.2:1 kontrast sağlayan daha
     * koyu bir pembe (#b8127a) kullanılır.
     */
    --mccp-pink: #b8127a;
    --mccp-dark: var(--dark-gray, #393334);
    --mccp-light: var(--very-light-gray, #f8f2f3);
    font-family: var(--primary-font, "Mulish", sans-serif);
}

.mady-cookie-consent[hidden] {
    display: none !important;
}

/* Alt banner: sabit konumlandırma sayesinde sayfa akışını etkilemez (CLS oluşturmaz) */
.mady-cookie-consent__banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    background: #fff;
    color: var(--mccp-dark);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    padding: 22px 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.mady-cookie-consent__banner-text {
    flex: 1 1 320px;
    min-width: 0;
}

.mady-cookie-consent__desc {
    margin: 0;
    font-size: 14px;
    line-height: 22px;
    color: var(--mccp-dark);
}

.mady-cookie-consent__desc a {
    color: var(--mccp-pink);
    text-decoration: underline;
}

.mady-cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.mady-cookie-consent__actions--modal {
    margin-top: 24px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.mccp-btn {
    display: inline-block;
    border-radius: 30px;
    padding: 11px 22px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    border: 2px solid var(--mccp-dark);
    background: transparent;
    color: var(--mccp-dark);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.mccp-btn--outline:hover,
.mccp-btn--outline:focus-visible {
    background: var(--mccp-dark);
    color: #fff;
}

.mccp-btn--solid {
    background: var(--mccp-pink);
    border-color: var(--mccp-pink);
    color: #fff;
}

.mccp-btn--solid:hover,
.mccp-btn--solid:focus-visible {
    opacity: 0.85;
}

.mccp-btn:focus-visible,
.mady-cookie-consent__modal-close:focus-visible,
.mccp-switch input:focus-visible + .mccp-switch__knob {
    outline: 3px solid #1a73e8;
    outline-offset: 2px;
}

/* Modal açıkken arka plan kaydırmasını kontrollü biçimde kilitle */
html.mccp-modal-open,
html.mccp-modal-open body {
    overflow: hidden;
}

/* Tercih modalı */
.mady-cookie-consent__modal[hidden] {
    display: none !important;
}

.mady-cookie-consent__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
}

.mady-cookie-consent__modal-inner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100000;
    background: #fff;
    color: var(--mccp-dark);
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    border-radius: 16px;
    padding: 34px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.mady-cookie-consent__modal-title {
    font-family: var(--alt-font, "Marcellus", serif);
    font-size: 24px;
    margin: 0 0 14px;
    color: var(--mccp-dark);
    padding-right: 30px;
}

.mady-cookie-consent__modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--mccp-dark);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
}

.mady-cookie-consent__modal-close:hover {
    background: var(--mccp-light);
}

.mccp-category {
    border-top: 1px solid #eee;
    padding: 16px 0;
}

.mccp-category:first-of-type {
    border-top: none;
    padding-top: 20px;
}

.mccp-category__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mccp-category__name {
    font-weight: 600;
    font-size: 15px;
    color: var(--mccp-dark);
    flex: 1 1 auto;
    cursor: pointer;
}

.mccp-category__always {
    font-size: 12px;
    /* --medium-gray (#8b8883) beyaz üzerinde ~3.5:1 kontrast verir, AA'yı (4.5:1)
       karşılamaz; burada koyulaştırılmış bir gri kullanılır. */
    color: #6e6a68;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mccp-category__desc {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 20px;
    color: #6e6a68;
}

/* Switch (checkbox) */
.mccp-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.mccp-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.mccp-switch__knob {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.2s ease;
}

.mccp-switch__knob::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.mccp-switch input:checked + .mccp-switch__knob {
    background: var(--mccp-pink);
}

.mccp-switch input:checked + .mccp-switch__knob::before {
    transform: translateX(20px);
}

.mccp-switch--disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mccp-switch--disabled .mccp-switch__knob {
    background: var(--mccp-pink);
}

.mccp-switch--disabled .mccp-switch__knob::before {
    transform: translateX(20px);
}

/* Footer "Çerez Tercihleri" bağlantısı */
.mady-cookie-preferences-link {
    cursor: pointer;
}

@media (max-width: 767px) {
    .mady-cookie-consent__banner {
        padding: 18px 18px 22px;
        flex-direction: column;
        align-items: stretch;
    }

    .mady-cookie-consent__actions {
        justify-content: stretch;
    }

    .mccp-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .mady-cookie-consent__modal-inner {
        padding: 26px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mccp-btn,
    .mccp-switch__knob,
    .mccp-switch__knob::before {
        transition: none !important;
    }
}
