/* Unified native <select> — site + admin (RTL, custom chevron) */

:root,
html[data-theme="light"] {
    --vh-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
    --vh-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b4bbc9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

html[data-admin-theme="light"] {
    --vh-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23676767' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

html[data-admin-theme="dark"] {
    --vh-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b4b4b4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: light) {
    html[data-admin-theme="auto"] {
        --vh-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23676767' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    }
}

@media (prefers-color-scheme: dark) {
    html[data-admin-theme="auto"] {
        --vh-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b4b4b4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    }
}

select:not([multiple]):not([size]) {
    --select-bg: var(--bg-primary);
    --select-border: var(--border);
    --select-text: var(--text-primary);
    --select-focus: var(--accent);
    --select-focus-ring: color-mix(in srgb, var(--accent) 28%, transparent);

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    display: inline-block;
    min-height: 2.35rem;
    padding-block: 0.45rem;
    padding-inline-start: 0.75rem;
    padding-inline-end: 2.15rem;
    border: 1px solid var(--select-border);
    border-radius: 10px;
    background-color: var(--select-bg);
    background-image: var(--vh-select-chevron);
    background-repeat: no-repeat;
    background-position: left 0.7rem center;
    background-size: 0.85rem;
    color: var(--select-text);
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.35;
    cursor: pointer;
    max-width: 100%;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

select:not([multiple]):not([size])::-ms-expand {
    display: none;
}

select:not([multiple]):not([size]):hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--select-focus) 32%, var(--select-border));
}

select:not([multiple]):not([size]):focus {
    outline: none;
    border-color: var(--select-focus);
    box-shadow: 0 0 0 3px var(--select-focus-ring);
}

select:not([multiple]):not([size]):disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

select:not([multiple]):not([size]) option {
    background: var(--select-bg);
    color: var(--select-text);
}

/* Admin panel tokens */
.admin-body select:not([multiple]):not([size]) {
    --select-bg: var(--admin-input-bg);
    --select-border: var(--admin-border);
    --select-text: var(--admin-text);
    --select-focus: var(--admin-primary);
    --select-focus-ring: var(--admin-focus-ring);
}

/* Full-width form contexts */
.admin-form select:not([multiple]):not([size]),
.alm-field select:not([multiple]):not([size]),
.menu-admin__field select:not([multiple]):not([size]),
.fb-field select:not([multiple]):not([size]),
.vb-inspector-body select:not([multiple]):not([size]),
.cbe-inspector select:not([multiple]):not([size]),
.content-comments__inline-form-body select:not([multiple]):not([size]),
.content-comments__grid select:not([multiple]):not([size]) {
    width: 100%;
}

/* Compact toolbar / filter selects */
.vh-select--sm,
.vb-toolbar__select,
.admin-comments-filters select:not([multiple]):not([size]),
.admin-comments-bulk__bar select:not([multiple]):not([size]),
.media-library__filters select:not([multiple]):not([size]),
.vb-gallery-modal__filters select:not([multiple]):not([size]) {
    min-height: 2.1rem;
    padding-block: 0.35rem;
    font-size: 0.85rem;
}

.vb-rte-toolbar__select {
    min-height: 28px;
    padding-block: 0.2rem;
    font-size: 0.72rem;
}

.alm-field select:not([multiple]):not([size]) {
    min-height: 32px;
    font-size: 0.82rem;
}
