/* ===== x-select: قائمة منسدلة بهوية الموقع ===== */
.xs {
    --xs-brand: #d39834;
    --xs-brand-dark: #b07a1f;
    --xs-brand-soft: rgba(211, 152, 52, .12);
    --xs-text: #1e1e1e;
    --xs-muted: #6b6b6b;
    position: relative;
    width: 100%;
}

.xs-native {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.xs-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: .55rem .9rem;
    border: 1px solid #d8d6de;
    border-radius: 6px;
    background: #fff;
    color: var(--xs-text);
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.xs-trigger:hover {
    border-color: var(--xs-brand);
}

.xs-trigger:focus-visible,
.xs-trigger[aria-expanded="true"] {
    outline: none;
    border-color: var(--xs-brand);
    box-shadow: 0 0 0 3px var(--xs-brand-soft);
}

.xs-value {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.xs-caret {
    flex-shrink: 0;
    color: var(--xs-muted);
    transition: transform .2s;
}

.xs-trigger[aria-expanded="true"] .xs-caret {
    transform: rotate(180deg);
}

/* بدون إطار (داخل شريط البحث) */
.xs--plain .xs-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    box-shadow: none;
}

.xs--plain .xs-trigger:focus-visible .xs-value {
    text-decoration: underline;
    text-decoration-color: var(--xs-brand);
}

/* القائمة */
.xs-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    z-index: 40;
    min-width: 100%;
    width: max-content;
    max-width: 320px;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    animation: xs-in .12s ease-out;
}

.xs-menu[hidden] {
    display: none;
}

@keyframes xs-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.xs-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--xs-text);
    font-weight: 400;
    cursor: pointer;
    outline: none;
}

.xs-option:hover,
.xs-option:focus {
    background: var(--xs-brand-soft);
}

.xs-option[aria-selected="true"] {
    color: var(--xs-brand-dark);
    font-weight: 700;
}

.xs-check {
    flex-shrink: 0;
    color: var(--xs-brand);
    visibility: hidden;
}

.xs-option[aria-selected="true"] .xs-check {
    visibility: visible;
}

.xs.is-disabled .xs-trigger {
    background: #f5f5f5;
    color: var(--xs-muted);
    cursor: not-allowed;
}
