/* AvaPrivacy Cookie Banner v1.0
   GDPR / Garante 10 giugno 2021 — barra non bloccante + modale preferenze */

.avp-cb,
.avp-cb *,
.avp-cb-modal,
.avp-cb-modal *,
.avp-cb-fab,
.avp-cb-fab * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.avp-cb {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483640;
    background: #0f172a;
    color: #f1f5f9;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .25);
    border-top: 1px solid #1e293b;
    animation: avpCbSlideUp .25s ease-out;
}
@keyframes avpCbSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.avp-cb-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.avp-cb-text {
    flex: 1 1 420px;
    min-width: 280px;
    font-size: 14px;
    line-height: 1.5;
}
.avp-cb-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: #fff;
}
.avp-cb-text p {
    margin: 0;
    color: #cbd5e1;
}
.avp-cb-text a {
    color: #60a5fa;
    text-decoration: underline;
}

.avp-cb-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.avp-cb-btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s ease, background .15s ease;
    line-height: 1;
}
.avp-cb-btn:active { transform: translateY(1px); }

.avp-cb-primary {
    background: #2563eb;
    color: #fff;
}
.avp-cb-primary:hover { background: #1d4ed8; }

.avp-cb-secondary {
    background: transparent;
    color: #f1f5f9;
    border: 1px solid #475569;
}
.avp-cb-secondary:hover { background: #1e293b; }

/* ============================================================
   Modale preferenze
   ============================================================ */

.avp-cb-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483641;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.avp-cb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}
.avp-cb-modal-card {
    position: relative;
    background: #fff;
    color: #0f172a;
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .3);
    animation: avpCbZoomIn .2s ease-out;
}
@keyframes avpCbZoomIn {
    from { transform: scale(.96); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.avp-cb-modal-head {
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.avp-cb-modal-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.avp-cb-close {
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 4px;
}
.avp-cb-close:hover { color: #0f172a; }

.avp-cb-modal-body {
    padding: 18px 22px;
    overflow-y: auto;
}
.avp-cb-modal-intro {
    margin: 0 0 16px;
    color: #475569;
    font-size: 14px;
}

.avp-cb-cat {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: border-color .15s ease;
}
.avp-cb-cat:hover { border-color: #cbd5e1; }

.avp-cb-cat-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
}
.avp-cb-cat-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.avp-cb-cat-label strong {
    font-size: 14px;
    color: #0f172a;
}
.avp-cb-cat-label span {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.45;
}

.avp-cb-toggle {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
}
.avp-cb-toggle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.avp-cb-toggle input:disabled { cursor: not-allowed; }

.avp-cb-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .15s ease;
}
.avp-cb-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.avp-cb-toggle input:checked + .avp-cb-slider,
.avp-cb-slider.on {
    background: #2563eb;
}
.avp-cb-toggle input:checked + .avp-cb-slider::after,
.avp-cb-slider.on::after {
    transform: translateX(20px);
}
.avp-cb-slider.locked {
    background: #94a3b8;
    cursor: not-allowed;
}

.avp-cb-modal-foot {
    padding: 16px 22px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.avp-cb-modal-foot .avp-cb-btn {
    color: #0f172a;
}
.avp-cb-modal-foot .avp-cb-secondary {
    color: #0f172a;
    border-color: #cbd5e1;
}
.avp-cb-modal-foot .avp-cb-secondary:hover {
    background: #f1f5f9;
}
.avp-cb-modal-foot .avp-cb-primary {
    color: #fff;
}

/* ============================================================
   Floating reopen button
   ============================================================ */

.avp-cb-fab {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 2147483639;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .15);
    transition: transform .15s ease, box-shadow .15s ease;
}
.avp-cb-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .2);
}
.avp-cb-fab span[aria-hidden] {
    font-size: 16px;
    line-height: 1;
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 720px) {
    .avp-cb-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 18px;
        gap: 14px;
    }
    .avp-cb-actions {
        justify-content: stretch;
    }
    .avp-cb-actions .avp-cb-btn {
        flex: 1 1 auto;
        text-align: center;
    }
    .avp-cb-modal-foot {
        flex-direction: column-reverse;
    }
    .avp-cb-modal-foot .avp-cb-btn {
        width: 100%;
    }
    .avp-cb-fab .avp-cb-fab-label {
        display: none;
    }
}
