.rs-ov {
    position: fixed; inset: 0; background: #fff; z-index: 999999;
    display: none; flex-direction: column;
    font-family: inherit; color: #1e293b;
}
.rs-ov.rs-open { display: flex; }

.rs-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid #eef1f4; flex: 0 0 auto;
}
.rs-ico { color: var(--rs-primary, #B5703F); flex: 0 0 auto; }
.rs-input {
    flex: 1; border: 0; outline: none; font-size: 20px; color: #1e293b; background: transparent;
}
.rs-input::placeholder { color: #94a3b8; }
.rs-esc {
    border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 6px 12px;
    font-size: 13px; color: #64748b; cursor: pointer;
}
.rs-esc:hover { background: #f8fafc; }

.rs-content { flex: 1; display: flex; min-height: 0; max-width: 1280px; width: 100%; margin: 0 auto; }
.rs-facets { width: 240px; flex: 0 0 240px; border-right: 1px solid #eef1f4; padding: 18px; overflow-y: auto; }
.rs-facet { margin-bottom: 18px; }
.rs-facet-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: 8px; }
.rs-facet-opt { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; color: #334155; cursor: pointer; }
.rs-facet-opt input { accent-color: var(--rs-primary, #B5703F); }
.rs-range-label { font-size: 13px; color: #334155; margin-bottom: 6px; font-weight: 600; }
.rs-range-slider { width: 100%; accent-color: var(--rs-primary, #B5703F); margin: 2px 0; display: block; cursor: pointer; }

.rs-filtros-btn { display: none; align-items: center; gap: 6px; margin-bottom: 12px;
    border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 8px 14px;
    font-size: 14px; font-weight: 600; color: #334155; cursor: pointer; }
.rs-facets-backdrop { display: none; }

.rs-main { flex: 1; overflow-y: auto; padding: 18px 24px; min-width: 0; }
.rs-cats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.rs-cats-label { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.rs-cat-chip {
    font-family: inherit; cursor: pointer;
    font-size: 13px; padding: 5px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--rs-primary, #B5703F) 12%, #fff);
    color: var(--rs-primary, #B5703F);
    text-decoration: none; border: 1px solid color-mix(in srgb, var(--rs-primary, #B5703F) 25%, #fff);
}
.rs-cat-chip:hover { background: color-mix(in srgb, var(--rs-primary, #B5703F) 20%, #fff); }
.rs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rs-count { font-size: 14px; color: #64748b; }
.rs-sort { border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 10px; font-size: 13px; color: #334155; background: #fff; cursor: pointer; }
.rs-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.rs-view { display: inline-flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.rs-view-btn { display: inline-flex; align-items: center; padding: 6px 9px; background: #fff; border: 0; cursor: pointer; color: #94a3b8; }
.rs-view-btn + .rs-view-btn { border-left: 1px solid #e2e8f0; }
.rs-view-btn.active { background: var(--rs-primary, #B5703F); color: #fff; }
.rs-view-list .rs-grid { grid-template-columns: 1fr; gap: 10px; }
.rs-view-list .rs-card { flex-direction: row; align-items: center; }
.rs-view-list .rs-card-img { width: 96px; height: 96px; flex: 0 0 96px; aspect-ratio: auto; }
.rs-view-list .rs-card-body { flex: 1; }

.rs-grid { display: grid; grid-template-columns: repeat(var(--rs-cols, 4), minmax(0, 1fr)); gap: 18px; }
.rs-card { display: flex; flex-direction: column; text-decoration: none; color: inherit;
    border: 1px solid #eef1f4; border-radius: 12px; overflow: hidden; transition: box-shadow .15s, transform .15s; background: #fff; }
.rs-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,.09); transform: translateY(-2px); }
.rs-card-img { aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; background: #f8fafc; padding: 10px; }
.rs-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rs-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.rs-card-title { font-size: 14px; font-weight: 600; color: #1e293b; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rs-card-ref { font-size: 12px; color: #94a3b8; }
.rs-card-cat { font-size: 12px; color: #94a3b8; }
.rs-card-price { font-size: 16px; font-weight: 700; color: var(--rs-price, #16a34a); margin-top: 4px; }

.rs-empty { color: #64748b; font-size: 15px; padding: 40px; text-align: center; }

.rs-pager { display: flex; justify-content: center; gap: 6px; padding: 22px 0 8px; flex-wrap: wrap; }
.rs-page { min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid #e2e8f0; background: #fff;
    border-radius: 8px; color: #334155; font-size: 13px; cursor: pointer; }
.rs-page:hover:not(:disabled) { background: #f1f5f9; }
.rs-page-active { background: var(--rs-primary, #B5703F); color: #fff; border-color: var(--rs-primary, #B5703F); }
.rs-page:disabled { opacity: .4; cursor: default; }

@media (max-width: 768px) {
    .rs-input { font-size: 17px; }
    .rs-grid { grid-template-columns: repeat(var(--rs-cols-mobile, 2), minmax(0, 1fr)) !important; gap: 12px; }
    .rs-main { padding: 14px 16px; }
    .rs-has-facets .rs-filtros-btn { display: inline-flex; }
    /* Facetas como cajón lateral */
    .rs-facets {
        position: fixed; top: 0; left: 0; bottom: 0; width: 84%; max-width: 320px;
        background: #fff; border-right: 1px solid #eef1f4; z-index: 1000001;
        transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.2);
    }
    .rs-facets-open .rs-facets { transform: translateX(0); }
    .rs-facets-open .rs-facets-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1000000;
    }
}
