/* ============================================================================
   国家切换器样式（三个页面共用）
   结构：#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;
}

/* ============================================================================
   手机端优化：
   - 触发按钮收窄为纯图标（国旗+小箭头），不显示国家代码文字，节省空间
   - 按钮尺寸做成圆形，方便点击（至少 40x40 的可点击区域）
   - 下拉菜单在小屏幕上稍微加宽、贴右对齐，避免超出屏幕
   ============================================================================ */
@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; /* 手机上只留国旗图标，不显示 US/UK/DE 文字 */
    }

    .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;
    }
}
