/* cookieBanner.css */

/* ===== BANDEAU ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-top: 3px solid #007bff;
    padding: 20px 30px;
    font-family: 'Lato', sans-serif;
    display: none; /* Masqué par défaut, affiché par JS */
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cookie-banner-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-banner-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.cookie-banner-body p {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.cookie-banner-small {
    font-size: 0.85rem !important;
    color: #777 !important;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.cookie-banner-actions .btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.cookie-banner-actions .btn-primary {
    color: #fff;
}

.cookie-banner-actions .btn-primary:hover {
}

.cookie-banner-actions .btn-secondary {
    background: #6c757d;
    color: #fff;
}

.cookie-banner-actions .btn-secondary:hover {
    background: #5a6268;
}

.cookie-banner-actions .btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
}

.cookie-banner-actions .btn-outline-secondary:hover {
    background: #6c757d;
    color: #fff;
}

.cookie-banner-footer {
    font-size: 0.85rem;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

.cookie-banner-footer a {
    color: #007bff;
    text-decoration: none;
}

.cookie-banner-footer a:hover {
    text-decoration: underline;
}

/* ===== MODALE ===== */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: none; /* Masqué par défaut */
    align-items: center;
    justify-content: center;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0 8px;
    transition: color 0.3s ease;
}

.cookie-modal-close:hover {
    color: #333;
}

.cookie-modal-body {
    padding: 24px;
}

.cookie-modal-body > p {
    margin-bottom: 20px;
    color: #555;
    font-size: 0.95rem;
}

.cookie-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-left: 4px solid #007bff;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cookie-category-header strong {
    font-size: 0.95rem;
}

.cookie-category-desc {
    margin: 8px 0 0 0;
    font-size: 0.85rem;
    color: #666;
    padding-left: 55px;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* ===== TOGGLE SWITCH ===== */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
    background: #007bff;
}

.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(22px);
}

.cookie-switch input:disabled + .cookie-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

.cookie-modal-footer .btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px 20px;
    }

    .cookie-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-banner-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .cookie-category-header {
        flex-wrap: wrap;
    }

    .cookie-category-desc {
        padding-left: 0;
        margin-top: 10px;
    }

    .cookie-banner-header h3 {
        font-size: 1rem;
    }
}

/* ===== OVERLAY SOMBRE ===== */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6); /* Fond sombre semi-transparent */
    backdrop-filter: blur(2px);      /* Effet de flou (optionnel) */
    z-index: 99998;                    /* Juste en dessous du bandeau */
    display: none;                    /* Masqué par défaut */
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== BLOCAGE DU SITE ===== */
body.cookie-banner-active {
    overflow: hidden; /* Empêche le scroll de la page */
}

body.cookie-banner-active > *:not(#cookieBanner):not(#cookieModal):not(#cookieOverlay):not(script):not(link):not(style) {
    pointer-events: none; /* Désactive les clics sur tout le site */
    user-select: none;    /* Empêche la sélection de texte */
}

/* Le bandeau et la modale restent cliquables */
#cookieBanner,
#cookieModal {
    pointer-events: auto !important;
}

/* ===== BANDEAU (ajustement z-index) ===== */
.cookie-banner {
    z-index: 99999; /* Au-dessus de l'overlay */
    /* ... reste du CSS inchangé ... */
}

/* ===== MODALE (ajustement z-index) ===== */
.cookie-modal {
    z-index: 100000; /* Au-dessus du bandeau */
    /* ... reste du CSS inchangé ... */
}