/* =====================================================================
   cookies.css — Bandeau consentement cookies (RGPD/CNIL)
   ===================================================================== */

/* ── Première vue : carte centrée ── */
#cookie-banner {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity .34s ease;
    will-change: opacity;
}

#cookie-banner.visible {
    opacity: 1;
}

.cookie-banner__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}

.cookie-banner__card {
    position: relative;
    width: 100%;
    max-width: 30rem;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    color: #1a1a1a;
    border-radius: 1rem;
    padding: 2rem 1.75rem 1.5rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    transform: translateY(14px) scale(.985);
    transition: transform .34s cubic-bezier(.22, 1, .36, 1);
}

#cookie-banner.visible .cookie-banner__card {
    transform: none;
}

.cookie-banner__logo {
    display: block;
    height: auto;
    width: 170px;
    margin: 0 auto 1.25rem;
}

.cookie-banner__title {
    font-family: 'Cormorant Garamond', 'Montserrat', serif;
    font-size: 1.45rem;
    line-height: 1.25;
    margin: 0 0 .75rem;
}

.cookie-banner__text {
    font-size: .82rem;
    line-height: 1.65;
    color: #555;
    margin: 0 0 1.5rem;
}

.cookie-banner__text a {
    color: #C0392B;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
    color: #a93226;
}

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
    justify-content: center;
}

.cookie-btn-refuse,
.cookie-btn-accept {
    padding: .5rem 1.125rem;
    border-radius: 9999px;
    font-size: .78rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    min-height: 36px;
    transition: background .2s, border-color .2s, color .2s;
}

.cookie-btn-refuse {
    border: 1.5px solid #cfcfcf;
    background: transparent;
    color: #555;
}

.cookie-btn-refuse:hover,
.cookie-btn-refuse:focus-visible {
    border-color: #1a1a1a;
    color: #1a1a1a;
    outline: none;
}

.cookie-btn-accept {
    border: 1.5px solid #C0392B;
    background: #C0392B;
    color: #fff;
}

.cookie-btn-accept:hover,
.cookie-btn-accept:focus-visible {
    background: #a93226;
    border-color: #a93226;
    outline: none;
}

/* ── Bouton "Paramétrer" (lien discret) ── */
.cookie-btn-settings {
    padding: .5rem 1.125rem;
    border-radius: 9999px;
    font-size: .78rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    min-height: 36px;
    border: none;
    background: transparent;
    color: #777;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s;
}

.cookie-btn-settings:hover,
.cookie-btn-settings:focus-visible {
    color: #1a1a1a;
    outline: none;
}

/* ── Décalage si bouton flottant visible (mobile) ── */
@media (max-width: 1023px) {
    body.has-float-call #cookie-banner {
        bottom: 68px;
    }
}

/* =====================================================================
   Panneau de réglages "Paramétrer"
   ===================================================================== */
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.cookie-modal.visible {
    display: flex;
}

.cookie-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
    animation: cookieFade .25s ease;
}

.cookie-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 32rem;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    color: #1a1a1a;
    border-radius: 1rem;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    animation: cookiePop .28s cubic-bezier(.22, 1, .36, 1);
}

@keyframes cookieFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cookiePop  { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.cookie-modal__x {
    position: absolute;
    top: .75rem;
    right: 1rem;
    border: none;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #9a9a9a;
    cursor: pointer;
    transition: color .2s;
}
.cookie-modal__x:hover { color: #1a1a1a; }

.cookie-modal__title {
    font-family: 'Cormorant Garamond', 'Montserrat', serif;
    font-size: 1.5rem;
    margin: 0 0 .5rem;
    padding-right: 1.5rem;
}

.cookie-modal__intro {
    font-size: .8125rem;
    line-height: 1.6;
    color: #555;
    margin: 0 0 1.25rem;
}

.cookie-purposes {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    border-top: 1px solid #eee;
}

.cookie-purpose {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cookie-purpose__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-purpose__name {
    font-weight: 600;
    font-size: .875rem;
}

.cookie-purpose__always {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #2e7d52;
    white-space: nowrap;
}

.cookie-purpose__desc {
    font-size: .78rem;
    line-height: 1.55;
    color: #666;
    margin: .4rem 0 0;
}

/* ── Interrupteur (toggle) ── */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.cookie-switch__slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 9999px;
    transition: background .22s;
}
.cookie-switch__slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .22s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.cookie-switch input:checked + .cookie-switch__slider {
    background: #C0392B;
}
.cookie-switch input:checked + .cookie-switch__slider::before {
    transform: translateX(20px);
}
.cookie-switch input:focus-visible + .cookie-switch__slider {
    outline: 2px solid #C0392B;
    outline-offset: 2px;
}
.cookie-switch__sr {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.cookie-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
    justify-content: flex-end;
}

/* Réutilise .cookie-btn-refuse / .cookie-btn-accept mais sur fond clair */
.cookie-modal__actions .cookie-btn-refuse {
    border: 1.5px solid #cfcfcf;
    color: #555;
}
.cookie-modal__actions .cookie-btn-refuse:hover,
.cookie-modal__actions .cookie-btn-refuse:focus-visible {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

@media (max-width: 480px) {
    .cookie-modal__actions { justify-content: stretch; }
    .cookie-modal__actions button { flex: 1 1 100%; }
}
