/* =============================================
   Saola Language Switcher Widget — style.css
   Chỉnh sửa tại đây để thay đổi giao diện mặc định.
   Tất cả custom qua Elementor Controls sẽ override qua CSS variables.
   ============================================= */

/* --- Trình bao ngoài --- */
.sfm-language-switcher-wrapper {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    font-family: inherit;
    z-index: 100;
    user-select: none;
}

/* --- Dòng hiển thị ngôn ngữ đang chọn --- */
.sfm-lang-active {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
    transition: opacity 0.25s ease;
}
.sfm-lang-active:hover {
    opacity: 0.8;
}

/* --- Tên ngôn ngữ --- */
.sfm-lang-active .sfm-lang-name {
    white-space: nowrap;
}

/* --- Cờ quốc gia --- */
.sfm-lang-active img.sfm-lang-flag {
    width: 24px;
    height: auto;
    display: inline-block;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

/* --- Icon mũi tên --- */
.sfm-lang-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.25s ease;
    fill: currentColor;
    opacity: 0.8;
}
.sfm-language-switcher-wrapper.sfm-ls-open .sfm-lang-icon {
    transform: rotate(180deg);
}

/* --- Danh sách dropdown --- */
.sfm-lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    padding: 6px 0;
    margin: 0;
    list-style: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 6px;
    min-width: 150px;

    /* Ẩn mặc định */
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

/* --- Hiện dropdown khi hover hoặc click (class sfm-ls-open) --- */
.sfm-language-switcher-wrapper:hover .sfm-lang-dropdown,
.sfm-language-switcher-wrapper.sfm-ls-open .sfm-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- Từng mục ngôn ngữ --- */
.sfm-lang-item {
    margin: 0;
    padding: 0;
}
.sfm-lang-item a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #333333 !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 400;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.sfm-lang-item a:hover {
    background: #f5f5f5;
    color: #E25B3E !important;
}
.sfm-lang-item img {
    width: 22px !important;
    height: auto !important;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
    margin: 0 !important;
}
