/**
 * CHN Global Switcher - Slide Panel Styles
 * @version 1.4.0
 */

/* ========================================
   Elementor 容器覆盖（需要 !important）
======================================== */
.elementor-shortcode:has(.chn-switcher-trigger),
.elementor-widget-shortcode:has(.chn-switcher-trigger) .elementor-widget-container {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* ========================================
   触发按钮 - 地球图标
======================================== */
.chn-switcher-trigger {
    display: inline-flex;
    align-items: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0 !important;
}

.chn-switcher-trigger svg {
    width: 23px;
    height: 23px;
    stroke: var(--e-global-color-text);
    fill: none;
    stroke-width: 1.5;
    transition: stroke 0.25s ease;
}

.chn-switcher-trigger::after {
    content: '';
    width: 1px;
    height: 18px;
    background-color: var(--e-global-color-text);
    opacity: 0.3;
    margin-left: 12px;
}

.chn-switcher-trigger:hover svg {
    stroke: var(--e-global-color-primary);
}

/* ========================================
   遮罩层
======================================== */
.chn-switcher-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 99998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.chn-switcher-overlay.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0s;
}

/* ========================================
   滑出面板
======================================== */
.chn-switcher-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: var(--e-global-color-accent);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chn-switcher-panel.is-active {
    transform: translateX(0);
}

/* ========================================
   面板头部
======================================== */
.chn-switcher-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--e-global-color-secondary);
}

.chn-switcher-panel__title {
    font-size: 18px;
    font-weight: 500;
    color: var(--e-global-color-text);
    margin: 0;
}

.chn-switcher-panel__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
    padding: 0 !important;
}

.chn-switcher-panel__close:hover {
    background: var(--e-global-color-secondary);
}

.chn-switcher-panel__close svg {
    width: 20px;
    height: 20px;
    stroke: var(--e-global-color-text);
    stroke-width: 2;
    fill: none;
}

/* ========================================
   面板内容
======================================== */
.chn-switcher-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ========================================
   分区
======================================== */
.chn-switcher-section {
    margin-bottom: 24px;
}

.chn-switcher-section:last-child {
    margin-bottom: 0;
}

.chn-switcher-section__title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--e-global-color-text);
    margin: 0 0 16px;
}

/* ========================================
   选项列表
======================================== */
.chn-switcher-list,
.chn-switcher-list__item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chn-switcher-list__item {
    margin-bottom: 6px;
}

/* ========================================
   链接/按钮样式
======================================== */
.chn-switcher-list__link {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    border-radius: 45px;
    text-decoration: none;
    color: var(--e-global-color-text);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: #FAFAFA;
    width: 100%;
}

.chn-switcher-list__link:hover {
    background: var(--e-global-color-secondary);
}

.chn-switcher-list__link.is-active {
    background: var(--e-global-color-primary);
    color: var(--e-global-color-accent);
}

.chn-switcher-list__link.is-active:hover {
    filter: brightness(0.9);
}

/* ========================================
   旗帜图标
======================================== */
.chn-switcher-list__flag {
    width: 24px;
    height: 18px;
    margin-right: 14px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

/* ========================================
   货币选项
======================================== */
.chn-switcher-list__link.chn-currency-item {
    justify-content: space-between;
}

.chn-currency-code {
    text-align: left;
}

.chn-currency-symbol {
    text-align: right;
    color: var(--e-global-color-text);
}

.chn-switcher-list__link.is-active .chn-currency-symbol {
    color: inherit;
}

/* ========================================
   Loading 状态
======================================== */
.chn-switcher-panel.is-loading .chn-switcher-panel__content {
    opacity: 0.5;
    pointer-events: none;
}

.chn-switcher-list__link.is-loading {
    opacity: 0.6;
    cursor: wait;
}