/* ═══ TOPBAR ════════════════════════════════════════════════════════ */
.topbar {
    background: #061e30;
    color: rgba(255,255,255,0.7);
    font-size: 12.5px;
    padding: 7px 0;
}
.topbar .container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.topbar__item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.topbar__item svg { opacity: 0.55; flex-shrink: 0; }
.topbar__item a {
    color: rgba(255,255,255,0.72);
    transition: color 0.15s;
}
.topbar__item a:hover { color: var(--azzurro); }
.topbar__sep { color: var(--azzurro); font-weight: 700; margin: 0 2px; }

/* ═══ SITE HEADER ═══════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9998;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(7,70,113,0.07);
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 66px;
}

/* ─── Logo ──────────────────────────────────────────────────────── */
.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-mark {
    width: 42px;
    height: 42px;
    background: var(--blu);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logo-mark__ic {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--white);
    letter-spacing: -0.03em;
}
.logo-text { display: flex; flex-direction: column; }
.logo-text__name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.02em;
    color: var(--blu);
    line-height: 1.1;
}
.logo-text__sub {
    font-size: 10px;
    color: var(--text-soft);
    letter-spacing: 0.03em;
    line-height: 1;
}

/* ─── Nav principale ────────────────────────────────────────────── */
.main-nav { display: flex; align-items: center; }
.nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav__list li a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-mid);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav__list li a:hover,
.nav__list li.current-menu-item > a,
.nav__list li.current_page_item > a {
    background: var(--blu-light);
    color: var(--blu);
}
/* CTA preventivo */
.nav__list li.nav__cta > a,
.nav__list li:last-child > a[href*="preventivo"] {
    background: var(--blu);
    color: var(--white);
    font-weight: 600;
    padding: 8px 18px;
}
.nav__list li.nav__cta > a:hover,
.nav__list li:last-child > a[href*="preventivo"]:hover {
    background: var(--azzurro);
    color: var(--white);
}

/* ─── Hamburger ─────────────────────────────────────────────────── */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    background: transparent;
    transition: background 0.15s;
    flex-shrink: 0;
    position: relative;
    z-index: 9999;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover { background: var(--blu-light); }
.nav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--blu);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s, width 0.25s;
    transform-origin: center;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0; width: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .topbar { display: none; }

    /* fixed è più affidabile di sticky su iOS Safari per i tap */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    /* compensa l'header fixed */
    #page { padding-top: 56px; }

    .header__inner { height: 56px; }

    .logo-text__sub { display: none; }

    .nav-toggle { display: flex; }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--white);
        border-top: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(7,70,113,0.12);
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
        z-index: 99;
    }
    .main-nav.is-open { max-height: 400px; }

    .nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0 16px;
    }
    .nav__list li a {
        padding: 13px 20px;
        border-radius: 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav__list li:last-child a { border-bottom: none; }
    .nav__list li.nav__cta > a,
    .nav__list li:last-child > a[href*="preventivo"] {
        margin: 12px 16px 0;
        border-radius: var(--radius-sm);
        text-align: center;
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .logo-text__name { font-size: 15px; }
    .logo-mark { width: 36px; height: 36px; }
    .logo-mark__ic { font-size: 15px; }
}
