/* =====================================================================
   Bandeau cookies + gestion du consentement
   ---------------------------------------------------------------------
   Design aligné sur la charte PrixKdo : Poppins, orange #f78116,
   cartes blanches à coins arrondis et ombre chaude (cf. home-redesign).
   Chargé après app.css dans base.html.twig ; retirer la balise <link>
   et l'include du partiel suffit à désactiver la fonctionnalité.
   Barème rem : 1rem = 10px (html { font-size: 62.5% }).
   ===================================================================== */

:root {
    --cc-orange: #f78116;
    --cc-orange-dark: #d96c05;
    --cc-ink: #2b2b2b;
    --cc-muted: #6d6d6d;
    --cc-border: #ececec;
    --cc-shadow: 0 2rem 4.5rem -1.2rem rgba(120, 60, 0, 0.35);
}

.cc-root,
.cc-root * {
    box-sizing: border-box;
}

.cc-root {
    font-family: 'Poppins', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.cc-root[hidden],
.cc-root [hidden] {
    display: none !important;
}

/* --------------------------------------------------------------
   1. Bandeau (barre basse)
   -------------------------------------------------------------- */
.cc-banner {
    position: fixed;
    left: 1.6rem;
    right: 1.6rem;
    bottom: 1.6rem;
    z-index: 10600;
    max-width: 116rem;
    margin: 0 auto;
    padding: 2.2rem 2.6rem;
    background: #fff;
    border: 1px solid var(--cc-border);
    border-top: .4rem solid var(--cc-orange);
    border-radius: 1.4rem;
    box-shadow: var(--cc-shadow);
    display: flex;
    align-items: center;
    gap: 2.4rem;
    transform: translateY(1.5rem);
    opacity: 0;
    transition: opacity .35s ease, transform .35s ease;
}

.cc-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.cc-banner__icon {
    flex: 0 0 5.2rem;
    width: 5.2rem;
    height: 5.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: #fff;
    background: linear-gradient(135deg, var(--cc-orange), var(--cc-orange-dark));
    border-radius: 50%;
}

.cc-banner__body {
    flex: 1 1 auto;
    min-width: 0;
}

.cc-banner__title {
    margin: 0 0 .5rem;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cc-ink);
}

.cc-banner__text {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.6;
    color: var(--cc-muted);
}

.cc-banner__text a {
    color: var(--cc-orange-dark);
    font-weight: 600;
    text-decoration: underline;
}

.cc-banner__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --------------------------------------------------------------
   2. Boutons
   -------------------------------------------------------------- */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 1.15rem 2.1rem;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .02em;
    text-align: center;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 3rem;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.cc-btn:focus-visible {
    outline: 2px solid var(--cc-orange-dark);
    outline-offset: 2px;
}

.cc-btn--primary {
    color: #fff;
    background: var(--cc-orange);
    border-color: var(--cc-orange);
    box-shadow: 0 .8rem 1.8rem -.6rem rgba(247, 129, 22, .6);
}

.cc-btn--primary:hover {
    background: var(--cc-orange-dark);
    border-color: var(--cc-orange-dark);
    color: #fff;
}

.cc-btn--ghost {
    color: var(--cc-ink);
    background: #f4f4f4;
    border-color: #f4f4f4;
}

.cc-btn--ghost:hover {
    background: #e9e9e9;
    border-color: #e0e0e0;
    color: var(--cc-ink);
}

.cc-btn--link {
    padding-left: .6rem;
    padding-right: .6rem;
    color: var(--cc-muted);
    background: transparent;
    text-decoration: underline;
}

.cc-btn--link:hover {
    color: var(--cc-ink);
}

/* --------------------------------------------------------------
   3. Panneau de préférences (modale)
   -------------------------------------------------------------- */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(30, 18, 6, .55);
    opacity: 0;
    transition: opacity .3s ease;
}

.cc-modal.is-visible {
    opacity: 1;
}

.cc-modal__dialog {
    width: 100%;
    max-width: 58rem;
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 1.6rem;
    box-shadow: var(--cc-shadow);
    transform: translateY(1.5rem) scale(.98);
    transition: transform .3s ease;
    overflow: hidden;
}

.cc-modal.is-visible .cc-modal__dialog {
    transform: translateY(0) scale(1);
}

.cc-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 1.4rem;
    padding: 2.4rem 2.6rem 1.8rem;
    border-bottom: 1px solid var(--cc-border);
}

