/* ============================================================
   Cookie Consent Banner - RGPD / GBA compliant
   Bannière : Refuser | Accepter | Voir les détails
   Modal    : Nécessaires (always on) + Fonctionnels (toggle)
   ============================================================ */

/* ---- Bannière ---- */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #181818;
    border-top: 1px solid #2a2a2a;
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

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

.cc-banner.cc-banner-hidden {
    transform: translateY(100%);
    opacity: 0;
}

.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cc-banner-text strong {
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.3rem;
}

.cc-banner-text p {
    color: #b0b0b0;
    font-size: 0.83rem;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.5;
    margin: 0;
}

.cc-link {
    background: none;
    border: none;
    color: #ffffff;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
}

.cc-link:hover {
    opacity: 0.75;
}

.cc-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ---- Boutons communs ---- */
.cc-btn {
    padding: 0.55rem 1.5rem;
    border-radius: 100px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    border: none;
}

.cc-btn-primary {
    background: #ffffff;
    color: #0a0a0a;
}

.cc-btn-outline {
    background: transparent;
    color: #cccccc;
    border: 1px solid #444444;
}

.cc-btn:hover {
    opacity: 0.8;
}

/* ---- Modal overlay ---- */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ---- Modal boîte ---- */
.cc-modal-box {
    position: relative;
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(16px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

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

.cc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.cc-modal-header h3 {
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.cc-modal-close {
    background: none;
    border: none;
    color: #666666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
    font-family: inherit;
}

.cc-modal-close:hover {
    color: #ffffff;
}

.cc-modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    flex: 1;
}

/* ---- Catégories de cookies ---- */
.cc-category {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #2a2a2a;
}

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

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.cc-category-name {
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}

.cc-always-active {
    color: #4ade80;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
}

.cc-category-desc {
    color: #888888;
    font-size: 0.83rem;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.5;
    margin: 0 0 1rem;
}

/* ---- Toggle switch ---- */
.cc-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-toggle-track {
    position: absolute;
    inset: 0;
    background: #333333;
    border-radius: 100px;
    transition: background 0.25s ease;
    cursor: pointer;
}

.cc-toggle-track::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #666666;
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

.cc-toggle input:checked + .cc-toggle-track {
    background: #4ade80;
}

.cc-toggle input:checked + .cc-toggle-track::before {
    transform: translateX(20px);
    background: #ffffff;
}

/* ---- Tableau cookies ---- */
.cc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    margin-top: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.cc-cookie-table th {
    text-align: left;
    color: #666666;
    font-weight: 500;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #2a2a2a;
    background: #111111;
}

.cc-cookie-table td {
    color: #b0b0b0;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #1e1e1e;
    vertical-align: top;
}

.cc-cookie-table tr:last-child td {
    border-bottom: none;
}

/* ---- Pied de modal ---- */
.cc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid #2a2a2a;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
    .cc-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
    }

    .cc-banner-actions {
        width: 100%;
    }

    .cc-banner-actions .cc-btn {
        flex: 1;
        text-align: center;
    }

    .cc-modal-box {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
        max-height: 90vh;
        border-radius: 16px;
    }

    .cc-modal-footer {
        flex-direction: column;
    }

    .cc-modal-footer .cc-btn {
        width: 100%;
        text-align: center;
    }

    .cc-modal-body {
        padding: 1.25rem;
    }

    .cc-modal-header {
        padding: 1.25rem 1.25rem 0.875rem;
    }
}
