/**
 * CCIMA — Bannière informative Matomo (exemptée de consentement CNIL)
 * Couleur : fond bleu marine primaire (#2F386F)
 */

/* ============================================================
   CONTENEUR PRINCIPAL
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #2F386F;
    color: #ffffff;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    border-top: 3px solid #F3A152;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    
    /* État initial : masqué avec animation */
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    pointer-events: none;
}

.cookie-banner.cookie-banner--visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   INNER (max-width + padding)
   ============================================================ */
.cookie-banner__inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ============================================================
   CONTENU (message)
   ============================================================ */
.cookie-banner__content {
    flex: 1;
}

.cookie-banner__message {
    margin: 0;
    color: #ffffff;
    font-size: 0.875rem;
    line-height: 1.5;
}

.cookie-banner__message strong {
    font-weight: 600;
    color: #F3A152;
}

/* Message uBlock détecté */
.cookie-banner__blocked {
    margin: 0.5rem 0 0 0;
    font-size: 0.8125rem;
    color: #A8A8B1;
    display: none;
}

.cookie-banner__blocked--visible {
    display: block;
}

.cookie-banner__blocked em {
    font-style: italic;
}

/* ============================================================
   ACTIONS (lien + bouton)
   ============================================================ */
.cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Lien "En savoir plus" */
.cookie-banner__link {
    color: #F3A152;
    text-decoration: underline;
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.cookie-banner__link:hover,
.cookie-banner__link:focus {
    color: #ffffff;
    text-decoration: none;
}

.cookie-banner__link:focus-visible {
    outline: 2px solid #F3A152;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Bouton principal */
.cookie-banner__button {
    background-color: #F3A152;
    color: #1a1a2e;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1.25rem;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.cookie-banner__button:hover {
    background-color: #e08f3e;
}

.cookie-banner__button:active {
    transform: translateY(1px);
}

.cookie-banner__button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ============================================================
   RESPONSIVE (mobile)
   ============================================================ */
@media (max-width: 640px) {
    .cookie-banner__inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 0.75rem;
    }

    .cookie-banner__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .cookie-banner__message {
        font-size: 0.8125rem;
    }
}

/* Très petits écrans */
@media (max-width: 380px) {
    .cookie-banner__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner__button {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   ACCESSIBILITÉ — prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-banner-ublock {
        transition: none;
    }
}

/* ============================================================
   BANDEAU UBLOCK (message discret)
   ============================================================ */
.cookie-banner-ublock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background-color: #FFF3E0;
    color: #E65100;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8125rem;
    line-height: 1.4;
    border-top: 2px solid #FFB74D;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;

    /* État initial : masqué */
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    pointer-events: none;
}

.cookie-banner-ublock.cookie-banner--visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.cookie-banner-ublock__text {
    flex: 1;
    text-align: center;
}

.cookie-banner-ublock__text em {
    font-style: italic;
}

/* Bouton fermeture */
.cookie-banner-ublock__close {
    background: none;
    border: none;
    color: #E65100;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.cookie-banner-ublock__close:hover {
    background-color: #FFE0B2;
    color: #BF360C;
}

.cookie-banner-ublock__close:focus-visible {
    outline: 2px solid #E65100;
    outline-offset: 1px;
}

/* Responsive */
@media (max-width: 480px) {
    .cookie-banner-ublock {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}
