:root {
    --topbar-bg: #252525;
    --topbar-fg: #fff;
    --topbar-height: 44px; /* desktop */
    --gap-sm: 10px;
    --gap-md: 18px;
    --container-max: 1200px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}
.topbar {
    background: var(--topbar-bg);
    color: var(--topbar-fg);
    font-family: var(--font);
    line-height: 1;
}
.topbar__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
/* SINISTRA */
.topbar__left {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    flex-wrap: wrap;
}
.topbar__contact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0; /* tap target su mobile */
    color: var(--topbar-fg);
    text-decoration: none;
    white-space: nowrap;
}
.topbar__contact img {
    width: 18px;
    height: 18px;
    display: block;
}
.topbar__contact:hover {
    opacity: .8;
}
.topbar__contact-text {
    font-weight: 700;
    font-size: 15px;
}
/* DESTRA */
.topbar__right {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}
.topbar__action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    text-decoration: none;
    color: var(--topbar-fg);
}
.topbar__dropdown {
    /*width:22px; height:22px;*/
    display: block;
    transition: opacity .2s linear, transform .2s ease;
}
.topbar__action:hover img {
    opacity: .7;
    transform: translateY(-1px);
}
.topbar__label {
    font-size: 14px;
    font-weight: 600;
}
/* RESPONSIVE */
@media (max-width: 900px) {
    :root {
        --topbar-height: 48px;
    }
    .topbar__label {
        display: none;
    } /* icone sole su tablet/mobile */
    /*.topbar__action img{ width:24px; height:24px; }*/
}
@media (max-width: 640px) {
    .topbar__inner {
        align-items: stretch;
        gap: 8px;
    }
    .topbar__left {
        flex: 1 1 auto;
        gap: var(--gap-sm);
    }
    .topbar__right {
        flex: 0 0 auto;
        gap: 14px;
    }
    .topbar__contact-text {
        font-size: 14px;
    }
}
@media (max-width: 400px) {
    .topbar__contact-text {
        font-size: 13px;
    }
    .topbar__contact img {
        width: 16px;
        height: 16px;
    }
}
/* ========== MOBILE 480px: layout su 2 righe, azioni a destra su una riga ========= */
@media (max-width: 480px) {
    .topbar__inner {
        flex-direction: column; /* due righe */
        align-items: stretch;
        min-height: auto;
        padding: 6px 10px;
        gap: 6px;
    }
    .topbar__left {
        order: 1;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: wrap;
    }
    .topbar__right {
        order: 2;
        justify-content: space-between; /* icone distanziate */
        gap: 14px;
    }
    /*.topbar__action img{ width:24px; height:24px; }*/
    .topbar__label {
        display: none;
    } /* solo icone a destra su mobile */
    .topbar__contact {
        padding: 6px 0; /* tap target comodo */
        white-space: nowrap;
    }
    .topbar__contact-text {
        font-size: 14px;
    }
}
/* ========== MOBILE 360px: testi più compatti, andata a capo consentita a sinistra ======= */
@media (max-width: 360px) {
    .topbar__left {
        gap: 8px;
    }
    .topbar__contact {
        white-space: normal; /* consenti capo se serve */
        line-height: 1.2;
    }
    .topbar__contact img {
        width: 16px;
        height: 16px;
    }
    .topbar__contact-text {
        font-size: 13px;
    }
    /* Abbrevia automaticamente il testo WhatsApp su schermi stretti */
    .topbar__contact.is-whatsapp .topbar__contact-text {
        display: none;
    }
    .topbar__contact.is-whatsapp::after {
        content: "WhatsApp";
        font-weight: 700;
        font-size: 13px;
    }
    /* Se le icone a destra non entrano, diventano scrollabili orizzontalmente */
    .topbar__right {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        gap: 16px;
        padding-bottom: 2px; /* spazio per scrollbar iOS */
    }
}
/* ========== MICRO 320px e meno: ancora più compatti, margini ridotti ==================== */
@media (max-width: 320px) {
    .topbar__inner {
        padding: 6px 8px;
        gap: 4px;
    }
    .topbar__left {
        gap: 6px;
    }
    .topbar__right {
        gap: 12px;
    }
    /*.topbar__action img{ width:22px; height:22px; }*/
}
/* Opzionale: fai diventare la topbar “sticky” su mobile lungo */
@media (max-width: 900px) {
    .topbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        /* supporto tacca iOS */
        padding-top: constant(safe-area-inset-top);
        padding-top: env(safe-area-inset-top);
    }
}
/* ===== Dropdown mobile, allineato a destra dell’icona WhatsApp ===== */
.topbar__dropdown {
    position: relative;
    display: none; /* mostrato solo su mobile */
}
.topbar__dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: transparent;
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}
.topbar__dropdown-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, .5);
    outline-offset: 2px;
}
.topbar__dropdown-caret {
    width: 14px;
    height: 14px;
}
.topbar__dropdown-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    background: #252525;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .12);
    /*border-radius: 12px;*/
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    z-index: 1001;
}
.topbar__dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
}
.topbar__dropdown-item img {
    /*width: 22px;
    height: 22px;*/
    display: block;
}
.topbar__dropdown-item:hover {
    background: rgba(255, 255, 255, .08);
}
/* freccetta quando aperto */
.topbar__dropdown.is-open .topbar__dropdown-caret {
    transform: rotate(180deg);
    transition: transform .2s ease;
}
/* RESPONSIVE: mostra dropdown e nasconde blocco destro su mobile */
@media (max-width: 900px) {
    .topbar__right {
        display: none;
    }
    .topbar__dropdown {
        display: block;
    }
}
/* --- MOBILE: il gruppo di sinistra prende tutta la riga
   e il bottone menu si ancora SEMPRE a destra --- */
@media (max-width: 900px) {
    .topbar__inner {
        /* se avevi messo flex-direction: column, mantienilo pure;
       l'importante è che .topbar__left occupi tutta la larghezza */
    }
    .topbar__left {
        display: flex;
        align-items: center;
        flex-wrap: nowrap; /* evita che il bottone vada a capo */
        width: 100%; /* occupa l’intera riga */
        gap: 10px;
        min-width: 0; /* permette al testo di ridursi se serve */
    }
    .topbar__dropdown {
        margin-left: auto; /* questa riga lo spinge SEMPRE a destra */
    }
    /* testi compatti per evitare il wrap precoce */
    .topbar__contact-text {
        white-space: nowrap;
    }
}
/* schermi molto stretti: accorcia WhatsApp per salvare spazio */
@media (max-width: 360px) {
    .topbar__contact.is-whatsapp .topbar__contact-text {
        display: none;
    }
    .topbar__contact.is-whatsapp::after {
        content: "WhatsApp";
        font-weight: 700;
        font-size: 13px;
    }
}