/* Cookie Consent Banner - Ultra compact et discret */
.cookie-consent-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    animation: slideInBottom 0.3s ease;
    padding: 0 20px 20px 20px; /* Marges latérales */
}

.cookie-consent-overlay.show {
    display: block;
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-banner {
    background: #ffffff;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    width: 100%;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-top: 2px solid #0066cc;
    border-radius: 12px 12px 0 0; /* Coins arrondis en haut */
}

.cookie-consent-header {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: #ffffff !important; /* Force le blanc */
    padding: 8px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-consent-header h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline;
    color: #ffffff !important; /* Force le blanc */
}

.cookie-consent-header p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
    display: none; /* Masqué pour gagner de la place */
    color: #ffffff !important; /* Force le blanc */
}

.cookie-consent-body {
    padding: 12px 20px;
}

.cookie-consent-description {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 12px;
}

.cookie-consent-description strong {
    color: #0066cc;
}

.cookie-consent-description p:last-child {
    margin-top: 6px;
}

.cookie-options {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.cookie-options.show {
    display: block;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cookie-option:hover {
    background: #e9ecef;
}

.cookie-option-info h4 {
    margin: 0;
    font-size: 0.8rem;
    color: #333;
    font-weight: 600;
}

.cookie-option-info p {
    margin: 0;
    font-size: 0.7rem;
    color: #666;
    line-height: 1.2;
    display: none; /* Masqué pour gagner de la place */
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 22px;
}

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

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

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-consent-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: nowrap;
    flex-direction: row-reverse; /* Inverse l'ordre sur desktop : Accepter à droite */
}

.cookie-btn {
    flex: 1;
    min-width: auto;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 102, 204, 0.35);
}

.cookie-btn-secondary {
    background: #f0f0f0;
    color: #333;
    font-size: 0.75rem;
}

.cookie-btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.cookie-btn-link {
    background: none;
    color: #0066cc;
    text-decoration: underline;
    padding: 8px 10px;
    min-width: auto;
    flex: 0;
    font-size: 0.75rem;
}

.cookie-btn-link:hover {
    color: #0052a3;
}

/* Cookie Preferences Button (floating) */
.cookie-preferences-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #0066cc;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.cookie-preferences-btn.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-preferences-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

/* Responsive - Mobile ultra compact */
@media (max-width: 768px) {
    .cookie-consent-overlay {
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0 10px 10px 10px; /* Marges latérales sur mobile */
    }

    .cookie-consent-banner {
        width: 100%;
        max-width: 100%;
        border-radius: 8px 8px 0 0; /* Coins arrondis en haut sur mobile */
    }

    .cookie-consent-header {
        padding: 6px 15px;
    }

    .cookie-consent-header h2 {
        font-size: 0.85rem;
    }

    .cookie-consent-body {
        padding: 10px 15px;
    }

    .cookie-consent-description {
        font-size: 0.75rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .cookie-consent-description p {
        display: none; /* Masquer le lien politique sur mobile pour gagner de la place */
    }

    /* Layout mobile spécifique :
       - Ligne 1 : Refuser (gauche) + Personnaliser (droite)
       - Ligne 2 : Accepter (pleine largeur)
    */
    .cookie-consent-actions {
        flex-direction: row; /* Retour au sens normal */
        flex-wrap: wrap;
        gap: 4px;
    }

    #accept-all-cookies {
        order: 3; /* Passe en dernier */
        width: 100% !important;
        flex: 1 1 100% !important; /* Prend toute la largeur */
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }

    #reject-all-cookies {
        order: 1; /* Premier (gauche) */
        flex: 1 1 calc(50% - 2px) !important; /* 50% moins la moitié du gap */
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    #customize-cookies {
        order: 2; /* Deuxième (droite) */
        flex: 1 1 calc(50% - 2px) !important; /* 50% moins la moitié du gap */
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    .cookie-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .cookie-btn-secondary {
        font-size: 0.7rem;
        padding: 6px 8px;
    }

    .cookie-btn-link {
        font-size: 0.7rem;
        padding: 6px 8px;
    }

    .cookie-option {
        padding: 4px 6px;
        margin-bottom: 3px;
    }

    .cookie-option-info h4 {
        font-size: 0.75rem;
    }

    .cookie-toggle {
        width: 36px;
        height: 20px;
    }

    .cookie-toggle-slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }

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

    .cookie-preferences-btn {
        bottom: 15px;
        left: 15px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}
