:root {
    /* Token visivi allineati al banner Hybrid del playground; la logica JS resta separata. */
    --bp-cookiebot-bottom-offset: 0px;
    --bp-cookiebot-surface: #3269d4;
    --bp-cookiebot-surface-strong: #2c63ce;
    --bp-cookiebot-surface-deep: #2458be;
    --bp-cookiebot-ink: #ffffff;
    --bp-cookiebot-soft: rgba(255, 255, 255, 0.92);
    --bp-cookiebot-soft-muted: rgba(255, 255, 255, 0.78);
    --bp-cookiebot-line: rgba(255, 255, 255, 0.14);
    --bp-cookiebot-panel: rgba(255, 255, 255, 0.12);
    --bp-cookiebot-panel-strong: rgba(255, 255, 255, 0.18);
    --bp-cookiebot-accent: #12144b;
    --bp-cookiebot-accent-strong: #18204c;
    --bp-cookiebot-shadow: 0 28px 70px rgba(10, 18, 68, 0.28);
}

.bp-cookiebot,
.bp-cookiebot-trigger {
    font-family: "Lexend", "Segoe UI", sans-serif;
}

.bp-cookiebot {
    position: fixed;
    left: 20px;
    right: auto;
    bottom: calc(20px + var(--bp-cookiebot-bottom-offset));
    z-index: 9998;
    width: min(400px, calc(100vw - 40px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(36px);
    transition: opacity 180ms ease, transform 240ms ease, visibility 0s linear 240ms;
}

.bp-cookiebot.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.bp-cookiebot__surface {
    max-width: 400px;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--bp-cookiebot-line);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--bp-cookiebot-surface) 0%, var(--bp-cookiebot-surface-strong) 52%, var(--bp-cookiebot-surface-deep) 100%);
    color: var(--bp-cookiebot-ink);
    box-shadow: var(--bp-cookiebot-shadow);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "eyebrow"
        "actions"
        "body"
        "details";
    gap: 14px;
    align-items: start;
}

.bp-cookiebot__eyebrow {
    grid-area: eyebrow;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.bp-cookiebot__eyebrow::before {
    content: "\1F36A";
    font-size: 1.1rem;
    line-height: 1;
}

.bp-cookiebot__body {
    grid-area: body;
    margin: 0;
    max-width: 100%;
    color: var(--bp-cookiebot-soft);
    line-height: 1.58;
    font-size: 0.94rem;
}

.bp-cookiebot__link {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

.bp-cookiebot__actions {
    grid-area: actions;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.bp-cookiebot__details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bp-cookiebot__button {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid transparent;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 14px 18px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

/* Isola i bottoni del banner dagli stili globali del tema WordPress. */
.bp-cookiebot .bp-cookiebot__button {
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 54px !important;
    padding: 14px 18px !important;
    font: inherit !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

.bp-cookiebot .bp-cookiebot__actions .bp-cookiebot__button {
    flex: 1 1 0 !important;
    min-width: 0;
}

.bp-cookiebot .bp-cookiebot__details-actions .bp-cookiebot__button {
    flex: 1 1 100% !important;
}

.bp-cookiebot__button--secondary {
    order: 1;
}

.bp-cookiebot__button--primary {
    order: 2;
}

.bp-cookiebot__button:hover {
    transform: translateY(-1px);
}

.bp-cookiebot button.bp-cookiebot__button--primary,
.bp-cookiebot [type="button"].bp-cookiebot__button--primary {
    background-color: var(--bp-cookiebot-accent);
    background-image: none;
    border-color: var(--bp-cookiebot-accent);
    color: #fff;
    box-shadow: 0 12px 30px rgba(9, 15, 56, 0.24);
}

.bp-cookiebot button.bp-cookiebot__button--secondary,
.bp-cookiebot [type="button"].bp-cookiebot__button--secondary {
    background-color: #fff;
    background-image: none;
    border-color: rgba(18, 20, 75, 0.12);
    color: var(--bp-cookiebot-accent-strong);
}

.bp-cookiebot button.bp-cookiebot__button--ghost,
.bp-cookiebot [type="button"].bp-cookiebot__button--ghost {
    background-color: rgba(255, 255, 255, 0.12);
    background-image: none;
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.bp-cookiebot__details {
    grid-area: details;
    margin-top: 8px;
}

.bp-cookiebot__details-copy {
    margin: 0 0 14px;
    color: var(--bp-cookiebot-soft);
    line-height: 1.6;
    font-size: 0.92rem;
}

.bp-cookiebot__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bp-cookiebot__card {
    display: block;
    padding: 16px;
    border: 1px solid var(--bp-cookiebot-line);
    border-radius: 14px;
    background: var(--bp-cookiebot-panel);
}

.bp-cookiebot__card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.bp-cookiebot__card-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: #fff;
}

.bp-cookiebot__card-copy {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.6;
    font-size: 0.92rem;
}

.bp-cookiebot__card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #fff;
    cursor: pointer;
}

.bp-cookiebot__card input[type="checkbox"][disabled] {
    cursor: not-allowed;
}

.bp-cookiebot__details-actions {
    margin-top: 14px;
}

.bp-cookiebot-trigger {
    position: fixed;
    left: 20px;
    bottom: calc(20px + var(--bp-cookiebot-bottom-offset));
    z-index: 9997;
    border: 1px solid rgba(18, 20, 75, 0.12);
    border-radius: 8px;
    padding: 15px 24px;
    background: #fff;
    color: var(--bp-cookiebot-accent-strong);
    box-shadow: 0 12px 30px rgba(9, 15, 56, 0.18);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
}

.bp-cookiebot-trigger.is-visible {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bp-native-footer__cookie-trigger {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

/* Nel footer il trigger cookie deve sembrare un link Elementor, non un bottone del tema. */
.bp-native-footer__links .bp-native-footer__cookie-trigger,
.bp-native-footer__links .bp-native-footer__cookie-trigger:hover,
.bp-native-footer__links .bp-native-footer__cookie-trigger:focus,
.bp-native-footer__links .bp-native-footer__cookie-trigger:active {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    text-align: inherit !important;
    text-decoration: none !important;
    text-transform: inherit !important;
    vertical-align: baseline !important;
}

@media (max-width: 767px) {
    .bp-cookiebot {
        left: 12px;
        right: 12px;
        width: auto;
        /* Su mobile copriamo la chat: il banner resta ancorato al fondo invece di spostarsi verso l'alto. */
        bottom: 0;
        z-index: 2147483000;
    }

    .bp-cookiebot__surface {
        padding: 20px 18px;
        gap: 12px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .bp-cookiebot__actions,
    .bp-cookiebot__details-actions {
        width: 100%;
        flex-direction: column;
    }

    .bp-cookiebot__button--primary {
        order: 1;
    }

    .bp-cookiebot__button--secondary {
        order: 2;
    }

    .bp-cookiebot__cards {
        grid-template-columns: 1fr;
    }

    .bp-cookiebot-trigger {
        left: 12px;
        bottom: calc(12px + var(--bp-cookiebot-bottom-offset));
    }
}
