/*
 * Search results redesign.
 * Pixel-fiel al standalone del diseñador (Matscann Categoría).
 * Scoped bajo .sr-page. Los IDs de Algolia (#hits, #cat-list, etc.) se respetan.
 */

/* =========================================================
   TOKENS
   ========================================================= */
.sr-page {
    --sr-amber-50:   #fff9e8;
    --sr-amber-100:  #fdf1cb;
    --sr-amber-200:  #fce5a0;
    --sr-amber-400:  #f5be3f;
    --sr-amber-500:  #e8a91e;
    --sr-cream-50:   #fdfaf1;
    --sr-cream-100:  #fbf4de;
    --sr-cream-200:  #f8ebc2;
    --sr-ink-900:    #0e0e0e;
    --sr-ink-800:    #1a1a1a;
    --sr-ink-700:    #2a2a2a;
    --sr-ink-600:    #444444;
    --sr-ink-500:    #6b6b6b;
    --sr-ink-400:    #9a9a9a;
    --sr-ink-300:    #c7c7c7;
    --sr-ink-200:    #e5e5e5;
    --sr-ink-100:    #f2f2f2;
    --sr-ink-50:     #fafafa;
    --sr-white:      #ffffff;
    --sr-danger:     #d93d3d;
    --sr-success:    #1f9f5f;
    --sr-border-1:   #e5e5e5;
    --sr-border-2:   #c7c7c7;
    --sr-border-amber: #f5be3f;
    --sr-radius-xs:  4px;
    --sr-radius-sm:  8px;
    --sr-radius-md:  14px;
    --sr-radius-lg:  20px;
    --sr-radius-pill: 999px;
    --sr-shadow-sm:  0 2px 6px rgba(14,14,14,.06), 0 1px 2px rgba(14,14,14,.04);
    --sr-shadow-md:  0 10px 24px rgba(14,14,14,.08), 0 2px 6px rgba(14,14,14,.04);
    --sr-container:  1280px;
}

/* =========================================================
   BASE
   ========================================================= */
.sr-page {
    background: var(--sr-white);
    color: var(--sr-ink-900);
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.sr-page *, .sr-page *::before, .sr-page *::after { box-sizing: border-box; }
.sr-page a { text-decoration: none; color: inherit; }
.sr-page button { font-family: inherit; }

.sr-container {
    width: 100%;
    max-width: var(--sr-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */
.sr-breadcrumb { padding: 14px 0 0; }

.sr-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0; padding: 0;
    flex-wrap: wrap;
}

.sr-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--sr-ink-500);
}

.sr-breadcrumb li + li::before { content: "/"; color: var(--sr-ink-300); }
.sr-breadcrumb a { color: var(--sr-ink-500); transition: color .15s; }
.sr-breadcrumb a:hover { color: var(--sr-ink-900); }
.sr-breadcrumb li:last-child span { color: var(--sr-ink-800); font-weight: 500; }

/* =========================================================
   CATEGORY HERO — 2 columnas: texto izquierda, imagen derecha
   ========================================================= */
.sr-cat-hero {
    display: none;
    padding: 24px 0 8px;
}

.sr-cat-hero.is-visible { display: block; }

.sr-cat-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: center;
}

/* Columna texto */
.sr-cat-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sr-amber-500);
}

.sr-cat-h1 {
    margin: 10px 0 0;
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--sr-ink-900);
}

.sr-cat-seo {
    margin: 16px 0 0;
    max-width: 620px;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--sr-ink-600);
}

