/**
 * Currency Selector with Flag/Country/Currency Format
 * 货币选择器 - 国旗/国家/货币格式
 */

/* ========== 货币选择器容器 ========== */
.currency-selector-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

/* ========== 当前选中的货币显示 ========== */
.currency-selector-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #444444;
    transition: all 0.3s ease;
    height: 100%;
}

.currency-selector-trigger:hover {
    color: #D4AF37;
}

.currency-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.currency-text {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
    white-space: nowrap;
}

.currency-arrow {
    font-size: 8px;
    transition: transform 0.3s ease;
    margin-left: 2px;
}

.currency-selector-trigger.active .currency-arrow {
    transform: rotate(180deg);
}

/* ========== 货币下拉面板 ========== */
.currency-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 320px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    animation: slideDown 0.3s ease;
}

.currency-dropdown.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 下拉面板标题 ========== */
.currency-dropdown-header {
    padding: 15px 20px;
    border-bottom: 2px solid #F0F0F0;
    background: linear-gradient(135deg, #F4E4C1, #FFF8E7);
}

.currency-dropdown-title {
    font-size: 16px;
    font-weight: 700;
    color: #2C2C2C;
    margin: 0;
}

/* ========== 货币列表 ========== */
.currency-list {
    padding: 10px 0;
}

.currency-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.currency-item:hover {
    background: #F8F8F8;
    border-left-color: #D4AF37;
}

.currency-item.active {
    background: linear-gradient(135deg, #E8D4B8, #F4E4C1);
    border-left-color: #B8860B;
}

.currency-item-flag {
    width: 32px;
    height: 24px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.currency-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.currency-item-country {
    font-size: 14px;
    font-weight: 600;
    color: #2C2C2C;
}

.currency-item-code {
    font-size: 12px;
    color: #666;
}

.currency-item-check {
    color: #D4AF37;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.currency-item.active .currency-item-check {
    opacity: 1;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .currency-dropdown {
        min-width: 280px;
        max-height: 400px;
    }
    
    .currency-selector-trigger {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .currency-flag {
        width: 20px;
        height: 15px;
    }
    
    .currency-item {
        padding: 10px 15px;
    }
    
    .currency-item-flag {
        width: 28px;
        height: 21px;
    }
}

/* ========== 滚动条样式 ========== */
.currency-dropdown::-webkit-scrollbar {
    width: 6px;
}

.currency-dropdown::-webkit-scrollbar-track {
    background: #F0F0F0;
    border-radius: 3px;
}

.currency-dropdown::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 3px;
}

.currency-dropdown::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}
