/* Bandeau de consentement aux cookies */

.tf-cc {
    --tf-cc-accent: #bc6276;
    --tf-cc-accent-dark: #9e4a5d;
    --tf-cc-text: #2b2b2b;
    --tf-cc-muted: #666;
    --tf-cc-bg: #fff;
    --tf-cc-line: #e6e0e1;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tf-cc-text);
}

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

.tf-cc__banner {
    position: fixed;
    z-index: 100000;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 24px;
    background: var(--tf-cc-bg);
    border-top: 3px solid var(--tf-cc-accent);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    box-sizing: border-box;
}

.tf-cc__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--tf-cc-text);
}

.tf-cc__desc {
    margin: 0 0 16px;
    color: var(--tf-cc-muted);
}

.tf-cc__desc a {
    color: var(--tf-cc-accent);
    text-decoration: underline;
}

.tf-cc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* Les trois boutons ont le même poids visuel : refuser est aussi simple qu'accepter. */
.tf-cc__btn,
.tf-cc-ph .tf-cc__btn,
.tf-cc-form .tf-cc__btn {
    display: inline-block;
    min-height: 44px;
    margin: 0;
    padding: 10px 20px;
    border: 2px solid var(--tf-cc-accent);
    border-radius: 0;
    background: var(--tf-cc-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
}

/* Le thème restyle les boutons selon les sections : on verrouille les couleurs du module. */
.tf-cc .tf-cc__btn,
.tf-cc-ph .tf-cc__btn,
.tf-cc-form .tf-cc__btn {
    background: #bc6276 !important;
    border-color: #bc6276 !important;
    color: #fff !important;
}

.tf-cc .tf-cc__btn:hover,
.tf-cc .tf-cc__btn:focus-visible,
.tf-cc-ph .tf-cc__btn:hover,
.tf-cc-ph .tf-cc__btn:focus-visible,
.tf-cc-form .tf-cc__btn:hover,
.tf-cc-form .tf-cc__btn:focus-visible {
    background: #9e4a5d !important;
    border-color: #9e4a5d !important;
    color: #fff !important;
}

.tf-cc__btn:focus-visible,
.tf-cc__close:focus-visible,
.tf-cc__switch input:focus-visible + span {
    outline: 2px solid var(--tf-cc-text);
    outline-offset: 2px;
}

/* Panneau de préférences */

.tf-cc__overlay {
    position: fixed;
    z-index: 100000;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.tf-cc__panel {
    position: fixed;
    z-index: 100001;
    top: 50%;
    left: 50%;
    width: calc(100% - 32px);
    max-width: 620px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    background: var(--tf-cc-bg);
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    box-sizing: border-box;
}

.tf-cc .tf-cc__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent !important;
    color: var(--tf-cc-text) !important;
    font-size: 28px;
    line-height: 40px;
    cursor: pointer;
    box-shadow: none;
}

.tf-cc__cats {
    margin: 12px 0 20px;
}

.tf-cc__cat {
    padding: 14px 0;
    border-bottom: 1px solid var(--tf-cc-line);
}

.tf-cc__cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tf-cc__cat-label {
    margin: 0;
    font-weight: 700;
    cursor: pointer;
}

.tf-cc__always {
    color: var(--tf-cc-accent);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.tf-cc__cat-desc {
    margin: 6px 0 0;
    color: var(--tf-cc-muted);
    font-size: 13px;
}

.tf-cc__switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
}

.tf-cc__switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.tf-cc__switch span {
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: #c9c2c4;
    transition: background .2s;
}

.tf-cc__switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
}

.tf-cc__switch input:checked + span {
    background: var(--tf-cc-accent);
}

.tf-cc__switch input:checked + span::after {
    transform: translateX(20px);
}

/* Lien en pied de page */

.tf-cc-footer-link {
    padding: 4px 0 10px;
    text-align: center;
    font-size: 12px;
}

.tf-cc-footer-link a {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .tf-cc__banner {
        left: 0;
        right: 0;
        bottom: 0;
        padding: 16px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .tf-cc__actions {
        flex-direction: column;
    }

    .tf-cc__btn {
        width: 100%;
    }

    .tf-cc__panel {
        padding: 20px 16px;
    }
}
