/**
 * Cookie Wall Styles - Scroll normal sur la modale
 */

/* Reset */
#cookiewall-banner,
#cookiewall-banner * {
    box-sizing: border-box;
}

/* Overlay */
.cookiewall-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 999998;
    backdrop-filter: blur(4px);
}

/* Bannière */
.cookiewall-banner {
    position: fixed;
    left: 50%;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;      /* si trop haut → scroll classique */
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 999999;

    overflow-y: auto;      /* scroll normal sur toute la modale */
}

/* Positions */
.cookiewall-bottom {
    bottom: 20px;
    transform: translateX(-50%);
}
.cookiewall-top {
    top: 20px;
    transform: translateX(-50%);
}
.cookiewall-center {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Container */
.cookiewall-container {
    padding: 20px;
}

/* Vues */
.cookiewall-view {
    /* plus de flex compliqué, on laisse la hauteur naturelle */
}

/* Lien Continuer sans accepter */
.cookiewall-refuse-link {
    display: block;
    margin-bottom: 2em;
    color: #7a7a7a;
    line-height: 1em;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}
.cookiewall-refuse-link:hover {
    color: #333;
    text-decoration: underline;
}

/* Titre & message */
.cookiewall-title {
    font-size: 1.5em;
}
.cookiewall-message {
    margin-top: 1em;
    font-size: 14px;
    line-height: 1.6em;
}

/* Zones */
.cookiewall-content {
    margin-bottom: 16px;
}

.cookiewall-preferences {
    /* hauteur naturelle, pas de scroll interne */
    margin-top: 10px;
    padding-right: 5px;
    padding-bottom: 5px;
}

/* Boutons */
.cookiewall-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
}

.cookiewall-buttons-custom {
    border-top: 1px solid #e5e7eb;
}

.cookiewall-btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}

.cookiewall-btn-accept {
    background: linear-gradient(135deg, var(--cw-primary) 0%, var(--cw-secondary) 100%);
    color: #fff;
}
.cookiewall-btn-accept:hover {
    background: linear-gradient(135deg, var(--cw-secondary) 0%, var(--cw-primary) 100%);
}

.cookiewall-btn-refuse {
    background: #fff;
    color: var(--cw-primary);
    border: 2px solid var(--cw-primary);
}
.cookiewall-btn-refuse:hover {
    background: #f9fafb;
    border-color: var(--cw-secondary);
}

.cookiewall-btn-customize,
.cookiewall-btn-back,
.cookiewall-btn-confirm {
    background: #fff;
    color: var(--cw-primary);
    border: 2px solid #e5e7eb;
}
.cookiewall-btn-customize:hover,
.cookiewall-btn-back:hover,
.cookiewall-btn-confirm:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Boutons 1er niveau : personnaliser + accepter en 50/50 */
.cookiewall-buttons-main {
    flex-wrap: nowrap;
}
.cookiewall-buttons-main .cookiewall-btn-customize,
.cookiewall-buttons-main .cookiewall-btn-accept {
    flex: 1 1 50%;
}

/* Lien politique de confidentialité */
.cookiewall-policy-link {
    text-decoration: underline;
    color: #7a7a7a;
}

/* Items préférences */
.cookiewall-preference-item {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.cookiewall-preference-item:last-of-type { margin-bottom: 0; }

.cookiewall-preference-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Accordéon partenaires */
.cookiewall-partners-toggle {
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
}
.cookiewall-partners-btn {
    font-size: 12px;
    color: var(--cw-primary);
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cookiewall-partners-btn::before {
    content: '▸';
    transition: transform 0.2s ease;
    display: inline-block;
}
.cookiewall-partners-toggle.open .cookiewall-partners-btn::before {
    transform: rotate(90deg);
}
.cookiewall-partners-btn:hover {
    text-decoration: underline;
}
.cookiewall-partners-list {
    display: none;
    margin-top: 6px;
}
.cookiewall-partners-toggle.open .cookiewall-partners-list {
    display: block;
}
.cookiewall-partners-list ul {
    margin: 0;
    padding-left: 20px;
}
.cookiewall-partners-list li {
    font-size: 12px;
    color: #6b7280;
    padding: 3px 10px;
    line-height: 1.3em;
}
.cookiewall-partners-list li a {
    color: #6b7280;
    text-decoration: underline;
}
.cookiewall-partners-list li a:hover {
    color: #374151;
}

.cookiewall-preference-text {
    flex: 1;
    text-align: left;
}
.cookiewall-preference-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}
.cookiewall-preference-desc {
    font-size: 12px;
    color: #6b7280;
    display: block;
    line-height: 1.35em;
}

/* Switch */
.cookiewall-switch-label {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cookiewall-checkbox {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 43px;
    height: 23px;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: all .3s ease;
}
.cookiewall-checkbox::before {
    content: '';
    position: absolute;
    width: 17px;
    height: 17px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
    transition: all .3s cubic-bezier(.4,0,.2,1);
}
.cookiewall-checkbox:checked {
    background: linear-gradient(135deg, var(--cw-primary) 0%, var(--cw-secondary) 100%);
}
.cookiewall-checkbox:checked::before { left: 23px; }

/* Essentiels */
.cookiewall-preference-item.is-essential {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.cookiewall-badge-required {
    font-size: 13px;
    font-weight: 700;
    margin-left: 6px;
}
.cookiewall-checkbox.essential-switch {
    cursor: not-allowed;
    opacity: .8;
}
.cookiewall-checkbox.essential-switch:disabled:checked {
    background: #4f4a4a !important;
}

/* Bloc Google (granulaire) */
.cookiewall-google-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}
.cookiewall-google-header .cookiewall-preference-name {
    font-weight: 700;
}
.cookiewall-google-vendor-link {
    color: #6b7280;
    text-decoration: underline;
    font-weight: 600;
}
.cookiewall-google-vendor-link:hover {
    color: #374151;
}
.cookiewall-google-header .cookiewall-preference-name::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z'/%3E%3Cpath fill='%2334A853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z'/%3E%3Cpath fill='%23FBBC05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z'/%3E%3Cpath fill='%23EA4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 8px;
    vertical-align: middle;
}
.cookiewall-google-subtoggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cookiewall-google-subtoggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0px 8px 10px;
    border-left: 2px solid #e5e7eb;
}
.cookiewall-google-subname {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    display: block;
}

/* Picto flottant bas gauche */
.cookiewall-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--cw-primary) 0%, var(--cw-secondary) 100%);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 999997;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}
.cookiewall-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .cookiewall-container { padding: 20px; }

    .cookiewall-bottom { bottom: 10px; }
    .cookiewall-top { top: 10px; }

    .cookiewall-title { font-size: 18px; }
    .cookiewall-message,
    .cookiewall-custom-message { font-size: 13px; }

    .cookiewall-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .cookiewall-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 13px;
    }
}
