/* ============================================================
   HORIZON MUNDI — cookie-banner.css
   Banner consenso cookie + pannello preferenze modale
   ============================================================ */

/* ─── Banner principale — fixed bottom ───────────────────── */
.hm-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1A3A3A;
    z-index: 9999;
    padding: 20px 32px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hm-cookie-banner.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.hm-cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.hm-cookie-banner__text {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    max-width: 600px;
    margin: 0;
}

.hm-cookie-banner__text a {
    color: #B8962E;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hm-cookie-banner__text a:hover {
    color: #C4A882;
}

.hm-cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ─── Bottoni banner ─────────────────────────────────────── */
.hm-cookie-btn--accept,
.hm-cookie-btn--settings,
.hm-cookie-btn--reject {
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    line-height: 1;
    white-space: nowrap;
}

.hm-cookie-btn--accept {
    background: #7D2E3E;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
}

.hm-cookie-btn--accept:hover {
    opacity: 0.88;
}

.hm-cookie-btn--settings {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 10px 24px;
}

.hm-cookie-btn--settings:hover {
    border-color: rgba(255, 255, 255, 0.75);
}

.hm-cookie-btn--reject {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 10px 16px;
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hm-cookie-btn--reject:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* ─── Modale preferenze ──────────────────────────────────── */
.hm-cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hm-cookie-modal.is-open {
    opacity: 1;
}

.hm-cookie-modal__box {
    background: #ffffff;
    max-width: 520px;
    width: 90%;
    padding: 40px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.hm-cookie-modal__title {
    font-family: 'Jost', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1A3A3A;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.hm-cookie-modal__intro {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 24px;
}

/* ─── Righe toggle ────────────────────────────────────────── */
.hm-cookie-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 0.5px solid #E8E8E8;
    gap: 16px;
}

.hm-cookie-toggle-row:last-of-type {
    border-bottom: none;
}

.hm-cookie-toggle-info {
    flex: 1;
}

.hm-cookie-toggle-label {
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1A3A3A;
    line-height: 1.3;
}

.hm-cookie-toggle-desc {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #6B6B6B;
    margin-top: 3px;
    line-height: 1.5;
}

.hm-cookie-always-on {
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    color: #1A3A3A;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Toggle switch ──────────────────────────────────────── */
.hm-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.hm-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 24px;
    background: #E8E8E8;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
    margin: 0;
    flex-shrink: 0;
}

.hm-toggle input[type="checkbox"]:checked {
    background: #1A3A3A;
}

.hm-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: left 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hm-toggle input[type="checkbox"]:checked::after {
    left: 23px;
}

.hm-toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid #B8962E;
    outline-offset: 2px;
}

/* ─── Azioni modale ───────────────────────────────────────── */
.hm-cookie-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 32px;
    justify-content: flex-end;
}

.hm-cookie-modal__footnote {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: #999;
    margin-top: 16px;
    text-align: center;
    line-height: 1.5;
}

.hm-cookie-modal__footnote a {
    color: #B8962E;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .hm-cookie-banner {
        padding: 16px 20px;
    }

    .hm-cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .hm-cookie-banner__text {
        max-width: 100%;
        font-size: 12px;
    }

    .hm-cookie-banner__actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .hm-cookie-btn--accept,
    .hm-cookie-btn--settings,
    .hm-cookie-btn--reject {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }

    .hm-cookie-modal__box {
        padding: 28px 24px;
    }

    .hm-cookie-modal__actions {
        flex-direction: column;
    }

    .hm-cookie-modal__actions .hm-cookie-btn--accept,
    .hm-cookie-modal__actions .hm-cookie-btn--settings {
        width: 100%;
        text-align: center;
    }
}
