/* Стили для кастомных выпадающих меню */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-button {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    min-height: 48px;
}

.custom-select-button:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.custom-select-button:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(102, 126, 234, 0.15);
}

.custom-select-button:disabled,
.custom-select-wrapper.disabled .custom-select-button {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.custom-select-wrapper.disabled .custom-select-arrow {
    color: #999;
}

.custom-select-wrapper.required .custom-select-button:not(:focus):invalid {
    border-color: #f5576c;
}

.custom-select-button.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 2px 8px rgba(102, 126, 234, 0.15);
}

.custom-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-arrow {
    color: #667eea;
    font-size: 0.75rem;
    transition: transform 0.3s;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.custom-select-button.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10002 !important;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Когда dropdown открыт */
.custom-select-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 99999;
}

.custom-select-options {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.custom-select-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
}

.custom-select-option:hover,
.custom-select-option.highlighted {
    background: #f0f4ff;
    color: #667eea;
}

.custom-select-option.selected {
    background: #e8f0fe;
    color: #667eea;
    font-weight: 500;
}

.custom-select-option.selected:hover,
.custom-select-option.selected.highlighted {
    background: #d0e3ff;
}

/* Стили для скроллбара в выпадающем списке */
.custom-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Адаптивность */
@media (max-width: 768px) {
    .custom-select-button {
        font-size: 0.95rem;
        padding: 0.7rem 2.2rem 0.7rem 0.7rem;
    }
    
    .custom-select-option {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }
    
    .custom-select-dropdown {
        max-height: 250px;
    }
}

