/* =====================================================
   COOKIE CONSENT — Prim'So
   Design non-intrusif, palette du site
   ===================================================== */

/* ── Banner (barre basse) ── */
#primso-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #0C241F;
    color: #fff;
    padding: 20px 24px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Nunito', sans-serif;
}

#primso-cookie-banner.is-visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.cookie-banner-text {
    flex: 1;
    min-width: 220px;
}

.cookie-banner-text strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 4px;
    color: #C9E391;
}

.cookie-banner-text p {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

.cookie-banner-text a {
    color: #C9E391;
    text-decoration: underline;
    font-weight: 600;
}

.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Bouton Accepter */
.cookie-btn-accept {
    background: #5BAE6E;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 9999px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.cookie-btn-accept:hover {
    background: #4a9a5c;
    transform: translateY(-1px);
}

/* Bouton Refuser */
.cookie-btn-reject {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 9px 20px;
    border-radius: 9999px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
}

.cookie-btn-reject:hover {
    border-color: rgba(255, 255, 255, 0.65);
    color: #fff;
    transform: translateY(-1px);
}

/* Lien Personnaliser */
.cookie-btn-customize {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 2px;
    transition: color 0.2s;
    white-space: nowrap;
}

.cookie-btn-customize:hover {
    color: #C9E391;
}

/* ── Bouton flottant (ré-ouvrir les préférences) ── */
#primso-cookie-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    width: 42px;
    height: 42px;
    background: #0C241F;
    border: 2px solid rgba(201, 227, 145, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: all 0.25s;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

#primso-cookie-toggle.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

#primso-cookie-toggle:hover {
    background: #1a3d35;
    border-color: #C9E391;
    transform: scale(1.1);
}

/* ── Modal personnalisation ── */
#primso-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(12, 36, 31, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 0;
}

#primso-cookie-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.cookie-modal-box {
    background: #fff;
    width: 100%;
    max-width: 560px;
    border-radius: 20px 20px 0 0;
    padding: 32px 28px 28px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(30px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Nunito', sans-serif;
}

#primso-cookie-modal.is-open .cookie-modal-box {
    transform: translateY(0);
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.cookie-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #0C241F;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6B7280;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.cookie-modal-close:hover {
    color: #0C241F;
    background: #f5f6fb;
}

.cookie-modal-desc {
    font-size: 13.5px;
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 22px;
}

.cookie-modal-desc a {
    color: #2B75BB;
    text-decoration: underline;
}

/* Catégories */
.cookie-category {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.cookie-category:hover {
    border-color: #C9E391;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.cookie-category-label {
    font-size: 14px;
    font-weight: 800;
    color: #0C241F;
}

.cookie-category-required {
    font-size: 11px;
    background: #C9E391;
    color: #0C241F;
    padding: 2px 9px;
    border-radius: 9999px;
    font-weight: 700;
}

.cookie-category-desc {
    font-size: 12.5px;
    color: #6B7280;
    line-height: 1.5;
    margin-bottom: 4px;
}

.cookie-category-cookies {
    font-size: 11.5px;
    color: #9CA3AF;
    font-style: italic;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.25s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #5BAE6E;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Actions modal */
.cookie-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.cookie-modal-actions .cookie-btn-accept {
    flex: 1;
    text-align: center;
}

.cookie-modal-btn-save {
    flex: 1;
    background: #0C241F;
    color: #fff;
    border: none;
    padding: 11px 20px;
    border-radius: 9999px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    text-align: center;
}

.cookie-modal-btn-save:hover {
    background: #1a3d35;
    transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    #primso-cookie-banner {
        padding: 16px 16px 20px;
    }

    .cookie-banner-inner {
        gap: 14px;
    }

    .cookie-banner-icon {
        display: none;
    }

    .cookie-banner-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .cookie-modal-box {
        padding: 24px 18px 22px;
        border-radius: 16px 16px 0 0;
    }

    .cookie-modal-actions {
        flex-direction: column;
    }
}
