.custom-select-wrapper {
    position: relative;
    width: 100%;
}

/* Select nativo - oculto por defecto, visible en móvil */
.custom-select-wrapper select {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: var(--panel-2);
    border: 1px solid var(--borders);
    border-radius: 8px;
    color: var(--txt);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    min-height: 48px;
}

.custom-select-wrapper select:focus {
    outline: none;
    border-color: var(--hover);
}

/* Mostrar select nativo en móvil */
@media (max-width: 768px) {
    .custom-select-wrapper select {
        display: block;
    }
    .custom-select-trigger,
    .custom-select-options {
        display: none !important;
    }
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--panel-2);
    border: 1px solid var(--borders);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
}

.custom-select-trigger:hover {
    border-color: #999;
}

.custom-select-trigger.active {
    border-color: var(--hover);
}

.custom-select-trigger .flag-icon {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
}

.custom-select-trigger .text {
    flex: 1;
    color: var(--txt);
}

.custom-select-trigger .text.placeholder {
    color: var(--muted);
}

.custom-select-trigger .arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.2s;
}

.custom-select-trigger.active .arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--borders);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    top: calc(100% + 4px);
    left: 0;
}

.custom-select-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-option:hover {
    background: var(--hover);
}

.custom-option.selected {
    background: var(--panel-2);
    color: var(--txt);
    font-weight: 500;
}

.custom-option .flag-icon {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
}

.custom-option .text {
    flex: 1;
}

.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}