.wilayah-cb { position: relative; }

.wilayah-cb__list {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: 100%;
    margin: 2px 0 0;
    padding: 4px;
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ced5e0;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

.wilayah-cb__list li {
    padding: 8px 11px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.3;
    color: #1f2733;
}

.wilayah-cb__list li:hover {
    background: #f0f3f8;
}

/* Chooser affordance — chevron mirroring the form's native <select> (.select-wrap),
   so the cascade fields read as dropdowns rather than plain text boxes. The list
   is position:absolute, so .wilayah-cb is only as tall as the input and top:50%
   lands on the input's centre. Vars fall back to hex for the CMS admin context. */
.wilayah-cb::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 1.5px solid rgba(91, 103, 117, .4);
    border-bottom: 1.5px solid rgba(91, 103, 117, .4);
    transform: rotate(45deg);
    pointer-events: none;
    transition: border-color .2s;
}
.wilayah-cb:hover::after { border-color: rgba(91, 103, 117, .6); }

/* Circular loading indicator while a level is fetching from the proxy.
   Replaces the chevron so the two never overlap. */
.wilayah-cb.is-loading::after { display: none; }
.wilayah-cb.is-loading::before {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid #d6dde4;
    border-top-color: var(--gold-700, #b07c08);
    border-radius: 50%;
    pointer-events: none;
    animation: wilayah-cb-spin .6s linear infinite;
}
@keyframes wilayah-cb-spin { to { transform: rotate(360deg); } }

/* Keyboard-highlighted option (ArrowUp/Down). */
.wilayah-cb__list li.is-active { background: #e3ebf5; }

/* Room for the chevron + pointer cursor to signal "chooser". First selector
   matches form.css's `.field input[type=text]` specificity and wins by load
   order (wilayah-picker.css is last); second covers the CMS admin (no .field). */
.field .wilayah-cb input,
.wilayah-cb input {
    padding-right: 40px;
    cursor: pointer;
}
