/* ── Custom select ──────────────────────────────────────────
   The site's dropdown (select.js): a button like the location
   box, and a list like the location picker's. The <select> stays
   underneath as the real field.
   ─────────────────────────────────────────────────────────── */

.custom-select {
    position: relative;
}

.custom-select__native {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.custom-select svg {
    pointer-events: none;
}

.custom-select__button {
    width: 100%;
    min-width: 0;
    height: 45px;
    padding: 10px 36px 10px 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-white);
    box-shadow: 0 0 12px rgb(0 0 0 / 0.12);
    color: var(--color-text);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

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

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

.custom-select__button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* The chevron turns over while the list is open */
.custom-select:has(.custom-select__button[aria-expanded="true"]) svg {
    rotate: 180deg;
}

.custom-select__list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 30;
    min-width: 100%;
    max-height: 264px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
    box-shadow: 0 6px 12px rgb(0 0 0 / 0.12);
    list-style: none;
    outline: none;
}

.custom-select__list[hidden] {
    display: none;
}

.custom-select__option {
    padding: 10px 12px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
}

.custom-select__option:hover,
.custom-select__option.is-active {
    background: var(--color-grey-light);
}

.custom-select__option[aria-selected="true"] {
    color: var(--color-primary);
    font-weight: 600;
}

.custom-select__option[aria-disabled="true"] {
    color: rgb(5 5 2 / 0.35);
    background: none;
    cursor: default;
}
