/**
 * Select Component Styles - Custom Dropdown
 */

/* 隐藏原生 select */
.tpo-select-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* 自定义下拉框容器 */
.tpo-custom-dropdown {
    position: relative;
    width: 100%;
}

/* 下拉触发按钮 */
.tpo-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tpo-dropdown-trigger:hover {
    border-color: #96588a;
}

.tpo-dropdown-trigger:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 2px rgba(150, 88, 138, 0.2);
}

/* 下拉框打开状态 */
.tpo-custom-dropdown.open .tpo-dropdown-trigger {
    border-color: #96588a;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.tpo-custom-dropdown.open .tpo-dropdown-arrow {
    transform: rotate(180deg);
}

.tpo-custom-dropdown.open .tpo-dropdown-menu {
    display: block;
}

/* 选中项显示区域 */
.tpo-dropdown-selected {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
}

.tpo-dropdown-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.tpo-dropdown-placeholder {
    color: #999;
    font-size: 14px;
}

/* 下拉箭头 */
.tpo-dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: transform 0.2s ease;
    margin-left: 8px;
}

/* 下拉菜单 */
.tpo-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: -1px;
    background-color: #fff;
    border: 1px solid #96588a;
    border-top: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

/* 下拉选项 */
.tpo-dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.tpo-dropdown-option:last-child {
    border-bottom: none;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.tpo-dropdown-option:hover {
    background-color: #f5f5f5;
}

.tpo-dropdown-option.selected {
    background-color: #f0e6f5;
}

/* 选项标签 */
.tpo-option-label {
    font-size: 14px;
    color: #333;
}

/* 选项价格 - 统一使用 tpo-field-price */
.tpo-dropdown-option .tpo-field-price {
    font-size: 12px;
    color: #96588a;
    font-weight: 500;
    margin-left: 8px;
}

/* 下拉触发器中的价格 */
.tpo-dropdown-trigger .tpo-field-price {
    font-size: 12px;
    color: #96588a;
    font-weight: 500;
}

/* 键盘导航焦点样式 */
.tpo-dropdown-option:focus {
    outline: none;
    background-color: #e8d4f0;
}

/* 禁用状态 */
.tpo-dropdown-trigger.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 错误状态 */
.tpo-field.has-error .tpo-dropdown-trigger {
    border-color: #e2401c;
}

.tpo-field.has-error .tpo-dropdown-trigger:focus {
    box-shadow: 0 0 0 2px rgba(226, 64, 28, 0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .tpo-dropdown-menu {
        max-height: 200px;
    }

    .tpo-dropdown-option {
        padding: 12px 15px;
    }
}