.sr-cat-stats {
    margin: 20px 0 0;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.sr-cat-stat { display: flex; flex-direction: column; }

.sr-cat-stat b {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sr-ink-900);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.sr-cat-stat span {
    font-size: 0.75rem;
    color: var(--sr-ink-500);
    font-weight: 500;
}

/* Columna imagen */
.sr-cat-hero-img { position: relative; }

.sr-cat-hero-img img {
    width: 100%;
    height: 220px;
    border-radius: var(--sr-radius-lg);
    border: 1px solid var(--sr-border-1);
    display: block;
    object-fit: cover;
}

.sr-cat-hero-badge {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: var(--sr-ink-900);
    color: var(--sr-white);
    font-size: 0.71875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 7px 12px;
    border-radius: var(--sr-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sr-cat-hero-badge i { color: var(--sr-amber-400); font-size: 0.8125rem; }

/* =========================================================
   SUBCATEGORÍAS — grid de cards exacto del diseñador
   ========================================================= */
.sr-subcats {
    display: none;
    padding: 28px 0 8px;
}

.sr-subcats.is-visible { display: block; }

.sr-subcats-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.sr-subcats-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--sr-ink-900);
}

.sr-subcats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.sr-subcat {
    background: var(--sr-white);
    border: 1px solid var(--sr-border-1);
    border-radius: var(--sr-radius-md);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    transition: box-shadow .18s ease, border-color .18s ease;
    text-align: left;
}

.sr-subcat:hover {
    box-shadow: var(--sr-shadow-md);
    border-color: var(--sr-amber-400);
}

.sr-subcat__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--sr-radius-sm);
    background: var(--sr-cream-100);
    color: var(--sr-ink-900);
    display: grid;
    place-items: center;
    font-size: 1rem;
    transition: background .18s ease;
    flex-shrink: 0;
}

.sr-subcat:hover .sr-subcat__icon { background: var(--sr-amber-400); }

.sr-subcat__name {
    font-size: 0.84375rem;
    font-weight: 600;
    color: var(--sr-ink-900);
    line-height: 1.25;
}

.sr-subcat__count {
    font-size: 0.71875rem;
    color: var(--sr-ink-500);
}

/* =========================================================
   CAT BODY — layout sidebar + contenido
   ========================================================= */
.sr-cat-body { padding: 28px 0 56px; }

.sr-cat-layout {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* Los items de un grid traen min-width:auto, asi que la columna de resultados
   no podia achicarse por debajo del ancho de su toolbar y empujaba el
   documento 23px a la derecha en telefonos. */
.sr-cat-layout > * {
    min-width: 0;
}

/* =========================================================
   SIDEBAR — filtros
   ========================================================= */
.sr-sidebar {
    position: sticky;
    top: calc(var(--ms-header-height, 166px) + 14px);
    /* El sidebar mide ~1700px: sin tope, lo que queda bajo el borde de la
       ventana (precio, tipo, marcas) no se veía hasta llegar al final de los
       resultados. Con tope, se desplaza por dentro. */
    max-height: calc(100vh - var(--ms-header-height, 166px) - 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
}

/* Grupos de filtro */
.sr-filter-group {
    border-bottom: 1px solid var(--sr-border-1);
    padding: 20px 0;
}

.sr-filter-group:first-child { padding-top: 0; }
.sr-filter-group:last-child  { border-bottom: none; }

.sr-filter-group h3 {
    margin: 0 0 14px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sr-ink-900);
}

/* Lista scrollable de Algolia */
.sr-filter-group .ais-RefinementList-list {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 4px 0 0;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: var(--sr-ink-200) transparent;
}

.sr-filter-group .ais-RefinementList-list::-webkit-scrollbar       { width: 4px; }
.sr-filter-group .ais-RefinementList-list::-webkit-scrollbar-track  { background: transparent; }
.sr-filter-group .ais-RefinementList-list::-webkit-scrollbar-thumb  { background: var(--sr-ink-200); border-radius: 4px; }

/* Anular estilos del viejo search_result.css en los items */
.sr-page #sidebar-container .filter-item {
    list-style: none;
    padding: 0;
    background-color: transparent;
}

.sr-page #sidebar-container .filter-item + .filter-item { margin-top: 11px; }

.sr-page #sidebar-container .filter-item:hover {
    background-color: transparent;
}

