/* La Boîte – Consent Manager */

.lbcm[hidden],
.lbcm-manage[hidden],
.lbcm [hidden] {
    display: none !important;
}

.lbcm {
    position: fixed !important;
    inset: auto 0 0 0;
    z-index: 2147483000 !important;
    display: flex;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    box-sizing: border-box;
}

.lbcm *,
.lbcm *::before,
.lbcm *::after {
    box-sizing: border-box;
}

.lbcm-banner {
    pointer-events: auto;
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px 28px;
    border-radius: 8px;
    background: var(--lbcm-banner-bg, var(--lbcm-bg));
    color: var(--lbcm-text);
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    animation: lbcm-in .35s ease-out both;
}

.lbcm-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: inherit;
}

.lbcm-text {
    margin: 0;
}

.lbcm-text p {
    margin: 0 0 8px;
    color: inherit;
}

.lbcm .lbcm-text a,
.lbcm .lbcm-policy {
    color: var(--lbcm-link) !important;
    /* Bordure plutôt que text-decoration : certains thèmes (Tailwind v4)
       retirent le soulignement des liens avec un !important en @layer,
       qui l'emporte sur tout !important hors layer. */
    text-decoration: none;
    border-bottom: 1px solid currentColor !important;
}

.lbcm-prefs {
    margin-top: 16px;
    border-top: 1px solid currentColor;
    border-color: color-mix(in srgb, currentColor 25%, transparent);
}

.lbcm-cat {
    padding: 12px 0;
    border-bottom: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}

.lbcm-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
}

.lbcm-switch input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--lbcm-btn-bg);
}

.lbcm-switch input:disabled {
    cursor: not-allowed;
}

.lbcm-cat-desc {
    margin: 4px 0 0 28px;
    font-size: 14px;
    opacity: .85;
}

.lbcm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/* « Tout refuser » et « Tout accepter » ont exactement le même style :
   le refus doit être aussi simple et visible que l'acceptation (Loi 25). */
.lbcm-btn {
    flex: 1 1 180px;
    min-height: 44px;
    margin: 0;
    padding: 10px 18px;
    border: 2px solid var(--lbcm-btn-bg);
    border-radius: 6px;
    background: var(--lbcm-btn-bg);
    color: var(--lbcm-btn-text);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.lbcm-btn--ghost {
    background: transparent;
    color: var(--lbcm-text);
}

.lbcm-btn:hover {
    opacity: .9;
}

.lbcm-btn:focus-visible,
.lbcm-switch input:focus-visible,
.lbcm-manage:focus-visible,
.lbcm-policy:focus-visible {
    outline: 3px solid var(--lbcm-link);
    outline-offset: 2px;
}

.lbcm-manage {
    position: fixed !important;
    left: 16px;
    bottom: 16px;
    z-index: 2147482999 !important;
    margin: 0;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--lbcm-bg);
    color: var(--lbcm-text);
    font-size: 13px;
    line-height: 1.2;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    cursor: pointer;
    opacity: .85;
}

.lbcm-manage:hover {
    opacity: 1;
}

.lbcm-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

@keyframes lbcm-in {
    from {
        transform: translateY(24px);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .lbcm {
        padding: 0;
    }

    .lbcm-banner {
        max-height: 100vh;
        border-radius: 0;
        padding: 20px 16px;
    }

    .lbcm-btn {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lbcm-banner {
        animation: none;
    }
}
