/* public/css/cookie-consent.css */
/* Compatible avec le thème DaisyUI "Piton" (variables CSS définies dans assets/styles/app.css) */
/* Aucune dépendance externe. Responsive mobile-first. */

/* ========== BANDEAU COOKIES ========== */

.cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: min(92vw, 560px);
    background: oklch(100% 0 0);
    border: 1px solid oklch(90% 0 0);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: cookie-slide-up 0.3s ease;
    font-family: inherit;
}

.cookie-banner[hidden] {
    display: none !important;
}

@keyframes cookie-slide-up {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.cookie-banner__inner {
    padding: 1.5rem;
}

/* En-tête */
.cookie-banner__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cookie-banner__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.cookie-banner__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: oklch(21% 0.006 285.885);
    margin: 0;
}

/* Vue */
.cookie-banner__view[hidden] {
    display: none !important;
}

/* Texte */
.cookie-banner__text {
    font-size: 0.875rem;
    color: oklch(40% 0.006 285.885);
    line-height: 1.6;
    margin: 0 0 0.5rem;
}

.cookie-banner__text--small {
    font-size: 0.8rem;
    color: oklch(55% 0.006 285.885);
    margin: 0 0 1.25rem;
}

.cookie-banner__link {
    color: oklch(57% 0.245 27.325);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner__link:hover {
    opacity: 0.8;
}

/* Boutons d'action */
.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    justify-content: flex-end;
}

.cookie-banner__actions--customize {
    justify-content: space-between;
}

.cookie-banner__btn {
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    border: none;
    line-height: 1.4;
    white-space: nowrap;
}

.cookie-banner__btn--primary {
    background: oklch(57% 0.245 27.325);
    color: oklch(98% 0.003 247.858);
}

.cookie-banner__btn--primary:hover {
    opacity: 0.88;
}

.cookie-banner__btn--outline {
    background: transparent;
    color: oklch(21% 0.006 285.885);
    border: 1.5px solid oklch(85% 0 0);
}

.cookie-banner__btn--outline:hover {
    background: oklch(97% 0 0);
}

.cookie-banner__btn--ghost {
    background: transparent;
    color: oklch(45% 0.006 285.885);
}

.cookie-banner__btn--ghost:hover {
    background: oklch(97% 0 0);
}

/* Catégories */
.cookie-banner__categories {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cookie-banner__category {
    background: oklch(98% 0 0);
    border: 1px solid oklch(92% 0 0);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
}

.cookie-banner__category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cookie-banner__category-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: oklch(21% 0.006 285.885);
    display: block;
    margin-bottom: 0.25rem;
    cursor: pointer;
}

.cookie-banner__category-desc {
    font-size: 0.78rem;
    color: oklch(55% 0.006 285.885);
    line-height: 1.5;
    margin: 0;
}

.cookie-banner__always-on {
    font-size: 0.75rem;
    font-weight: 600;
    color: oklch(57% 0.245 27.325);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

/* Toggle switch */
.cookie-banner__toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 2.75rem;
    height: 1.5rem;
    background: oklch(85% 0 0);
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.cookie-banner__toggle::after {
    content: '';
    position: absolute;
    width: 1.1rem;
    height: 1.1rem;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 0.2rem;
    transform: translateY(-50%);
    transition: left 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cookie-banner__toggle:checked {
    background: oklch(57% 0.245 27.325);
}

.cookie-banner__toggle:checked::after {
    left: calc(100% - 1.3rem);
}

.cookie-banner__toggle:focus-visible {
    outline: 2px solid oklch(57% 0.245 27.325);
    outline-offset: 2px;
}

/* ========== BOUTON GESTION COOKIES (footer) ========== */

#cookie-reopen-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

/* ========== FOOTER LÉGAL ========== */

.footer-legal {
    width: 100%;
}

/* Responsive : sur mobile, actions en colonne */
@media (max-width: 480px) {
    .cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        border-radius: 0.75rem 0.75rem 0 0;
        border-bottom: none;
    }

    .cookie-banner__actions {
        flex-direction: column;
    }

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

    .cookie-banner__actions--customize {
        flex-direction: row;
        flex-wrap: wrap;
    }
}