/* El viejo CSS usa !important en background y padding-left de .filter-item-selected */
.sr-page #sidebar-container .filter-item-selected {
    background-color: transparent !important;
    background: none !important;
    border: none;
    border-left: none;
    box-shadow: none;
    padding: 0 !important;
    margin: 0;
}

.sr-page #sidebar-container .filter-item label,
.sr-page #cat-list label,
.sr-page #subcategory label,
.sr-page #sub_subcategory label,
.sr-page #brand-list label,
.sr-page .ais-RefinementList-label {
    display: grid !important;
    grid-template-columns: 18px 1fr auto;
    gap: 0 10px;
    font-size: 0.84375rem;
    color: var(--sr-ink-900);
    cursor: pointer;
    user-select: none;
    padding: 0;
    background: none;
    margin: 0;
    width: 100%;
}

/* appearance:none es necesario para resetear el checkbox nativo del browser */
.sr-page #sidebar-container .filter-item input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--sr-border-2);
    background: var(--sr-white);
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.sr-page #sidebar-container .filter-item input[type="checkbox"]:checked {
    background-color: var(--sr-amber-400);
    border-color: var(--sr-amber-400);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%230e0e0e' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.sr-page #sidebar-container .filter-item:hover input[type="checkbox"]:not(:checked) {
    border-color: var(--sr-ink-400);
}

.sr-page #sidebar-container .filter-item-selected label {
    font-weight: 600;
}

/* El viejo CSS oculta el count con display:none !important — debemos sobreescribirlo */
.sr-page #sidebar-container .filter-count,
.sr-page .ais-RefinementList-count {
    display: block !important;
    justify-self: end;
    font-size: 0.75rem !important;
    color: var(--sr-ink-400) !important;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    background: none;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    visibility: visible;
    opacity: 1;
    white-space: nowrap;
}

.sr-page .ais-RefinementList-labelText {
    margin-right: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   PRICE RANGE — widget rangeInput de Algolia
   ========================================================= */
.sr-page .sr-price-range__form {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: center;
}

.sr-page .sr-price-range__input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--sr-border-2);
    border-radius: var(--sr-radius-sm);
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--sr-ink-900);
    background: var(--sr-white);
    outline: none;
    transition: border-color .15s;
    min-width: 0;
}

.sr-page .sr-price-range__input::placeholder {
    color: var(--sr-ink-400);
}

.sr-page .sr-price-range__input:focus {
    border-color: var(--sr-amber-400);
}

.sr-page .sr-price-range__sep {
    color: var(--sr-ink-400);
    font-size: 0.875rem;
    text-align: center;
    flex-shrink: 0;
}

.sr-page .sr-price-range__submit {
    grid-column: 1 / -1;
    margin-top: 8px;
    width: 100%;
    padding: 10px;
    background: var(--sr-ink-900);
    color: var(--sr-white);
    border: none;
    border-radius: var(--sr-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}

.sr-page .sr-price-range__submit:hover {
    background: var(--sr-ink-700);
}

/* Promo banner en sidebar */
.sr-page .promo-banner {
    margin-top: 20px;
    border-radius: var(--sr-radius-sm);
    overflow: hidden;
}

/* =========================================================
   TOOLBAR — conteo a la izquierda, sort a la derecha
   ========================================================= */
.sr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: none;
}

.sr-count {
    font-size: 0.84375rem;
    color: var(--sr-ink-600);
}

.sr-count b {
    color: var(--sr-ink-900);
    font-weight: 700;
}

.sr-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sr-sort label {
    font-size: 0.8125rem;
    color: var(--sr-ink-500);
    font-weight: 500;
    white-space: nowrap;
}

