/* ==========================================================================
   VENESSE — maschera di consenso cookie (GDPR)
   ========================================================================== */

.consent[hidden],
.consent__banner[hidden],
.consent__overlay[hidden],
.consent__meta[hidden] {
    display: none !important;
}

/* ------------------------------------------------------------- banner --- */

.consent__banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}

.consent__banner-inner {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
    width: min(var(--container), 100% - var(--gutter) * 2);
    margin: 0 auto;
    padding: 18px 0;
}

.consent__mark {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--mint);
    color: var(--green-deep);
    display: grid;
    place-items: center;
}

.consent__mark svg {
    width: 22px;
    height: 22px;
}

.consent__banner-text {
    flex: 1 1 auto;
    min-width: 0;
}

.consent__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.01em;
    margin-bottom: 2px;
}

.consent__banner-text p {
    color: var(--muted);
    font-size: .875rem;
    line-height: 1.5;
    max-width: 78ch;
}

.consent__banner-text a,
.consent__intro a,
.consent__option-desc a {
    color: var(--green-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent__banner-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.consent__link {
    background: none;
    border: 0;
    padding: 6px 4px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.consent__link:hover {
    color: var(--green-deep);
}

/* -------------------------------------------------------------- modale --- */

.consent__overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(17, 26, 20, .55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 3vw, 40px);
}

.consent__dialog {
    position: relative;
    width: min(640px, 100%);
    max-height: min(88vh, 780px);
    overflow-y: auto;
    background: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(22px, 3vw, 36px);
}

.consent__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    transition: background .2s var(--ease), border-color .2s var(--ease);
}

.consent__close:hover {
    background: var(--cream-2);
    border-color: var(--line-strong);
}

.consent__close svg {
    width: 16px;
    height: 16px;
}

.consent__title--modal {
    font-size: clamp(1.3rem, 2.4vw, 1.6rem);
    padding-right: 44px;
}

.consent__intro {
    color: var(--muted);
    font-size: .9rem;
    margin-top: 8px;
}

/* ------------------------------------------------------------ opzioni --- */

.consent__form {
    margin-top: 20px;
}

.consent__option {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.consent__option:last-of-type {
    border-bottom: 1px solid var(--line);
}

.consent__option-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.consent__switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.consent__switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.consent__switch-track {
    flex: none;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: var(--line-strong);
    padding: 3px;
    transition: background .2s var(--ease);
}

.consent__switch-dot {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease);
}

.consent__switch input:checked + .consent__switch-track {
    background: var(--green-deep);
}

.consent__switch input:checked + .consent__switch-track .consent__switch-dot {
    transform: translateX(18px);
}

.consent__switch input:focus-visible + .consent__switch-track {
    outline: 2px solid var(--green-deep);
    outline-offset: 3px;
}

.consent__switch input:disabled + .consent__switch-track {
    opacity: .65;
    cursor: default;
}

.consent__option-title {
    font-weight: 600;
    font-size: .95rem;
}

.consent__badge {
    flex: none;
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--cream-2);
    border-radius: 999px;
    padding: 4px 10px;
}

.consent__option-desc {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.55;
    margin-top: 8px;
    padding-left: 56px;
}

.consent__modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.consent__meta {
    margin-top: 16px;
    font-size: .78rem;
    color: var(--muted-2);
}

/* ----------------------------------------------------------- responsive --- */

@media (max-width: 860px) {
    .consent__banner-inner {
        flex-wrap: wrap;
        row-gap: 12px;
        padding: 16px 0 18px;
    }

    .consent__mark {
        width: 36px;
        height: 36px;
    }

    .consent__mark svg {
        width: 18px;
        height: 18px;
    }

    .consent__banner-text {
        flex: 1 1 calc(100% - 52px);
    }

    .consent__banner-actions {
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .consent__banner-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .consent__link {
        flex: 1 1 100%;
        text-align: center;
    }

    .consent__option-desc {
        padding-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .consent__switch-track,
    .consent__switch-dot {
        transition: none !important;
    }
}

@media print {
    .consent {
        display: none !important;
    }
}

/* --------------------------------------------- aggancio nel footer --- */

.site-footer__consent {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer__consent:hover {
    color: #fff;
}

body.has-consent-modal {
    overflow: hidden;
}

/* Il banner non deve coprire i link del footer: spazio extra in fondo. */
body.has-consent-banner {
    padding-bottom: clamp(120px, 16vh, 190px);
}
