/* ============================================
   BANDEAU COOKIES — CNIL COMPLIANT
   ============================================ */

/* Bandeau principal */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: white;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    border-top: 3px solid #DC2626;
    padding: 1.5rem 2rem;
    font-family: 'Inter', sans-serif;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-text h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 0.35rem 0;
}

.cookie-banner-text p {
    font-size: 0.85rem;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

.cookie-banner-text a {
    color: #DC2626;
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.cookie-btn-accept {
    background-color: #DC2626;
    color: white;
}
.cookie-btn-accept:hover {
    background-color: #B91C1C;
}

.cookie-btn-reject {
    background-color: #F3F4F6;
    color: #374151;
    border: 1px solid #D1D5DB;
}
.cookie-btn-reject:hover {
    background-color: #E5E7EB;
}

.cookie-btn-customize {
    background-color: transparent;
    color: #6B7280;
    border: 1px solid #D1D5DB;
}
.cookie-btn-customize:hover {
    background-color: #F9FAFB;
    color: #374151;
}

/* ============================================
   PANNEAU DE PERSONNALISATION
   ============================================ */
.cookie-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cookie-panel-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-panel {
    background: white;
    border-radius: 16px;
    max-width: 540px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.cookie-panel-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.cookie-panel-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 0.25rem 0;
}

.cookie-panel-header p {
    font-size: 0.8rem;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

.cookie-panel-body {
    padding: 1rem 1.5rem;
}

.cookie-category {
    padding: 1rem 0;
    border-bottom: 1px solid #F3F4F6;
}
.cookie-category:last-child {
    border-bottom: none;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.cookie-category-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1F2937;
}

.cookie-category-desc {
    font-size: 0.8rem;
    color: #6B7280;
    line-height: 1.4;
}

.cookie-category-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    background-color: #D1FAE5;
    color: #065F46;
    font-weight: 600;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #D1D5DB;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #DC2626;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #10B981;
    cursor: not-allowed;
}

/* Footer du panneau */
.cookie-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   BOUTON FLOTTANT — MODIFIER CONSENTEMENT
   ============================================ */
.cookie-settings-btn {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 99998;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #E5E7EB;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    opacity: 0;
    visibility: hidden;
}

.cookie-settings-btn.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 1.25rem;
    }
    .cookie-banner-inner {
        flex-direction: column;
        gap: 1rem;
    }
    .cookie-banner-buttons {
        width: 100%;
    }
    .cookie-btn {
        flex: 1;
        text-align: center;
    }
}