.cc-modal__header .cc-banner__icon {
    flex-basis: 4.4rem;
    width: 4.4rem;
    height: 4.4rem;
    font-size: 2rem;
}

.cc-modal__heading {
    flex: 1 1 auto;
}

.cc-modal__title {
    margin: 0 0 .4rem;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--cc-ink);
}

.cc-modal__subtitle {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--cc-muted);
}

.cc-modal__close {
    flex: 0 0 auto;
    width: 3.4rem;
    height: 3.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--cc-muted);
    background: #f4f4f4;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.cc-modal__close:hover {
    background: #e9e9e9;
    color: var(--cc-ink);
}

.cc-modal__body {
    padding: 1.4rem 2.6rem;
    overflow-y: auto;
}

.cc-category {
    padding: 1.8rem 0;
    border-bottom: 1px solid var(--cc-border);
    display: flex;
    align-items: flex-start;
    gap: 1.6rem;
}

.cc-category:last-child {
    border-bottom: none;
}

.cc-category__text {
    flex: 1 1 auto;
    min-width: 0;
}

.cc-category__name {
    margin: 0 0 .4rem;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--cc-ink);
}

.cc-category__desc {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--cc-muted);
}

/* --------------------------------------------------------------
   4. Interrupteur (toggle)
   -------------------------------------------------------------- */
.cc-switch {
    flex: 0 0 auto;
    position: relative;
    width: 4.6rem;
    height: 2.6rem;
    margin-top: .2rem;
}

.cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cc-switch__track {
    position: absolute;
    inset: 0;
    background: #d5d5d5;
    border-radius: 3rem;
    transition: background-color .2s ease;
}

.cc-switch__track::before {
    content: "";
    position: absolute;
    top: .3rem;
    left: .3rem;
    width: 2rem;
    height: 2rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 .2rem .4rem rgba(0, 0, 0, .25);
    transition: transform .2s ease;
}

.cc-switch input:checked + .cc-switch__track {
    background: var(--cc-orange);
}

.cc-switch input:checked + .cc-switch__track::before {
    transform: translateX(2rem);
}

.cc-switch input:focus-visible + .cc-switch__track {
    outline: 2px solid var(--cc-orange-dark);
    outline-offset: 2px;
}

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

.cc-switch input:disabled + .cc-switch__track {
    background: var(--cc-orange);
    opacity: .45;
}

.cc-modal__footer {
    padding: 1.8rem 2.6rem 2.2rem;
    border-top: 1px solid var(--cc-border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.cc-modal__footer .cc-btn {
    flex: 1 1 auto;
}

/* --------------------------------------------------------------
   5. Bouton flottant de rappel (après consentement)
   -------------------------------------------------------------- */
.cc-reopen {
    position: fixed;
    left: 1.8rem;
    bottom: 1.8rem;
    z-index: 10500;
    width: 4.6rem;
    height: 4.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--cc-orange-dark);
    background: #fff;
    border: 1px solid var(--cc-border);
    border-radius: 50%;
    box-shadow: 0 1rem 2.6rem -.8rem rgba(120, 60, 0, .4);
    cursor: pointer;
    opacity: .8;
    transition: opacity .2s ease, transform .2s ease;
}

.cc-reopen:hover {
    opacity: 1;
    transform: translateY(-2px);
}

@media (max-width: 575px) {
    .cc-reopen {
        left: 1.2rem;
        bottom: 8.4rem; /* au-dessus de la sticky-footer mobile */
        width: 4.2rem;
        height: 4.2rem;
        font-size: 1.8rem;
    }
}

/* --------------------------------------------------------------
   6. Responsive bandeau
   -------------------------------------------------------------- */
@media (max-width: 991px) {
    .cc-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
        gap: 1.6rem;
        padding: 2rem;
    }

    .cc-banner__icon {
        width: 4.4rem;
        height: 4.4rem;
        flex-basis: 4.4rem;
        font-size: 2rem;
    }

    .cc-banner__actions {
        flex-wrap: wrap;
    }

    .cc-banner__actions .cc-btn {
        flex: 1 1 14rem;
    }
}

@media (max-width: 575px) {
    .cc-banner {
        left: 1rem;
        right: 1rem;
        bottom: 7.6rem; /* laisse la place à la sticky-footer mobile */
        padding: 1.8rem 1.6rem;
    }

    .cc-modal__footer {
        flex-direction: column;
    }

    .cc-modal__footer .cc-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-modal,
    .cc-modal__dialog,
    .cc-switch__track,
    .cc-switch__track::before {
        transition: none;
    }
}
