/* =========================================================
   WP Menu Lang — Language Switcher
   ========================================================= */

.wml-switcher {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
}

/* Posizioni */
.wml-switcher--header {
    top: 0;
    right: 0;
}
.wml-switcher--footer {
    bottom: 0;
    left: 0;
}

/* Se la wp-admin-bar è presente, abbassa lo switcher header */
.admin-bar .wml-switcher--header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar .wml-switcher--header {
        top: 46px;
    }
}

/* ── Toggle button ── */
.wml-switcher__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(15, 20, 40, 0.88);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    transition: background 0.18s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.wml-switcher--header .wml-switcher__toggle {
    border-radius: 0 0 0 6px;
}
.wml-switcher--footer .wml-switcher__toggle {
    border-radius: 0 6px 0 0;
}

.wml-switcher__toggle:hover,
.wml-switcher__toggle[aria-expanded="true"] {
    background: rgba(0, 90, 180, 0.92);
}

.wml-switcher__toggle .fi {
    width: 18px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Freccia */
.wml-switcher__arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255,255,255,0.7);
    margin-left: 2px;
    transition: transform 0.2s;
}
.wml-switcher__toggle[aria-expanded="true"] .wml-switcher__arrow {
    transform: rotate(180deg);
}

/* ── Dropdown list ── */
.wml-switcher__list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: rgba(15, 20, 40, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

/* Header: lista si apre in basso */
.wml-switcher--header .wml-switcher__list {
    position: absolute;
    top: 100%;
    right: 0;
    border-radius: 0 0 0 6px;
}
/* Footer: lista si apre in alto */
.wml-switcher--footer .wml-switcher__list {
    position: absolute;
    bottom: 100%;
    left: 0;
    border-radius: 6px 6px 0 0;
}

.wml-switcher__list.wml-open {
    display: block;
    animation: wmlSlideIn 0.15s ease;
}

@keyframes wmlSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Voci della lista ── */
.wml-switcher__item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: rgba(255,255,255,0.8) !important;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s;
    font-size: 13px;
    border-bottom: none !important;
}
.wml-switcher__item a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}
.wml-switcher__item--active a {
    color: #fff !important;
    font-weight: 600;
    background: rgba(0, 100, 200, 0.3);
}
.wml-switcher__item .fi {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media screen and (max-width: 480px) {
    .wml-switcher__label {
        display: none; /* Solo bandiera su mobile */
    }
    .wml-switcher__toggle {
        padding: 6px 8px;
    }
}
