/*
 * GrowthCrew Page Builder — front-end language switcher.
 * Registered by WPPB_Multilingual::register_switcher_style(); enqueued
 * only when the switcher actually renders (shortcode or footer auto-inject).
 * Opens on hover / keyboard focus — no JS dependency.
 */

.wppb-ml-switcher {
    --wppb-ml-bg: #ffffff;
    --wppb-ml-border: #e3e7ee;
    --wppb-ml-text: #1f2937;
    --wppb-ml-muted: #6b7280;
    --wppb-ml-primary: #145ef3;
    --wppb-ml-primary-soft: rgba(20, 94, 243, 0.08);
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    z-index: 9990;
}

.wppb-ml-switcher--floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
}

.wppb-ml-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--wppb-ml-bg);
    border: 1px solid var(--wppb-ml-border);
    border-radius: 100px;
    color: var(--wppb-ml-text);
    font: inherit;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(3, 24, 69, 0.12);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wppb-ml-switcher__toggle:hover,
.wppb-ml-switcher:focus-within .wppb-ml-switcher__toggle {
    border-color: var(--wppb-ml-primary);
    box-shadow: 0 4px 16px rgba(3, 24, 69, 0.18);
}

.wppb-ml-switcher__globe { font-size: 15px; line-height: 1; }
.wppb-ml-switcher__current-code { font-weight: 700; letter-spacing: 0.3px; }
.wppb-ml-switcher__current-name { color: var(--wppb-ml-muted); }
.wppb-ml-switcher__caret { font-size: 10px; color: var(--wppb-ml-muted); }

.wppb-ml-switcher__menu {
    position: absolute;
    right: 0;
    min-width: 200px;
    margin: 8px 0 0;
    padding: 6px;
    list-style: none;
    background: var(--wppb-ml-bg);
    border: 1px solid var(--wppb-ml-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(3, 24, 69, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

/* Floating switcher opens upward so it doesn't run off the bottom edge. */
.wppb-ml-switcher--floating .wppb-ml-switcher__menu {
    top: auto;
    bottom: 100%;
    margin: 0 0 8px;
    transform: translateY(-6px);
}

.wppb-ml-switcher__toggle:focus + .wppb-ml-switcher__menu,
.wppb-ml-switcher:hover .wppb-ml-switcher__menu,
.wppb-ml-switcher:focus-within .wppb-ml-switcher__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wppb-ml-switcher__item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--wppb-ml-text);
    text-decoration: none;
    transition: background 0.12s ease;
}

.wppb-ml-switcher__item a:hover,
.wppb-ml-switcher__item a:focus {
    background: var(--wppb-ml-primary-soft);
    color: var(--wppb-ml-text);
}

.wppb-ml-switcher__item.is-current a {
    background: var(--wppb-ml-primary-soft);
    font-weight: 600;
}

.wppb-ml-switcher__item.is-current a::after {
    content: "\2713";
    margin-left: auto;
    color: var(--wppb-ml-primary);
    font-weight: 700;
}

.wppb-ml-switcher__code {
    flex: 0 0 auto;
    min-width: 26px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.4px;
    color: var(--wppb-ml-muted);
}

.wppb-ml-switcher__item.is-current .wppb-ml-switcher__code { color: var(--wppb-ml-primary); }
.wppb-ml-switcher__name { color: inherit; }

@media (max-width: 600px) {
    .wppb-ml-switcher__current-name { display: none; }
}