/* Wrapper del select con chevron via ::after */
.sr-sort-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.sr-sort-wrap::after {
    content: "\f078"; /* fa-chevron-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.6875rem;
    color: var(--sr-ink-500);
    position: absolute;
    right: 14px;
    pointer-events: none;
}

/* Algolia renderiza .sort-select dentro de #sort-by */
.sr-page .ais-SortBy-select,
.sr-page .sort-select,
.sr-page #sort-by select {
    appearance: none;
    -webkit-appearance: none;
    font-family: "Poppins", sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sr-ink-900);
    background: var(--sr-white);
    border: 1.5px solid var(--sr-border-2);
    border-radius: var(--sr-radius-pill);
    padding: 9px 38px 9px 16px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}

.sr-page .ais-SortBy-select:focus,
.sr-page #sort-by select:focus {
    border-color: var(--sr-amber-400);
}

/* =========================================================
   CHIPS — filtros activos
   ========================================================= */
.sr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 18px;
    min-height: 0;
}

.sr-chips:empty { display: none; margin: 0; }

.sr-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--sr-cream-100);
    color: var(--sr-ink-900);
    border: 1px solid var(--sr-border-amber);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 8px 6px 12px;
    border-radius: var(--sr-radius-pill);
}

.sr-chip button {
    border: none;
    background: none;
    display: grid;
    place-items: center;
    color: var(--sr-ink-600);
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transition: background .15s, color .15s;
}

.sr-chip button:hover {
    background: rgba(14,14,14,.08);
    color: var(--sr-ink-900);
}

.sr-chip-clear {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sr-ink-900);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* =========================================================
   PRODUCT GRID — exacto del diseñador
   Algolia renderiza: #hits > .ais-Hits > ol.ais-Hits-list.products-list
   El grid va en .products-list, no en #hits directamente.
   ========================================================= */
.sr-page .products-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* product-card class se mantiene (JS depende de ella) */
.sr-page .product-card,
.sr-page .sr-prod-card {
    position: relative;
    background: var(--sr-white);
    border: 1px solid var(--sr-border-1);
    border-radius: var(--sr-radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: box-shadow .18s ease;
}

.sr-page .product-card:hover { box-shadow: var(--sr-shadow-md); }

/* Imagen */
.sr-page .product-image-container {
    width: 100%;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--sr-ink-50);
    border-radius: var(--sr-radius-sm);
}

.sr-page .product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .25s;
}

.sr-page .product-card:hover .product-image { transform: scale(1.04); }

/* Badge "Más cotizado" */
.sr-page .prod-flag {
    position: absolute;
    top: 22px; left: 22px; z-index: 2;
    background: var(--sr-ink-900);
    color: var(--sr-amber-400);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--sr-radius-xs);
}

/* Badge de cambio de precio — bajo el botón de favorito para no solaparse */
.sr-page .price-change-indicator {
    position: absolute;
    top: 52px; right: 10px;
    bottom: auto; left: auto;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--sr-radius-pill);
    font-size: 0.6875rem;
    font-weight: 700;
    box-shadow: none;
    backdrop-filter: none;
    animation: none;
    min-width: 0;
    height: auto;
    width: auto;
}

