/* ============================================================================
   国家切换器样式（两个页面共用）
   结构：#country-switcher-container 放在 .nav-right 里（跟汉堡菜单按钮同级），
   .nav-right 是 nav-container 的独立flex子项，永远固定在导航栏最右侧，
   不会被 nav-menu 里的链接挤没，手机端也不会被下拉菜单遮挡。
   ============================================================================ */

#country-switcher-container {
    flex-shrink: 0;
}

.country-switcher {
    position: relative;
}

.country-switcher-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.country-switcher-trigger:hover {
    background: #ebebeb;
}

.country-switcher-trigger .cs-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.country-switcher-trigger i {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.country-switcher-trigger.open i {
    transform: rotate(180deg);
}

.country-switcher-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    min-width: 190px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 2100;
}

.country-switcher-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.country-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    transition: background 0.15s ease;
}

.country-switcher-item:hover {
    background: #f5f5f5;
}

.country-switcher-item.active {
    background: #e8f4ff;
    color: #007bff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .country-switcher-trigger {
        padding: 8px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        justify-content: center;
        gap: 0;
    }

    .country-switcher-trigger .cs-code {
        display: none;
    }

    .country-switcher-trigger i {
        display: none;
    }

    .country-switcher-trigger .cs-flag {
        font-size: 1.3rem;
    }

    .country-switcher-menu {
        right: 0;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .country-switcher-trigger {
        width: 36px;
        height: 36px;
    }

    .country-switcher-menu {
        right: -8px;
        min-width: 170px;
    }
}
