/**
 * Lavder Polyglot — Language Switcher Styles
 *
 * Minimal, un-opinionated CSS. Designed to inherit theme styles.
 */

/* === List Switcher === */
.lavderp-switcher {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.lavderp-switcher li {
    margin: 0;
    padding: 0;
}

.lavderp-switcher a {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    text-decoration: none;
    padding: 0.25em 0.5em;
    border-radius: 3px;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.lavderp-switcher a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.lavderp-switcher .active a {
    font-weight: 600;
}

.lavderp-switcher .lavderp-flag {
    display: inline-block;
    width: 1.2em;
    height: 0.9em;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* === Dropdown Switcher === */
.lavderp-switcher-dropdown {
    position: relative;
    display: inline-block;
}

.lavderp-switcher-dropdown select {
    padding: 0.35em 2em 0.35em 0.5em;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    font-size: 0.9em;
    cursor: pointer;
    appearance: auto;
}

/* === Vertical List (for widgets/sidebars) === */
.lavderp-switcher--vertical {
    flex-direction: column;
    gap: 0.25em;
}

.lavderp-switcher--vertical a {
    display: flex;
    width: 100%;
    padding: 0.4em 0.6em;
}

/* === Flags Only === */
.lavderp-switcher--flags-only a {
    padding: 0.2em;
}

.lavderp-switcher--flags-only .lavderp-lang-name {
    display: none;
}

.lavderp-switcher--flags-only .lavderp-flag {
    width: 1.6em;
    height: 1.2em;
}

/* === Custom Dropdown === */
.lavderp-switcher--dropdown {
    position: relative;
    display: inline-block;
}

.lavderp-dd-trigger {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    font: inherit;
    color: inherit;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
}

.lavderp-dd-panel {
    position: absolute;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 99999;
    overflow: hidden;
}

.lavderp-dd-item {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: #1d2327 !important;
    transition: background .1s;
    white-space: nowrap;
}

.lavderp-dd-item:hover {
    background: #f0f5ff !important;
}

/* === Dropdown inside nav menus (Impreza, etc.) === */
.menu-item-lavderp-lang {
    position: relative !important;
}

.menu-item-lavderp-lang .lavderp-switcher--dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.menu-item-lavderp-lang .lavderp-dd-trigger {
    height: 100%;
    line-height: inherit !important;
    padding: 0 20px !important;
}

/* Override Impreza/theme nav styles */
.w-nav-list .menu-item-lavderp-lang,
.menu-item-lavderp-lang {
    overflow: visible !important;
}

.w-nav-list .menu-item-lavderp-lang .lavderp-dd-panel,
.menu-item-lavderp-lang .lavderp-dd-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
}

.w-nav-list .menu-item-lavderp-lang .lavderp-dd-trigger,
.menu-item-lavderp-lang .lavderp-dd-trigger {
    display: inline-flex !important;
    align-items: center !important;
    background: none !important;
    border: none !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
}

/* Force compact padding on dropdown items inside nav menus */
.menu-item-lavderp-lang .lavderp-dd-item,
.w-nav-list .lavderp-dd-item,
.lavderp-dd-panel .lavderp-dd-item {
    padding: 8px 16px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    font-size: 14px !important;
}

.lavderp-dd-panel {
    padding: 4px 0 !important;
}

/* Ensure the noscript fallback doesn't show when JS is active */
.lavderp-switcher--dropdown noscript {
    display: none;
}

/* === Floating Switcher === */
.lavderp-floating-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lavderp-floating-switcher .lavderp-switcher {
    margin: 0; padding: 0; list-style: none;
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}

.lavderp-floating-switcher .lavderp-switcher__flag {
    font-size: 20px; cursor: pointer; transition: transform .15s;
}

.lavderp-floating-switcher .lavderp-switcher__flag:hover { transform: scale(1.2); }
.lavderp-floating-switcher .lavderp-switcher__item.active .lavderp-switcher__flag { opacity: .5; }
.lavderp-floating-switcher a { text-decoration: none; }
.lavderp-floating-switcher .lavderp-switcher__name { font-size: 13px; }

/* Dropdown inside floating bubble */
.lavderp-floating-switcher .lavderp-switcher--dropdown {
    display: flex !important;
    align-items: center !important;
}

.lavderp-floating-switcher .lavderp-dd-trigger {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Panel centered relative to the trigger */
.lavderp-floating-switcher .lavderp-dd-panel {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
}

/* === Mobile/Desktop toggle for menu language items === */
/* Desktop: show dropdown <li>, hide individual mobile <li>s */
.lavderp-mobile-only {
    display: none !important;
}

/* Mobile (Impreza): hide dropdown, show individual items as native menu entries */
.w-nav.type_mobile .lavderp-desktop-only {
    display: none !important;
}

.w-nav.type_mobile .lavderp-mobile-only {
    display: list-item !important;
}

/* Mobile dropdown arrow */
.lavderp-mobile-arrow {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .5;
    transition: transform .2s;
    margin-left: 6px;
    vertical-align: middle;
}

.lavderp-mobile-only.opened .lavderp-mobile-arrow {
    transform: rotate(-135deg) translateY(-2px);
}

/* === Padding customization via CSS variables === */
.lavderp-floating-switcher {
    padding: var(--lavderp-float-padding, 10px 14px);
}

.lavderp-dd-trigger {
    padding: var(--lavderp-trigger-padding, 0) !important;
}

.lavderp-dd-item {
    padding: var(--lavderp-item-padding, 8px 14px) !important;
}

.lavderp-dd-panel {
    border-radius: var(--lavderp-panel-radius, 10px);
}

/* === RTL Support === */
[dir="rtl"] .lavderp-switcher {
    direction: rtl;
}
