/**
 * WPML language switcher (legacy dropdown) styling.
 *
 * This was previously stored in WordPress's Customizer "Additional CSS"
 * field (a DB-stored `custom_css` post), which is not synced between the
 * local and staging databases. That caused the whole switcher to fall back
 * to WPML's bare default markup on any environment where this CSS was
 * missing: the flag <img> collapsed to 0x0 (no explicit size to rescue it
 * from the theme's `img { max-width:100%; height:auto }` reset), the
 * dropdown lost its hover-to-stay-open fix, and the submenu collapsed to a
 * near-zero-width column.
 *
 * Moved here so it's version-controlled and identical on every environment
 * via git, instead of living only in whichever database happened to have
 * it. Originally authored by Julius (29 may 2026) as Customizer CSS.
 */

/* ===== Basis styling toggle ===== */
.wpml-ls-legacy-dropdown a.wpml-ls-item-toggle {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

/* ===== Vlaggen rond ===== */
.wpml-ls-legacy-dropdown .wpml-ls-flag {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

/* ===== Default caret verwijderen ===== */
.wpml-ls-legacy-dropdown .wpml-ls-item-toggle:after {
    display: none !important;
}

.wpml-ls-sub-menu {
    width: max-content;
    padding-right: 0.5rem !important;
    margin-right: 1rem;
}

.wpml-ls-legacy-dropdown .wpml-ls-item-toggle span.wpml-ls-native {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================
   DROPDOWN — ALWAYS STAY OPEN ON HOVER (FIX)
   ========================================================== */

/* Zorg dat hover op LI het menu open houdt */
.wpml-ls-legacy-dropdown .wpml-ls-item-legacy-dropdown:hover > .wpml-ls-sub-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Prevent hide bug */
.wpml-ls-legacy-dropdown .wpml-ls-sub-menu {
    display: none;
    background: #fff !important;
    position: absolute;
    left: 0;
    transform: translateY(14px);
    border: none !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15) !important;
    padding: 6px 0 !important;
    z-index: 99999 !important;
}

/* No borders at all */
.wpml-ls-legacy-dropdown .wpml-ls-sub-menu li,
.wpml-ls-legacy-dropdown .wpml-ls-sub-menu a {
    border: none !important;
}

/* Dropdown items */
.wpml-ls-legacy-dropdown .wpml-ls-sub-menu a {
    padding: 8px 14px !important;
    display: flex !important;
    gap: 6px;
}

.wpml-ls-legacy-dropdown .wpml-ls-sub-menu li:hover {
    background: #f5f5f5 !important;
}

.wpml-ls-legacy-dropdown .wpml-ls-sub-menu {
    left: 0 !important;
    margin-left: 0 !important;
    top: calc(100% + 6px) !important;
    transform: none !important;
    border-radius: 10px !important;
    display: none;
    position: absolute !important;
}

/* dropdown blijft open */
.wpml-ls-item-legacy-dropdown:hover > .wpml-ls-sub-menu {
    display: block !important;
}

/* Dicht het hover-gat definitief */
.wpml-ls-item-legacy-dropdown {
    position: relative !important;
}

.wpml-ls-item-legacy-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}
