/* ==========================================================================
   COOKIE BANNER - VERSIONE OTTIMIZZATA
   Minimal animation, GPU-friendly, accessibile e reattiva
   ========================================================================== */

/* === CONTENITORE BASE === */
#cookie-banner-container {
    position: fixed; /* Sempre visibile mentre si scorre */
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    max-width: 90%; /* Non eccede il viewport */
    font-family: 'Arial', sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgb(0 0 0 / 18%);
    transform-origin: bottom left; /* Punto di espansione */
    transition:
        transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
        opacity 0.25s ease-in-out;
}

/* === STATO COLLASSATO (icona 🍪) === */
.cookie-banner-collapsed {
	 transition: all 0.3s ease;
    transform: scale(0.85);
    opacity: 0.85;
    width: 60px;
    height: 60px;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    line-height: 60px;
    font-size: 30px;
}

/* === STATO ESPANSO === */
.cookie-banner-expanded {
    transform: scale(1);
    opacity: 1;
    padding: 15px;
    width: 380px; /* Dimensione ottimale desktop */
}

/* === ANIMAZIONE DI APERTURA LEGGERA === */
.cookie-banner-expanded {
    animation: cookiePop 0.35s ease-out;
}

@keyframes cookiePop {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === TRIGGER (icona piccola) === */
#cookie-banner-small {
    display: block;
    border-radius: 12px;
    background-color: #fff;
    transition: opacity 0.2s ease;
}

.cookie-banner-expanded #cookie-banner-small {
    display: none; /* Nascondi icona quando espanso */
}

/* === CONTENUTO (parte espansa) === */
.cookie-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 10px 0 0 0;
    font-family: 'Neue Montreal', sans-serif !important;
}

.cookie-banner-expanded .cookie-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* === HEADER E TITOLO === */
.cookie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-title {
    font-weight: bold;
    font-size: 16px;
    color: #222;
    margin: 0;
}

.cookie-close-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    transition: transform 0.2s ease, color 0.2s ease;
}

.cookie-close-icon:hover {
    color: #000;
    transform: scale(1.2);
}

/* === DESCRIZIONE === */
.cookie-description {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* === SEZIONI E CHECKBOX === */
.cookie-section {
    margin-top: 10px;
}

.cookie-item {
    margin-bottom: 8px;
}

.cookie-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #222;
}

.cookie-badge.essential {
    background: #7637fe;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.cookie-description-small {
    font-size: 12px;
    color: #555;
    line-height: 1.3;
    margin-top: 4px;
}

/* === LINK PRIVACY E COOKIE === */
.cookie-links {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.cookie-links a {
    color: #7637fe;
    text-decoration: none;
    margin: 0 4px;
    transition: color 0.2s ease;
}

.cookie-links a:hover {
    color: #4b14e2;
}

.separator {
    color: #ccc;
    margin: 0 4px;
}

/* === PULSANTI AZIONI === */
.cookie-actions {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
    gap: 6px;
}

.cookie-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    flex-grow: 1;
    font-size: 12px;
    transition: background 0.25s ease, transform 0.1s ease;
}

.cookie-btn:hover {
    transform: scale(1.03);
}

.accept-all-btn {
    background: #7637fe;
    color: #fff;
}

.save-preferences-btn {
    background: #7637fe9e;
    color: #fff;
}

.reject-all-btn {
    background: #a780fb94;
    color: #fff;
}

/* === RESPONSIVITÀ === */
@media (max-width: 600px) {
    .cookie-banner-expanded {
        width: 90vw;
        left: 5vw;
        right: 5vw;
        max-width: none;
    }

    #cookie-banner-container {
        bottom: 10px;
        left: 10px;
    }

    .cookie-title {
        font-size: 14px;
    }

    .cookie-description {
        font-size: 13px;
    }

    .cookie-btn {
        font-size: 11px;
        padding: 8px 10px;
    }
}