.sr-page .price-change-indicator.discount { background: var(--sr-danger); color: #fff; }
.sr-page .price-change-indicator.increase { background: var(--sr-ink-200); color: var(--sr-ink-700); }

/* No disponible overlay */
.sr-page .unavailable-overlay {
    position: absolute; inset: 0; z-index: 3;
    display: flex; align-items: flex-start; padding: 10px;
    pointer-events: none;
}

.sr-page .unavailable-badge {
    display: flex; align-items: center; gap: 5px;
    background: rgba(14,14,14,.7); color: #fff;
    font-size: 0.6875rem; font-weight: 600;
    padding: 4px 9px; border-radius: var(--sr-radius-pill);
}

/* Info */
.sr-page .product-link { color: inherit; display: flex; flex-direction: column; flex: 1; }

.sr-page .product-info {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.sr-page .product-brand {
    margin-top: 14px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sr-ink-500);
    margin-bottom: 0;
}

.sr-page .product-name {
    margin-top: 4px;
    font-size: 0.90625rem;
    font-weight: 600;
    color: var(--sr-ink-900);
    line-height: 1.35;
    min-height: 39px;
    display: block;
}

.sr-page .product-name:hover { color: var(--sr-amber-500); }

.sr-page .price-section { margin-top: 10px; }

.sr-page .product-price {
    font-size: 1.3125rem;
    font-weight: 700;
    color: var(--sr-ink-900);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.sr-page .price-label { display: none; } /* "Desde:" se oculta, va solo el precio */

.sr-page .price-iva {
    font-size: 11px;
    font-weight: 400;
    color: var(--sr-ink-400);
    margin-left: 5px;
    letter-spacing: .02em;
    vertical-align: middle;
}

.sr-page .product-unavailable-container .unavailable-label,
.sr-page .product-quote-container .quote-label {
    font-size: 0.75rem;
    color: var(--sr-ink-400);
    display: flex; align-items: center; gap: 5px;
    margin-top: 10px;
}

/* Botones de acción */
.sr-page .action-btn {
    width: 32px; height: 32px;
    border-radius: var(--sr-radius-sm);
    border: 1.5px solid var(--sr-ink-200);
    background: var(--sr-white);
    color: var(--sr-ink-600);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    flex-shrink: 0;
}

.sr-page .action-btn:hover { border-color: var(--sr-ink-400); color: var(--sr-ink-900); }
.sr-page .action-btn.active { background: var(--sr-ink-900); border-color: var(--sr-ink-900); color: #fff; }
.sr-page .quick-view-btn:hover { border-color: var(--sr-amber-400); color: var(--sr-amber-500); }
.sr-page .favorite-btn.active { background: var(--sr-danger) !important; border-color: var(--sr-danger) !important; color: #fff !important; }

/* Botones flotantes sobre la imagen de la tarjeta */
.sr-page .sr-card-btn--tl,
.sr-page .sr-card-btn--tr {
    position: absolute;
    top: 10px;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.sr-page .sr-card-btn--tl { left: 10px; }
.sr-page .sr-card-btn--tr { right: 10px; }

/* Botón "Agregar a cotización" — exacto del diseñador */
.sr-page .sr-prod-add {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 0;
    border-radius: var(--sr-radius-pill);
    border: none;
    background: var(--sr-cream-100);
    color: var(--sr-ink-900);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    cursor: pointer;
    transition: background .18s;
}

.sr-page .sr-prod-add:hover { background: var(--sr-amber-400); }

/* =========================================================
   PAGINACIÓN
   ========================================================= */
.sr-page .pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    padding: 0;
    list-style: none;
}

.sr-page .pagination-item { list-style: none; }

.sr-page .pagination-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 8px;
    border-radius: var(--sr-radius-sm);
    border: 1px solid var(--sr-border-1);
    background: var(--sr-white);
    color: var(--sr-ink-900);
    font-size: 0.84375rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: border-color .15s, background .15s;
}

.sr-page .pagination-link:hover { border-color: var(--sr-amber-400); text-decoration: none; }
.sr-page .pagination-selected .pagination-link { background: var(--sr-ink-900); border-color: var(--sr-ink-900); color: #fff; }
.sr-page .ais-Pagination-item--disabled .pagination-link { opacity: .35; pointer-events: none; }
.sr-page .ais-Pagination-item--previousPage .pagination-link,
.sr-page .ais-Pagination-item--nextPage .pagination-link { font-size: 0.75rem; }

/* =========================================================
   NO RESULTS
   ========================================================= */
.sr-page #no-results-message {
    text-align: center;
    padding: 64px 24px;
    color: var(--sr-ink-500);
}

.sr-page #no-results-message h2 {
    font-size: 1.125rem; font-weight: 600;
    color: var(--sr-ink-800); margin-bottom: 8px;
}

/* =========================================================
   MOBILE CONTROLS
   ========================================================= */
.sr-page .mobile-controls { display: none; margin-bottom: 12px; }

.sr-page .mobile-filter-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    border-radius: var(--sr-radius-sm);
    border: 1.5px solid var(--sr-border-1);
    background: var(--sr-white);
    font-size: 0.875rem; font-weight: 500; color: var(--sr-ink-800);
    cursor: pointer;
}

.sr-page .filter-badge {
    background: var(--sr-ink-900); color: #fff;
    border-radius: var(--sr-radius-pill);
    padding: 1px 7px; font-size: 0.6875rem; font-weight: 600;
    display: none;
}

.sr-page .filter-badge.has-filters { display: inline; }

/* =========================================================
   TAMBIÉN TE PUEDE SERVIR — Categorías relacionadas
   ========================================================= */
.sr-related-section {
    background: var(--sr-cream-50);
    border-top: 1px solid var(--sr-cream-200);
    padding: 56px 0;
}

.sr-related-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 36px;
}

