/* ============================================================
   COOKIE BANNER – NWR&V PREMIUM
============================================================ */

#cookie-banner.cookie-card {
    position: fixed;
    bottom: 22px;
    right: 22px;

    background: linear-gradient(180deg, #aac4d0 0%, #a3bcc8 100%) !important;
    color: #0f2b38;

    padding: 18px 20px;
    border-radius: 16px;
    max-width: 330px;

    border: 1px solid rgba(53, 88, 102, 0.35);
    box-shadow:
        0 6px 22px rgba(0, 0, 0, 0.25),
        inset 0 0 10px rgba(255, 255, 255, 0.15);

    z-index: 99999;
    display: none;
    animation: fadeInCookie 0.35s ease-out;
    backdrop-filter: blur(2px);
}

@keyframes fadeInCookie {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#cookie-banner .cookie-icon {
    font-size: 32px;
    margin-bottom: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

#cookie-banner:hover .cookie-icon {
    transform: rotate(-6deg) scale(1.08);
}

#cookie-banner .cookie-text {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 14px;
    text-align: justify;
    color: #0f2b38;
}

/* Pulsanti */
#cookie-banner .cookie-buttons-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

#cookie-banner .cb-btn {
    padding: 8px 15px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: 0.25s ease, transform 0.15s ease;
}

#cookie-banner .cb-btn:hover {
    transform: translateY(-2px);
}

/* Accetta – verde */
#cookie-banner .cb-accept {
    background: #2e7d32;
    color: #ffffff;
}

#cookie-banner .cb-accept:hover {
    background: #3b8f40;
}

/* Rifiuta – rosso */
#cookie-banner .cb-reject {
    background: #b83232;
    color: #ffffff;
}

#cookie-banner .cb-reject:hover {
    background: #d03b3b;
}

/* Gestisci – blu NW&RV */
#cookie-banner .cb-manage {
    background: #355866;
    color: #ffffff;
}

#cookie-banner .cb-manage:hover {
    background: #4d798b;
}

/* Link Privacy / Cookie */
#cookie-banner .cookie-links-row {
    text-align: center;
    margin-top: 8px;
}

#cookie-banner .cookie-links-row a {
    color: #5a0f18;
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 1;
    text-decoration: none;
    transition: 0.25s ease;
}

#cookie-banner .cookie-links-row a:hover {
    color: #7a1f2a;
    text-decoration: underline;
}

/* ============================================================
   WARNING BOX – NWR&V PREMIUM
============================================================ */

.cookie-warning-box {
    position: fixed;
    bottom: 22px;
    right: 22px;

    background: #4d798b !important;
    color: #ffffff;

    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;

    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);

    z-index: 99998;
    max-width: 260px;

    animation: slideInRight 0.45s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.warning-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;
    margin-right: 8px;

    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.warning-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.warning-link {
    text-align: center;
    margin-top: 8px;
}

.warning-link a {
    color: #ffffff;
    font-weight: 700;
    text-decoration: underline;
    opacity: 0.9;
}

.warning-link a:hover {
    opacity: 1;
}

/* ============================================================
   PANNELLO GESTIONE COOKIE – SUPER COMPATTO
============================================================ */

.cookie-panel {
    position: fixed;
    bottom: 22px;
    right: 22px;

    width: 360px;
    background: linear-gradient(180deg, #aac4d0 0%, #a3bcc8 100%) !important;
    color: #0f2b38;

    padding: 14px 16px;
    border-radius: 16px;

    border: 1px solid rgba(53, 88, 102, 0.35);
    box-shadow:
        0 6px 22px rgba(0, 0, 0, 0.25),
        inset 0 0 10px rgba(255, 255, 255, 0.15);

    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;

    z-index: 999999;
    display: none;
    animation: fadeInCookie 0.35s ease-out;
}

/* Scrollbar */
.cookie-panel::-webkit-scrollbar {
    width: 8px;
}

.cookie-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.cookie-panel::-webkit-scrollbar-thumb {
    background: #355866;
    border-radius: 10px;
}

.cookie-panel::-webkit-scrollbar-thumb:hover {
    background: #4d798b;
}

/* Fade top */
.cookie-panel::before {
    content: "";
    position: sticky;
    top: 0;
    height: 6px;
    display: block;
    background: linear-gradient(to bottom, rgba(170, 196, 208, 1) 0%, rgba(170, 196, 208, 0) 100%);
    pointer-events: none;
    z-index: 5;
}

/* Fade bottom */
.cookie-panel::after {
    content: "";
    position: sticky;
    bottom: 0;
    height: 6px;
    display: block;
    background: linear-gradient(to top, rgba(170, 196, 208, 1) 0%, rgba(170, 196, 208, 0) 100%);
    pointer-events: none;
    z-index: 5;
}

/* HEADER: titolo + X sulla stessa riga, compatto */
.cookie-panel .cp-header {
    position: sticky;
    top: 0;
    background: inherit;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 4px 0;
    margin-bottom: 6px;

    z-index: 10;
    backdrop-filter: blur(3px);
}

.cp-header h2 {
    font-size: 1rem;
    margin: 0;
    font-weight: 800;
    color: #0f2b38;
}

.cp-close-btn {
    background: none;
    border: none;
    color: #0f2b38;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

.cp-close-btn:hover {
    transform: scale(1.15);
}

/* Testo descrittivo */
.cp-desc {
    margin: 6px 0 12px;
    font-size: 0.88rem;
    opacity: 0.95;
    text-align: justify;
    color: #0f2b38;
}

/* Gruppi */
.cp-group {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(15, 43, 56, 0.25);
}

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

.cp-group-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f2b38;
}

.cp-required {
    background: #b83232;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #fff;
}

.cp-text {
    font-size: 0.83rem;
    opacity: 0.95;
    margin: 4px 0 6px;
    line-height: 1.4;
    text-align: justify;
    color: #0f2b38;
}

/* Switch */
.cp-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.cp-switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    background: #b7c4ca;
    border-radius: 24px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: .3s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: .3s;
}

input:checked+.slider {
    background: #355866;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.cp-switch.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pulsanti pannello */
.cp-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.cp-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

cp-btn:hover {
    transform: translateY(-2px);
}

.cp-save {
    background: #355866;
    color: #fff;
}

.cp-save:hover {
    background: #4d798b;
}

.cp-accept-all {
    background: #2e7d32;
    color: #fff;
}

.cp-accept-all:hover {
    background: #3b8f40;
}

/* ============================================================
   GESTISCI COOKIE (bottone nel banner)
============================================================ */

.cookie-manage-row {
    text-align: center;
    margin-top: 10px;
}

.cb-manage {
    background: transparent;
    color: #355866;
    border: 2px solid #355866;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
}

.cb-manage:hover {
    background: #355866;
    color: #ffffff;
}

/* ============================================================
   MOBILE RESPONSIVE
============================================================ */

@media (max-width: 600px) {

    #cookie-banner.cookie-card {
        right: 10px;
        bottom: 16px;
        max-width: 300px;
    }

    #cookie-banner .cookie-buttons-row {
        flex-direction: column;
    }

    .cookie-warning-box {
        right: 10px;
        bottom: 16px;
        max-width: 260px;
    }

    .cookie-panel {
        right: 10px;
        bottom: 16px;
        width: 340px;
        max-width: 100%;
    }
}