/**
 * Shopping auth modal — country/city dropdown.
 * Panel is portaled to document.body when open. MUST respect [hidden] when closed.
 */

/* Closed — never show inline in the form (fixes stacked search boxes in modal) */
.searchable-select__dropdown.searchable-select__dropdown--auth[hidden],
.searchable-select--auth .searchable-select__dropdown[hidden] {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Open — floating panel (on body via JS) */
.searchable-select__dropdown.searchable-select__dropdown--auth:not([hidden]),
.searchable-select__dropdown--auth.searchable-select__dropdown--fixed:not([hidden]) {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    z-index: 10050 !important;
    background: #1e293b !important;
    background-image: linear-gradient(165deg, #2d3a4f 0%, #1e293b 50%, #172033 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-radius: 12px !important;
    box-shadow:
        0 0 0 1px rgba(74, 111, 165, 0.15),
        0 20px 50px rgba(0, 0, 0, 0.6) !important;
    overflow: hidden !important;
    color: #f1f5f9 !important;
    min-width: 200px;
    max-height: min(280px, 45vh) !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__search {
    flex-shrink: 0;
    width: 100% !important;
    padding: 12px 14px 12px 38px !important;
    border: none !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25) !important;
    background-color: #0f172a !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
    background-size: 16px !important;
    color: #f8fafc !important;
    font-size: 0.9rem !important;
    -webkit-text-fill-color: #f8fafc !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__search::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__list {
    flex: 1 1 auto !important;
    min-height: 48px !important;
    max-height: 200px !important;
    margin: 0 !important;
    padding: 6px 0 !important;
    list-style: none !important;
    overflow-y: auto !important;
    background: #1e293b !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option,
.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option--auth {
    display: block !important;
    padding: 11px 16px !important;
    margin: 2px 6px !important;
    border-radius: 8px !important;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-left: 3px solid transparent !important;
    cursor: pointer !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option:nth-child(even),
.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option--auth:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option:hover,
.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option.is-highlighted,
.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option--auth:hover,
.searchable-select__dropdown--auth:not([hidden]) .searchable-select__option--auth.is-highlighted {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(90deg, rgba(74, 111, 165, 0.55) 0%, rgba(106, 140, 191, 0.35) 100%) !important;
    border-left-color: #8fb4e8 !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__empty {
    margin: 0 !important;
    padding: 1.25rem 14px !important;
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    background: #1e293b !important;
    text-align: center !important;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__list::-webkit-scrollbar {
    width: 6px;
}

.searchable-select__dropdown--auth:not([hidden]) .searchable-select__list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 6px;
}

/* Trigger button in auth form */
.searchable-select--auth .searchable-select__control {
    min-height: 48px;
    padding: 12px 40px 12px 45px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-size: 0.95rem;
}

.searchable-select--auth .searchable-select__control:hover {
    border-color: rgba(74, 111, 165, 0.6);
    background: rgba(255, 255, 255, 0.08);
}

.searchable-select--auth.is-open .searchable-select__control {
    border-color: #4a6fa5;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(74, 111, 165, 0.15);
}

.searchable-select--auth .searchable-select__value--placeholder {
    color: #94a3b8;
}

.searchable-select--auth .searchable-select__chevron {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

.searchable-select--auth.is-open .searchable-select__chevron {
    transform: rotate(180deg);
    color: #4a6fa5;
}

.searchable-select--auth.is-open ~ .input-icon {
    color: #4a6fa5;
}