.sr-related-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--sr-amber-500);
}

.sr-related-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--sr-ink-900);
}

.sr-related-see-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sr-ink-900);
    transition: color .18s ease;
    white-space: nowrap;
}

.sr-related-see-all:hover { color: var(--sr-amber-500); }
.sr-related-see-all i { font-size: 0.75rem; }

.sr-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.sr-related-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--sr-radius-md);
    border: 1px solid var(--sr-border-1);
    background: var(--sr-white);
    aspect-ratio: 16 / 10;
    display: block;
    transition: box-shadow .18s ease, text-decoration none;
    text-decoration: none;
}

.sr-related-card:hover { box-shadow: var(--sr-shadow-md); }

.sr-related-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sr-related-card .sr-rc-label {
    position: absolute;
    inset: auto 0 0 0;
    background: linear-gradient(180deg, transparent, rgba(14,14,14,.82));
    color: var(--sr-white);
    padding: 26px 16px 14px;
    font-size: 0.9375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sr-related-card .sr-rc-label i {
    width: 16px;
    height: 16px;
    font-size: 0.875rem;
    color: var(--sr-amber-400);
    flex-shrink: 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
    .sr-subcats-grid { grid-template-columns: repeat(3, 1fr); }
    .sr-related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
    .sr-cat-hero-grid { grid-template-columns: 1fr; gap: 22px; }
    .sr-cat-hero-img { order: -1; }
    .sr-cat-hero-img img { height: 170px; }
    .sr-cat-h1 { font-size: 1.75rem; }
}

@media (max-width: 900px) {
    .sr-cat-layout { grid-template-columns: 1fr; }
    .sr-sidebar { position: static; max-height: none; overflow: visible; padding-right: 0; }
    .sr-page .mobile-controls { display: block; }

    /* El sidebar completo se apilaba encima de los resultados: habia que pasar
       precio, tipo de producto y marcas antes de ver el primer producto. En
       movil vive solo dentro del modal que abre el boton "Filtros". */
    .sr-cat-layout > .sr-sidebar {
        display: none;
    }

    #modal-filters-content .sr-sidebar {
        display: block;
        position: static;
        width: 100%;
    }
    .sr-subcats-grid { grid-template-columns: repeat(2, 1fr); }
    .sr-page .products-list { grid-template-columns: repeat(2, 1fr); }
    .sr-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    /* En una fila sola el contador y el selector de orden no entran: que bajen. */
    .sr-toolbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .sr-page .products-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sr-related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   MODAL DE FILTROS EN MOVIL
   ========================================================= */

/* search_result.css define .custom-apply-btn dos veces y la ultima lo deja
   azul (#2962ff), fuera de la paleta del rediseño. */
.custom-modal-filters .custom-apply-btn {
    background: var(--sr-amber-400);
    border-radius: 999px;
    color: var(--sr-ink-900);
    font-weight: 700;
}

.custom-modal-filters .custom-apply-btn:hover {
    background: var(--sr-amber-500);
}

/* El boton flotante de WhatsApp queda encima del "Aplicar" del modal. */
body.sr-filters-open .whatsapp-float {
    display: none;
}
