
/* ========================================
   COOKIE BANNER GDPR
   Pattern moderno a due livelli:
   1. Banner con "Accetta tutti" + "Personalizza"
   2. Pannello categorie con toggle
   
   Usa colori propri hardcoded (non variabili tema)
   per garantire leggibilità su TUTTI i temi
   (inclusi temi dark come Elegance).
   ======================================== */

/* ---- Banner container ---- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #ffffff;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    border-top: 1px solid #e5e7eb;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'DM Sans', Roboto, sans-serif;
    color: #374151;
}

/*
 * Reset esplicito: impedisce ai temi (specialmente dark come Elegance)
 * di sovrascrivere colori di testo, link, titoli e bottoni nel banner.
 */
.cookie-banner h3,
.cookie-banner strong,
.cookie-banner p,
.cookie-banner label {
    color: inherit;
}

.cookie-banner a {
    color: #ea580c;
    text-decoration: underline;
}

.cookie-banner a:hover {
    color: #c2410c;
}

/* ---- LIVELLO 1: Banner principale ---- */
.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

.cookie-banner-text p + p {
    margin-top: 4px;
}

.cookie-banner-text a {
    color: #ea580c;
    text-decoration: underline;
}

.cookie-banner-text a:hover {
    color: #c2410c;
}

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

/* ---- Bottoni ---- */
.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
    line-height: 1.4;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #ff6b00 0%, #f59e0b 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,107,0,0.2);
}

.cookie-btn-accept:hover {
    box-shadow: 0 4px 16px rgba(255,107,0,0.3);
    transform: translateY(-1px);
}

.cookie-btn-customize {
    background: transparent;
    color: #ea580c;
    border: 1px solid rgba(255,107,0,0.3);
}

.cookie-btn-customize:hover {
    background: rgba(255,107,0,0.05);
    border-color: #ea580c;
}

.cookie-btn-back {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.cookie-btn-back:hover {
    background: #e5e7eb;
}

/* ---- LIVELLO 2: Pannello personalizzazione ---- */
.cookie-settings-panel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.cookie-settings-header h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.cookie-settings-header p {
    margin: 0 0 20px;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ---- Categoria cookie ---- */
.cookie-category {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

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

.cookie-category-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-category-info strong {
    font-size: 0.9rem;
    color: #111827;
}

.cookie-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cookie-badge-required {
    background: rgba(255,107,0,0.08);
    color: #ea580c;
}

.cookie-category-desc {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
}

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

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    transition: 0.25s;
    border-radius: 4px;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    transition: 0.25s;
    border-radius: 50%;
}

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

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

.cookie-settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 16px 20px;
    }

    .cookie-banner-actions {
        justify-content: center;
    }

    .cookie-settings-panel {
        padding: 20px 16px;
    }

    .cookie-settings-actions {
        flex-direction: column-reverse;
    }

    .cookie-settings-actions .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-category {
        padding: 14px 16px;
    }
}
