.custom-dropdown {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    min-width: 0;
    flex: 0 0 auto;
    --custom-dropdown-surface: #ffffff;
    --custom-dropdown-border: #c1cddb;
    --custom-dropdown-border-soft: #e1e8f0;
    --custom-dropdown-text: #37506e;
    --custom-dropdown-text-strong: #0f263b;
    --custom-dropdown-accent: #004488;
    --custom-dropdown-focus: #f5b301;
    --custom-dropdown-shadow: 0 4px 5px rgba(0, 0, 0, 0.08), 0 1px 0.5px rgba(0, 0, 0, 0.05);
}

.custom-dropdown.is-disabled {
    opacity: 0.64;
}

.custom-dropdown__trigger {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 45px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--custom-dropdown-text);
    cursor: pointer;
    text-align: left;
}

.custom-dropdown__trigger:hover,
.custom-dropdown__trigger:focus-visible {
    background: transparent;
    color: var(--custom-dropdown-text);
}

.custom-dropdown__trigger:disabled {
    cursor: default;
}

.custom-dropdown__trigger:focus-visible {
    outline: 2px solid var(--custom-dropdown-focus);
    outline-offset: 2px;
    border-radius: 8px;
}

.custom-dropdown__icon {
    width: 25px;
    height: 23px;
    flex: 0 0 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-dropdown__icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.custom-dropdown__value {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--custom-dropdown-text);
    font-family: "Nunito Sans", "Segoe UI", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.4;
    font-feature-settings: 'liga' off, 'clig' off;
}

.custom-dropdown__chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7087a1;
    transition: transform 0.18s ease;
}

.custom-dropdown__chevron-icon {
    display: block;
    width: 16px;
    height: 16px;
}

.custom-dropdown.is-open .custom-dropdown__chevron {
    transform: rotate(180deg);
}

.custom-dropdown__panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 50;
    min-width: 100%;
    width: max-content;
    max-width: min(360px, calc(100vw - 24px));
    padding: 0;
    max-height: min(360px, calc(100vh - 32px));
    border: 1px solid var(--custom-dropdown-border);
    border-radius: 12px;
    background: var(--custom-dropdown-surface);
    box-shadow: var(--custom-dropdown-shadow);
    overflow: hidden;
}

.custom-dropdown__options {
    display: flex;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
}

.custom-dropdown__search {
    padding: 12px;
    border-bottom: 1px solid var(--custom-dropdown-border-soft);
}

.custom-dropdown__search-input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--custom-dropdown-border);
    border-radius: 8px;
    color: var(--custom-dropdown-text-strong);
}

.custom-dropdown__search-input:focus-visible {
    outline: 2px solid var(--custom-dropdown-focus);
    outline-offset: 1px;
}

.custom-dropdown__search-hint {
    margin: 0;
    padding: 12px 18px;
    color: var(--custom-dropdown-text);
    font-size: 14px;
}

.custom-dropdown__option {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border: 0;
    border-bottom: 1px solid var(--custom-dropdown-border-soft);
    background: #ffffff;
    color: var(--custom-dropdown-text-strong);
    text-align: left;
    cursor: pointer;
}

.custom-dropdown__option:last-child {
    border-bottom: 0;
}

.custom-dropdown__option:hover,
.custom-dropdown__option:focus-visible {
    background: #f4f8fd;
    outline: 0;
}

.custom-dropdown__option:focus-visible {
    outline: 2px solid var(--custom-dropdown-focus);
    outline-offset: -2px;
}

.custom-dropdown__option.is-selected {
    background: #eaf2ff;
    color: var(--custom-dropdown-accent);
}

.custom-dropdown__option[disabled] {
    cursor: default;
    opacity: 0.55;
}

.custom-dropdown__option-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Nunito Sans", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;
}

.custom-dropdown--navigation {
    width: 230px;
    border: 1px solid var(--custom-dropdown-border);
    border-radius: 8px;
    background: var(--custom-dropdown-surface);
}

.custom-dropdown--navigation .custom-dropdown__trigger {
    width: 100%;
    height: auto;
    min-height: 43px;
    padding: 10px 12px;
    border-radius: 8px;
}

.custom-dropdown__chevron-icon--navigation {
    width: 12px;
    filter: brightness(0) saturate(100%) invert(58%) sepia(13%) saturate(687%) hue-rotate(173deg) brightness(89%) contrast(87%);
}

.custom-dropdown--navigation .custom-dropdown__panel {
    top: calc(100%);
    left: -1px;
    width: 230px;
    max-width: none;
    max-height: none;
    padding: 8px 12px;
    border: 1px solid var(--custom-dropdown-border);
    border-radius: 8px;
    box-shadow: none;
    transform: translateY(0);
}

.custom-dropdown--navigation .custom-dropdown__options {
    gap: 8px;
    max-height: none;
    overflow: visible;
    padding-left: 4px;
}

.custom-dropdown--navigation .custom-dropdown__option {
    min-height: 0;
    height: 35px;
    padding: 0 0 8px 0;
    border-bottom: 1px solid var(--custom-dropdown-border-soft);
    background: transparent;
    gap: 6px;
}

.custom-dropdown--navigation .custom-dropdown__option:last-child {
    height: 26px;
    border-bottom: 0;
    padding-bottom: 0;
}

.custom-dropdown--navigation .custom-dropdown__option:hover,
.custom-dropdown--navigation .custom-dropdown__option:focus-visible {
    background: transparent;
}

.custom-dropdown--navigation .custom-dropdown__option:focus-visible {
    outline: 2px solid var(--custom-dropdown-focus);
    outline-offset: -2px;
}

.custom-dropdown--navigation .custom-dropdown__option-label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    height: 26px;
    font-size: 14px;
    line-height: 26px;
    font-weight: 500;
}

.custom-dropdown--navigation .custom-dropdown__option.is-emphasis .custom-dropdown__option-label {
    font-weight: 700;
}

.custom-dropdown--navigation .custom-dropdown__option-external {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.custom-dropdown--navigation .custom-dropdown__option-external img {
    display: block;
    width: 10px;
    height: 10px;
    filter: brightness(0) saturate(100%) invert(65%) sepia(12%) saturate(629%) hue-rotate(174deg) brightness(87%) contrast(84%);
}

@media (max-width: 640px) {
    .custom-dropdown__panel {
        max-width: calc(100vw - 16px);
    }
}
