/* =========================================
   Custom Select Dropdown
   ========================================= */

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-family: var(--font-inter);
    font-size: 16px;
    line-height: 20px;
    color: var(--color-text);
    box-sizing: border-box;
    text-align: left;
    transition: border-color 0.15s ease;
}

.custom-select__btn:hover {
    border-color: var(--color-text-muted);
}

.custom-select__btn:focus {
    outline: none;
    border-color: var(--color-primary);
}

.custom-select.is-open .custom-select__btn {
    border-color: var(--color-primary);
}

.custom-select__chevron {
    flex-shrink: 0;
    margin-left: 8px;
    color: #5f5f5f;
    transition: transform 0.2s ease;
}

.custom-select.is-open .custom-select__chevron {
    transform: rotate(180deg);
}

/* Dropdown list */

.custom-select__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-white);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 600;
}

.custom-select.is-open .custom-select__dropdown {
    display: block;
}

.custom-select__option {
    padding: 13px 16px;
    font-family: var(--font-inter);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.custom-select__option:hover {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
}

.custom-select__option.is-selected {
    color: var(--color-primary);
}

/* Scrollable list */
.custom-select__list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 216px;
    overflow-y: auto;
}

/* Search input */
.custom-select__search {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-white);
    font-family: var(--font-inter);
    font-size: 16px;
    line-height: 1.4;
    color: var(--color-text);
    box-sizing: border-box;
    outline: none;
}

.custom-select__search::placeholder {
    color: var(--color-text-muted);
}

.custom-select__no-results {
    display: none;
    padding: 12px 16px;
    font-family: var(--font-inter);
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ---- Size variant: path-form (56px inputs) ---- */

.path-form .custom-select__btn,
.dsteps__form-box .custom-select__btn {
    height: 56px;
    font-size: 17px;
    line-height: 23px;
    color: var(--color-bg-dark);
    padding: 0 12px;
}

.path-form .custom-select__option,
.dsteps__form-box .custom-select__option {
    font-size: 17px;
    line-height: 23px;
    color: var(--color-bg-dark);
    padding: 13px 12px;
}

/* ---- Mobile font-size fix ---- */
@media (max-width: 640px) {
    .custom-select__btn {
        font-size: 14px;
    }
    .custom-select__option {
        font-size: 14px;
        padding: 11px 16px;
    }
    .path-form .custom-select__btn,
    .dsteps__form-box .custom-select__btn {
        height: 44px;
        font-size: 14px;
    }
    .path-form .custom-select__option,
    .dsteps__form-box .custom-select__option {
        font-size: 14px;
        padding: 11px 12px;
    }
}
