/* Contenitore esterno: banner centrato, nessuno sfondo nero */
.cookie-banner {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;                  /* = copre tutto lo schermo */
    z-index: 9999;
    display: none;            /* lo script lo mette a flex */
    justify-content: center;  /* centro orizzontale */
    align-items: center;      /* centro verticale */
    padding: 16px 12px;
    pointer-events: none;     /* clic solo sul box interno */
    background: transparent;  /* niente overlay nero */
    box-sizing: border-box;
    font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Box del banner vero e proprio */
.cookie-banner-inner {
    width: 100%;
    max-width: 960px;
    background: #020617;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.5fr);
    gap: 10px;
    pointer-events: auto;
    color: #e5e7eb;
}

/* Responsive: su mobile il banner diventa a colonna */
@media (max-width: 768px) {
    .cookie-banner-inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --- testo e bottoni --- */

.cookie-main {
    font-size: 13px;
}

.cookie-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cookie-text {
    color: #9ca3af;
}

.cookie-links {
    margin-top: 4px;
    font-size: 12px;
}

.cookie-links a {
    color: #38bdf8;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.cookie-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.cookie-badge {
    align-self: flex-end;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #9ca3af;
}

.cookie-btn {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease-out, color 0.15s ease-out,
                border-color 0.15s ease-out, transform 0.15s ease-out,
                box-shadow 0.15s ease-out;
    background: transparent;
    color: #e5e7eb;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #020617;
    border-color: rgba(56, 189, 248, 0.9);
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(8, 47, 73, 0.7);
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(8, 47, 73, 0.9);
}

.cookie-btn-outline {
    border-color: rgba(148, 163, 184, 0.7);
}

.cookie-btn-outline:hover {
    background: rgba(15, 23, 42, 0.9);
}

.cookie-btn-ghost {
    border-color: rgba(148, 163, 184, 0.35);
    color: #9ca3af;
}

.cookie-btn-ghost:hover {
    border-color: rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.9);
}

.cookie-btn-danger-outline {
    border-color: rgba(248, 113, 113, 0.8);
    color: #fecaca;
}

.cookie-btn-danger-outline:hover {
    border-color: rgba(248, 113, 113, 1);
    background: rgba(127, 29, 29, 0.6);
}

/* backdrop della modale (solo quando apri "Gestisci preferenze") */
.cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.cookie-modal {
    max-width: 520px;
    width: 100%;
    background: #020617;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
    padding: 16px 16px 12px;
    color: #e5e7eb;
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cookie-modal-title {
    font-size: 15px;
    font-weight: 600;
}

.cookie-modal-body {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.cookie-category {
    padding: 9px 9px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.6);
    margin-bottom: 6px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.cookie-category-title {
    font-size: 13px;
    font-weight: 500;
}

.cookie-category-badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 999px;
    padding: 2px 6px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #9ca3af;
}

.cookie-category-desc {
    font-size: 12px;
    color: #9ca3af;
}

.cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
}

.cookie-switch {
    position: relative;
    width: 38px;
    height: 20px;
    display: inline-block;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #111827;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    transition: 0.15s ease-out;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    top: 2px;
    background-color: #e5e7eb;
    border-radius: 999px;
    box-shadow: 0 3px 6px rgba(15, 23, 42, 0.9);
    transition: 0.15s ease-out;
}

.cookie-switch input:checked + .cookie-slider {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    border-color: rgba(56, 189, 248, 0.95);
}

.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(16px);
}

.cookie-switch input:disabled + .cookie-slider {
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-switch input:disabled + .cookie-slider:before {
    background-color: #9ca3af;
}
