/* ============================================================
   Zelda Nav Menu — style.css
   ============================================================ */

/* Wrapper generale */
.znm-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    width: 100%;
}

/* Logo */
.znm-logo img {
    display: block;
    max-height: 48px;
    width: auto;
}

/* ── DESKTOP NAV ─────────────────────────────────────────── */
.znm-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px; /* override da Elementor */
}

.znm-nav a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Hover desktop — fallback se il controllo Elementor non è impostato */
.znm-nav > li:hover > a {
    opacity: 0.75;
}

/* Active/current desktop — fallback CSS che copre tutte le classi WordPress */
.znm-nav > li[class*="current"] > a {
    opacity: 1;
}

/* Active/current mobile sottomenu — fallback */
.znm-sub li[class*="current"] > a {
    opacity: 1;
}

.znm-arrow {
    font-size: 0.65em;
    transition: transform 0.2s ease;
    display: inline-block;
}

/* ── DROPDOWN ────────────────────────────────────────────── */
.znm-item {
    position: relative;
    list-style: none;
}

.znm-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 9999;
}

.znm-dropdown li {
    list-style: none;
}

.znm-dropdown a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9em;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.znm-dropdown a:hover {
    background: rgba(0,0,0,0.05);
}

/* Apri dropdown all'hover */
.znm-item.has-dropdown:hover > .znm-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.znm-item.has-dropdown:hover > a .znm-arrow {
    transform: rotate(180deg);
}

/* ── HAMBURGER ───────────────────────────────────────────── */
/* Reset completo stili Elementor sui bottoni */
.znm-hamburger,
.znm-hamburger:hover,
.znm-hamburger:focus,
.znm-hamburger:active {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px !important;
    height: 36px !important;
    min-height: unset !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 0 !important;
    margin-left: auto;
    z-index: 10001;
    outline: none;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1;
}

.znm-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Icona X quando aperto */
.znm-hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.znm-hamburger.is-open span:nth-child(2) {
    opacity: 0;
}
.znm-hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── MOBILE MENU ─────────────────────────────────────────── */
.znm-mobile-menu {
    position: fixed;
    /* top viene impostato via JS */
    left: 20px;
    right: 20px;
    background: #111;
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);

    /* Nascosto di default, aperto solo via JS */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
    pointer-events: none;
}

.znm-mobile-menu.is-open {
    max-height: 75vh;
    overflow-y: auto;
    opacity: 1;
    padding: 8px 0;
    pointer-events: auto;
}

.znm-mobile-item {
    list-style: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.znm-mobile-item:last-child {
    border-bottom: none;
}

.znm-mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.znm-mobile-row a {
    flex: 1;
    display: block;
    padding: 14px 20px;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.2s ease;
}

/* Toggle accordion */
.znm-toggle,
.znm-toggle:hover,
.znm-toggle:focus,
.znm-toggle:active {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #ffffff; /* override da Elementor tramite il controllo colore freccia */
    cursor: pointer;
    padding: 14px 16px !important;
    font-size: 1em;
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
    outline: none;
    line-height: 1;
    min-height: unset !important;
}

.znm-toggle.is-open {
    transform: rotate(180deg);
}

/* Sottomenu accordion */
.znm-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.znm-sub.is-open {
    max-height: 600px;
}

.znm-sub li {
    list-style: none;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.znm-sub a {
    display: block;
    padding: 12px 20px 12px 36px;
    text-decoration: none;
    font-size: 0.9em;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.znm-sub a:hover {
    opacity: 1;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .znm-nav {
        display: none;
    }

    .znm-hamburger,
    .znm-hamburger:hover,
    .znm-hamburger:focus,
    .znm-hamburger:active {
        display: flex !important;
    }

    .znm-wrapper {
        flex-wrap: wrap;
        position: relative;
    }
}
