
/* ==========================================================
   ECHI DI SOFIA — COOKIE CONSENT
   Stile autonomo
========================================================== */

/* ----------------------------------------------------------
   BANNER
---------------------------------------------------------- */

.echi-cookie-banner {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 99990;

    max-width: 1180px;
    margin: 0 auto;

    background: rgba(11, 15, 25, 0.97);
    color: #f5f1e8;

    border: 1px solid rgba(214, 174, 82, 0.45);
    border-radius: 16px;

    box-shadow:
        0 18px 55px rgba(0, 0, 0, 0.38),
        0 0 35px rgba(214, 174, 82, 0.08);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


.echi-cookie-content {
    display: flex;
    align-items: center;
    gap: 30px;

    padding: 22px 26px;
}


.echi-cookie-text {
    flex: 1;
    min-width: 0;
}


.echi-cookie-text h2 {
    margin: 0 0 8px;

    font-family: "Cinzel", Georgia, serif;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.04em;

    color: #d6ae52;
}


.echi-cookie-text p {
    margin: 0;

    max-width: 720px;

    font-family: "Inter", Arial, sans-serif;
    font-size: 0.86rem;
    line-height: 1.6;

    color: rgba(245, 241, 232, 0.86);
}


/* ----------------------------------------------------------
   PULSANTI
---------------------------------------------------------- */

.echi-cookie-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;

    flex-shrink: 0;
}


.echi-cookie-button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 8px;

    padding: 9px 14px;

    font-family: "Inter", Arial, sans-serif;
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.echi-cookie-button:hover {
    transform: translateY(-1px);
}


.echi-cookie-button:focus-visible {
    outline: 2px solid #d6ae52;
    outline-offset: 3px;
}


.echi-cookie-primary {
    background: #d6ae52;
    color: #0b0f19;
    border-color: #d6ae52;
}


.echi-cookie-primary:hover {
    background: #e2bf6b;
    border-color: #e2bf6b;
}


.echi-cookie-secondary {
    background: transparent;
    color: #f5f1e8;
    border-color: rgba(245, 241, 232, 0.28);
}


.echi-cookie-secondary:hover {
    border-color: rgba(214, 174, 82, 0.75);
    color: #d6ae52;
}


.echi-cookie-link {
    background: transparent;
    color: #d6ae52;
    border-color: transparent;
}


.echi-cookie-link:hover {
    color: #e2bf6b;
}


/* ----------------------------------------------------------
   FINESTRA PERSONALIZZAZIONE
---------------------------------------------------------- */

.echi-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;

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

    padding: 24px;

    background: rgba(4, 7, 13, 0.72);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}


.echi-cookie-modal[hidden],
.echi-cookie-banner[hidden],
.echi-cookie-settings[hidden] {
    display: none;
}


.echi-cookie-modal-box {
    width: min(620px, 100%);
    max-height: min(720px, calc(100vh - 48px));

    overflow-y: auto;

    background: #0b0f19;
    color: #f5f1e8;

    border: 1px solid rgba(214, 174, 82, 0.45);
    border-radius: 16px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5);
}


.echi-cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 22px 24px;

    border-bottom: 1px solid rgba(245, 241, 232, 0.1);
}


.echi-cookie-modal-header h2 {
    margin: 0;

    font-family: "Cinzel", Georgia, serif;
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 0.04em;

    color: #d6ae52;
}


.echi-cookie-close {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    appearance: none;
    border: 1px solid rgba(245, 241, 232, 0.18);
    border-radius: 50%;

    background: transparent;
    color: #f5f1e8;

    font-size: 1.35rem;
    line-height: 1;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.echi-cookie-close:hover {
    border-color: rgba(214, 174, 82, 0.7);
    color: #d6ae52;
    transform: rotate(90deg);
}


.echi-cookie-close:focus-visible {
    outline: 2px solid #d6ae52;
    outline-offset: 3px;
}


/* ----------------------------------------------------------
   OPZIONI
---------------------------------------------------------- */

.echi-cookie-options {
    padding: 8px 24px;
}


.echi-cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 20px 0;

    border-bottom: 1px solid rgba(245, 241, 232, 0.09);
}


.echi-cookie-option:last-child {
    border-bottom: 0;
}


.echi-cookie-option h3 {
    margin: 0 0 5px;

    font-family: "Cinzel", Georgia, serif;
    font-size: 0.92rem;
    font-weight: 500;

    color: #f5f1e8;
}


