/**
 * Combobox buscable sobre <select> nativo (data-bm-searchable-select="1").
 * Sin JS el select nativo sigue visible (no se oculta hasta init).
 */
.bm-ss {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Solo selects transformados por el combobox (dentro de .bm-ss) */
.store-form--compact .field .bm-ss {
    max-width: 22rem;
}
/* Ocultar solo el <select> nativo ya envuelto por el combobox */
.bm-ss > select.bm-ss-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    max-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.store-form--compact .field .bm-ss {
    min-width: 0;
}
.store-form--compact .field .bm-ss__control {
    display: flex !important;
    width: 100%;
    max-width: 22rem;
}

.admin-form-compact .field .bm-ss {
    max-width: 22rem;
}
.admin-form-compact .field .bm-ss__control {
    display: flex !important;
    width: 100%;
}

.bm-ss__control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.375rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.bm-ss__control:hover:not(:disabled) {
    border-color: #94a3b8;
}

.bm-ss__control:focus-visible {
    outline: 2px solid #4caf1b;
    outline-offset: 1px;
}

.bm-ss--disabled .bm-ss__control,
.bm-ss__control:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.bm-ss__display {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-ss__display--placeholder {
    color: #64748b;
}

.bm-ss__caret {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    margin-top: -0.2rem;
    transition: transform 0.15s ease;
}

.bm-ss--open .bm-ss__caret {
    transform: rotate(-135deg);
    margin-top: 0.15rem;
}

.bm-ss__panel {
    position: absolute;
    z-index: 120;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
}

.bm-ss__filter {
    display: block;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 6px 6px 0 0;
    font: inherit;
    line-height: 1.35;
    box-sizing: border-box;
}

.bm-ss__filter:focus {
    outline: none;
}

.bm-ss__list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    max-height: calc(2.25rem * 15);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bm-ss__option {
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    line-height: 1.35;
    color: #0f172a;
}

.bm-ss__option:hover,
.bm-ss__option--active {
    background: #f0fdf4;
    color: #14532d;
}

.bm-ss__option--other {
    border-top: 1px solid #e2e8f0;
    margin-top: 0.15rem;
    padding-top: 0.55rem;
}

.bm-ss__empty {
    padding: 0.65rem;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.4;
}

.bm-ss__group-label {
    padding: 0.35rem 0.65rem 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: default;
    list-style: none;
}

.bm-ss__hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    line-height: 1.35;
    color: #9a3412;
}

.bm-ss--invalid .bm-ss__control {
    border-color: #dc2626;
}

@media (max-width: 640px) {
    .bm-ss__panel {
        max-height: min(70vh, 24rem);
    }
    .bm-ss__list {
        max-height: calc(min(70vh, 24rem) - 2.75rem);
    }
}

/* Filtros públicos /productos y /tiendas — paridad visual con .bm-stores-directory__select */
.bm-stores-directory__field .bm-ss__control {
    width: 100%;
    min-height: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.92rem;
    color: #111827;
    background: #fff;
}
.bm-stores-directory__field .bm-ss__control:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 1px;
    border-color: #16a34a;
}
.bm-stores-directory__field .bm-ss--disabled .bm-ss__control,
.bm-stores-directory__field .bm-ss__control:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f9fafb;
}