.echi-cookie-option p {
    margin: 0;
    max-width: 450px;

    font-family: "Inter", Arial, sans-serif;
    font-size: 0.79rem;
    line-height: 1.55;

    color: rgba(245, 241, 232, 0.68);
}


.echi-cookie-always {
    flex-shrink: 0;

    font-family: "Inter", Arial, sans-serif;
    font-size: 0.72rem;

    color: #d6ae52;
}


/* ----------------------------------------------------------
   INTERRUTTORI
---------------------------------------------------------- */

.echi-cookie-switch {
    position: relative;

    display: block;

    width: 46px;
    height: 25px;

    flex-shrink: 0;

    cursor: pointer;
}


.echi-cookie-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}


.echi-cookie-switch span {
    position: absolute;
    inset: 0;

    border-radius: 999px;

    background: rgba(245, 241, 232, 0.16);
    border: 1px solid rgba(245, 241, 232, 0.2);

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.echi-cookie-switch span::before {
    content: "";

    position: absolute;
    top: 3px;
    left: 3px;

    width: 17px;
    height: 17px;

    border-radius: 50%;

    background: #f5f1e8;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}


.echi-cookie-switch input:checked + span {
    background: rgba(214, 174, 82, 0.35);
    border-color: #d6ae52;
}


.echi-cookie-switch input:checked + span::before {
    transform: translateX(21px);
    background: #d6ae52;
}


.echi-cookie-switch input:focus-visible + span {
    outline: 2px solid #d6ae52;
    outline-offset: 3px;
}


/* ----------------------------------------------------------
   PIEDE DELLA FINESTRA
---------------------------------------------------------- */

.echi-cookie-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 20px 24px;

    border-top: 1px solid rgba(245, 241, 232, 0.1);
}


.echi-cookie-privacy {
    color: #d6ae52;

    font-family: "Inter", Arial, sans-serif;
    font-size: 0.76rem;

    text-decoration: none;
}


.echi-cookie-privacy:hover {
    text-decoration: underline;
}


.echi-cookie-modal-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
}


/* ----------------------------------------------------------
   PULSANTE PREFERENZE
---------------------------------------------------------- */

.echi-cookie-settings {
    position: fixed;
    left: 20px;
    bottom: 20px;

    z-index: 99989;

    width: 42px;
    height: 42px;

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

    border: 1px solid rgba(214, 174, 82, 0.55);
    border-radius: 50%;

    background: rgba(11, 15, 25, 0.94);
    color: #d6ae52;

    font-size: 1rem;

    cursor: pointer;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.28);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.echi-cookie-settings:hover {
    border-color: #d6ae52;
    background: #0b0f19;
    transform: translateY(-2px);
}


.echi-cookie-settings:focus-visible {
    outline: 2px solid #d6ae52;
    outline-offset: 3px;
}


/* ----------------------------------------------------------
   BLOCCO SCROLL QUANDO IL MODALE È APERTO
---------------------------------------------------------- */

body.echi-cookie-modal-open {
    overflow: hidden;
}


/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */

@media (max-width: 900px) {

    .echi-cookie-content {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .echi-cookie-actions {
        justify-content: flex-start;
    }

}


@media (max-width: 600px) {

    .echi-cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;

        border-radius: 13px;
    }

    .echi-cookie-content {
        padding: 18px;
    }

    .echi-cookie-text h2 {
        font-size: 0.98rem;
    }

    .echi-cookie-text p {
        font-size: 0.8rem;
    }

    .echi-cookie-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .echi-cookie-button {
        width: 100%;
        padding: 10px 8px;
        font-size: 0.73rem;
    }

    .echi-cookie-link {
        grid-column: 1 / -1;
    }

    .echi-cookie-modal {
        padding: 12px;
    }

    .echi-cookie-modal-box {
        max-height: calc(100vh - 24px);
        border-radius: 13px;
    }

    .echi-cookie-modal-header,
    .echi-cookie-options,
    .echi-cookie-modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .echi-cookie-option {
        gap: 14px;
    }

    .echi-cookie-option p {
        font-size: 0.75rem;
    }

    .echi-cookie-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .echi-cookie-modal-actions {
        justify-content: stretch;
    }

    .echi-cookie-modal-actions .echi-cookie-button {
        flex: 1;
    }

}


