:root {
  /* Derivados de la paleta global del tema (Regla nº 2): el módulo no fija
     colores de marca. El BO puede pisarlos con un color concreto; vacío =
     siguen al tema. */
  --nxrs-primary: var(--nxr-accent, var(--primary_color, #1f2937));
  --nxrs-accent: var(--nxr-accent-dark, var(--color_hover, var(--nxrs-primary)));
  --nxrs-bg: #ffffff;
  --nxrs-text: #333333;
  --nxrs-text-muted: #888888;
  --nxrs-border: #e0e0e0;
  --nxrs-shadow: rgba(0, 0, 0, 0.1);
  --nxrs-radius: 8px;
  --nxrs-radius-sm: 4px;
  --nxrs-transition: 0.2s ease;
  --nxrs-overlay-backdrop: rgba(0, 0, 0, 0.6);
  --nxrs-overlay-z: 99999;
  --nxrs-filters-width: 280px;
  --nxrs-gap: 16px;
  --nxrs-gap-sm: 8px;
  --nxrs-gap-lg: 24px;
  --nxrs-skeleton-base: #f0f0f0;
  --nxrs-skeleton-highlight: #e0e0e0;
  /* Retícula del panel a pantalla completa. */
  --nxrs-pad-x: 48px;
  --nxrs-pad-y: 32px;
  --nxrs-gap-x: 24px;
  --nxrs-searchbox-height: 48px;
  --nxrs-card-min: 220px;
  /* Ancho máximo del contenido: vacío en el BO = a todo lo ancho. */
  --nxrs-content-maxw: none;
}
body.nxr_search-open {
  overflow: hidden;
}
/*
 * El panel vive fuera del layout del tema y no puede dar por hecho su reset:
 * sin border-box, el padding lateral del cuerpo se suma al 100% de ancho y en
 * móvil el contenido se sale por la derecha.
 */
.nxrs-overlay,
.nxrs-overlay *,
.nxrs-overlay *::before,
.nxrs-overlay *::after {
  box-sizing: border-box;
}
/*
 * Chrome móvil agranda por su cuenta el texto de los bloques anchos ("font
 * boosting") y descuadraba la cabecera y la barra de resultados.
 */
.nxrs-overlay {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: var(--font_primary, inherit);
}
/*
 * Los controles de formulario no heredan la fuente: las opciones de los
 * filtros (label), sus contadores y los botones «Ver más» salían en Arial.
 */
.nxrs-overlay button,
.nxrs-overlay input,
.nxrs-overlay select,
.nxrs-overlay textarea,
.nxrs-overlay label {
  font-family: inherit;
}
.nxrs-overlay__backdrop {
  position: fixed;
  inset: 0;
  background: var(--nxrs-overlay-backdrop);
  z-index: calc(var(--nxrs-overlay-z) - 1);
  opacity: 0;
  transition: opacity var(--nxrs-transition);
  pointer-events: none;
}
.nxrs-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--nxrs-overlay-z);
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--nxrs-transition);
}
.nxrs-overlay.nxrs-overlay--open,
.nxrs-overlay.nxrs-overlay--open .nxrs-overlay__backdrop {
  opacity: 1;
  pointer-events: auto;
}
/*
 * El panel arranca pegado al borde superior y ocupa todo el ancho. Sin query
 * su altura es la del contenido (se ve la tienda detrás); en cuanto hay
 * resultados el JS añade --filled y pasa a ocupar la pantalla entera.
 */
.nxrs-overlay__container {
  position: relative;
  z-index: var(--nxrs-overlay-z);
  background: var(--nxrs-bg);
  color: var(--nxrs-text);
  width: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.nxrs-overlay--filled .nxrs-overlay__container {
  height: 100vh;
  height: 100dvh;
}
.nxrs-overlay__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--nxrs-pad-y) var(--nxrs-pad-x) 0;
  flex-shrink: 0;
}
.nxrs-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--nxrs-searchbox-height);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--nxrs-border);
  border-radius: 0;
  padding: 0;
  transition: border-color var(--nxrs-transition);
}
.nxrs-search-box:focus-within {
  border-bottom-color: var(--nxrs-accent);
}
.nxrs-search-icon {
  color: var(--nxrs-text);
  flex-shrink: 0;
}
.nxrs-search-box__input {
  text-align: left;
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  color: var(--nxrs-text);
  padding: 0;
  height: 100%;
  min-width: 0;
}
.nxrs-search-box__input::placeholder {
  color: var(--nxrs-text-muted);
}
.nxrs-overlay__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--nxrs-accent);
  cursor: pointer;
  border-radius: var(--nxrs-radius);
  color: #fff;
  transition:
    opacity var(--nxrs-transition),
    background var(--nxrs-transition);
  flex-shrink: 0;
  align-self: center;
}
.nxrs-overlay__close:hover {
  opacity: 0.85;
}
.nxrs-overlay__close:focus-visible {
  outline: 2px solid var(--nxrs-accent);
  outline-offset: 2px;
}
/*
 * Un único scroll para filtros y resultados, como en la referencia: dos barras
 * independientes en un panel a pantalla completa se pisan y confunden.
 */
.nxrs-overlay__body {
  display: flex;
  gap: var(--nxrs-gap-x);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--nxrs-pad-y) var(--nxrs-pad-x) var(--nxrs-pad-y);
  width: 100%;
  max-width: var(--nxrs-content-maxw, none);
  margin: 0 auto;
  scrollbar-width: thin;
  scrollbar-color: var(--nxrs-border) transparent;
}
.nxrs-overlay__body::-webkit-scrollbar {
  width: 8px;
}
.nxrs-overlay__body::-webkit-scrollbar-track {
  background: transparent;
}
.nxrs-overlay__body::-webkit-scrollbar-thumb {
  background: var(--nxrs-border);
  border-radius: 4px;
}
.nxrs-overlay__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--nxrs-gap);
  min-width: 0;
  align-self: flex-start;
}
.nxrs-status {
  font-size: 0.8rem;
  color: var(--nxrs-text-muted);
  min-height: 1.2em;
}
/* El banner superior cuelga del contenedor, no del cuerpo: pone su propio aire. */
.nxrs-banner--top {
  padding: var(--nxrs-gap) var(--nxrs-pad-x) 0;
  width: 100%;
  max-width: var(--nxrs-content-maxw, none);
  margin: 0 auto;
}
.nxrs-banner--top .nxrs-banner__image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}
.nxrs-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--nxrs-gap-sm);
  padding: var(--nxrs-gap-lg);
  color: var(--nxrs-text-muted);
  text-align: center;
}
.nxrs-error p {
  margin: 0;
  font-size: 0.9rem;
}
.nxrs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--nxrs-gap-sm);
  padding: calc(var(--nxrs-gap-lg) * 2);
  text-align: center;
  color: var(--nxrs-text-muted);
}
.nxrs-empty svg {
  opacity: 0.4;
}
.nxrs-empty__text {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--nxrs-text);
}
.nxrs-empty__suggestion {
  margin: 0;
  font-size: 0.875rem;
}
.nxrs-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 0;
}
.nxrs-status:empty {
  display: none;
}
.nxrs-status__count {
  font-size: 0.875rem;
  color: var(--nxrs-text);
  font-weight: 400;
}
.nxrs-status__count strong {
  font-weight: 700;
}
.nxrs-sort-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nxrs-sort-label {
  font-size: 0.875rem;
  color: var(--nxrs-text);
}
.nxrs-sort {
  appearance: none;
  -webkit-appearance: none;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 0 center;
  border: none;
  border-radius: 0;
  padding: 4px 20px 4px 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nxrs-text);
  cursor: pointer;
  transition: color var(--nxrs-transition);
}
.nxrs-sort:hover {
  color: var(--nxrs-accent);
}
.nxrs-sort:focus-visible {
  outline: 2px solid var(--nxrs-accent);
  outline-offset: 2px;
}
.nxrs-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--nxrs-card-min), 1fr));
  min-width: 0;
  gap: var(--nxrs-gap);
  align-content: start;
}
.nxrs-product {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--nxrs-border);
  border-radius: 12px;
  padding: var(--nxrs-gap-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--nxrs-text);
  background: var(--nxrs-bg);
  transition:
    box-shadow var(--nxrs-transition),
    border-color var(--nxrs-transition);
  cursor: pointer;
  outline: none;
}
.nxrs-product:hover,
.nxrs-product:focus-visible {
  border-color: var(--nxrs-accent);
  box-shadow: 0 0 0 1px var(--nxrs-accent);
}
.nxrs-product--active {
  border-color: var(--nxrs-accent);
  outline: 2px solid var(--nxrs-accent);
  outline-offset: -2px;
}
.nxrs-product__image {
  position: relative;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}
.nxrs-product__image img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain;
  display: block;
}
.nxrs-product__image:hover img {
  transform: none;
}
.nxrs-product__no-image {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #f0f0f0,
    #f0f0f0 5px,
    #e8e8e8 5px 10px
  );
}
/*
 * flex-basis auto (no 0): con basis 0 el reparto del flex manda sobre el
 * contenido y, en las tarjetas de dos líneas de título, el precio se salía por
 * debajo y quedaba tapado por el botón de carrito.
 */
.nxrs-product__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--nxrs-gap) 0 0;
  flex: 1 0 auto;
}
.nxrs-product__name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--nxrs-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nxrs-product__ref,
.nxrs-product__manufacturer {
  font-size: 0.75rem;
  color: var(--nxrs-text-muted);
  font-style: normal;
  letter-spacing: 0.02em;
}
/*
 * El precio cierra la tarjeta. Se coloca con `order` en lugar de reordenar el
 * DOM porque lo pintan dos constructores distintos (resultados y populares).
 */
.nxrs-product__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: auto;
  padding-top: var(--nxrs-gap);
  order: 10;
}
.nxrs-product__regular-price {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--nxrs-text-muted);
  text-decoration: line-through;
}
.nxrs-product__price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nxrs-accent);
}
.nxrs-product__stock {
  font-family: var(--font_primary, inherit);
  color: var(--color_font, var(--nxrs-text));
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  display: block;
}
.nxrs-product__stock strong {
  font-weight: 700;
}
.nxrs-product--skeleton {
  pointer-events: none;
  cursor: default;
}
.nxrs-product--skeleton:hover,
.nxrs-product--skeleton:focus-visible {
  box-shadow: none;
  border-color: var(--nxrs-border);
  transform: none;
}
.nxrs-skeleton {
  background: linear-gradient(
    90deg,
    var(--nxrs-skeleton-base) 25%,
    var(--nxrs-skeleton-highlight) 50%,
    var(--nxrs-skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: nxrs-shimmer 1.4s infinite ease-in-out;
  border-radius: var(--nxrs-radius-sm);
}
.nxrs-skeleton.nxrs-product__image {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 0;
}
.nxrs-skeleton--title {
  height: 14px;
  width: 90%;
  margin-top: 4px;
}
.nxrs-skeleton--text {
  height: 11px;
  width: 75%;
}
.nxrs-skeleton--short {
  width: 50%;
}
.nxrs-popular {
  display: flex;
  flex-direction: column;
  gap: var(--nxrs-gap-lg);
}
.nxrs-popular__section {
  display: flex;
  flex-direction: column;
  gap: var(--nxrs-gap-sm);
}
.nxrs-popular h5 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nxrs-text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nxrs-popular h5 svg {
  opacity: 0.6;
}
.nxrs-popular__featured h5 {
  color: var(--nxrs-accent);
}
.nxrs-popular__featured h5 svg {
  opacity: 0.8;
}
.nxrs-popular__grid {
  margin-top: var(--nxrs-gap-sm);
}
/* Recomendados que no completan fila (ver fitFeaturedRows() en el JS). */
.nxrs-product.nxrs-product--overflow {
  display: none;
}
.nxrs-popular__terms {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.nxrs-popular__terms > h5 {
  margin: 0;
}
.nxrs-popular__terms > .nxrs-popular__tags {
  display: contents;
}
.nxrs-popular__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nxrs-gap-sm);
}
.nxrs-load-more {
  display: flex;
  justify-content: center;
  padding: var(--nxrs-gap) 0;
}
.nxrs-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--nxrs-border);
  border-top-color: var(--nxrs-accent);
  border-radius: 50%;
  animation: nxrs-spin 0.6s linear infinite;
}
@keyframes nxrs-spin {
  to {
    transform: rotate(360deg);
  }
}
.nxrs-filters {
  width: var(--nxrs-filters-width);
  flex-shrink: 0;
  border-right: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: flex-start;
}
.nxrs-filters:empty {
  display: none;
}
.nxrs-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nxrs-filter-group__title {
  margin: 0;
  font-size: 1.1875rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--nxrs-text);
  font-weight: 700;
  padding-bottom: 0;
  border-bottom: none;
}
.nxrs-filter-group__items {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/*
 * Casilla dibujada con ::before: el ítem es un <button>, no un <input>, así que
 * el estado marcado lo lleva la clase .active y no hay :checked que consultar.
 */
.nxrs-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 0;
  background: none;
  border: none;
  border-radius: var(--nxrs-radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--nxrs-text);
  text-align: left;
  transition: color var(--nxrs-transition);
}
.nxrs-filter-item::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border: 1px solid var(--nxrs-border);
  border-radius: 3px;
  background: transparent no-repeat center;
  transition:
    background-color var(--nxrs-transition),
    border-color var(--nxrs-transition);
}
.nxrs-filter-item.active::before {
  border-color: var(--nxrs-accent);
  background-color: var(--nxrs-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
}
.nxrs-filter-item > span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nxrs-filter-item:hover {
  background: none;
  color: var(--nxrs-accent);
}
.nxrs-filter-item:focus-visible {
  outline: 2px solid var(--nxrs-accent);
  outline-offset: 2px;
}
.nxrs-filter-item.active {
  background: none;
  color: var(--nxrs-text);
  font-weight: 400;
}
/* «Ver más (N)» de cada grupo: los valores que pasan del tope nacen ocultos. */
.nxrs-filter-more {
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--nxrs-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nxrs-filter-more:hover {
  opacity: 0.75;
}
.nxrs-filter-more:focus-visible {
  outline: 2px solid var(--nxrs-accent);
  outline-offset: 2px;
}

.nxrs-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: auto;
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--nxrs-text-muted);
  flex-shrink: 0;
  margin-left: var(--nxrs-gap-sm);
  transition: color var(--nxrs-transition);
}
.nxrs-filter-item.active .nxrs-filter-count {
  background: none;
  color: var(--nxrs-text-muted);
}
.nxrs-price-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nxrs-gap-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--nxrs-text);
}
.nxrs-price-sep {
  color: var(--nxrs-text-muted);
}
.nxrs-price-slider {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
}
.nxrs-price-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--nxrs-border);
  border-radius: 2px;
}
.nxrs-price-range {
  position: absolute;
  height: 4px;
  background: var(--nxrs-accent);
  border-radius: 2px;
}
.nxrs-price-input {
  position: absolute;
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
  margin: 0;
}
.nxrs-price-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--nxrs-accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px #00000040;
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 1;
}
.nxrs-price-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--nxrs-accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px #00000040;
  cursor: pointer;
  pointer-events: all;
}
.nxrs-price-input--max {
  z-index: 2;
}
.nxrs-price-reset {
  background: none;
  border: 1px solid var(--nxrs-border);
  border-radius: var(--nxrs-radius-sm);
  padding: 4px 10px;
  font-size: 0.72rem;
  color: var(--nxrs-text-muted);
  cursor: pointer;
  align-self: flex-start;
  margin-top: 2px;
  transition:
    color var(--nxrs-transition),
    border-color var(--nxrs-transition);
}
.nxrs-price-reset:hover {
  color: var(--nxrs-accent);
  border-color: var(--nxrs-accent);
}
.nxrs-filter-toggle {
  display: none;
  align-items: center;
  gap: var(--nxrs-gap-sm);
  padding: 8px 16px;
  background: var(--nxrs-primary);
  color: #fff;
  border: none;
  border-radius: var(--nxrs-radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--nxrs-transition);
}
.nxrs-filter-toggle:hover,
.nxrs-filter-toggle.active {
  background: var(--nxrs-accent);
}
.nxrs-filter-toggle:focus-visible {
  outline: 2px solid var(--nxrs-accent);
  outline-offset: 2px;
}
@keyframes nxrs-shimmer {
  0% {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
@keyframes nxrs-fade-in {
  0% {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/*
 * Única animación de apertura: el panel baja desde el borde superior, como el
 * layer de la referencia. Los tres modos anteriores (fade / slide-up / scale)
 * eran incoherentes con un panel pegado arriba y se retiraron del BO en 1.5.0.
 */
.nxrs-overlay {
  transition: opacity 0.3s ease;
}
.nxrs-overlay .nxrs-overlay__container {
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.nxrs-overlay:not(.nxrs-overlay--open) .nxrs-overlay__container {
  transform: translateY(-100%);
}
.nxrs-overlay.nxrs-overlay--open .nxrs-overlay__container {
  transform: translateY(0);
}
.nxrs-results .nxrs-product {
  animation: nxrs-fade-in 0.2s ease both;
}
.nxrs-results .nxrs-product:nth-child(1) {
  animation-delay: 0s;
}
.nxrs-results .nxrs-product:nth-child(2) {
  animation-delay: 0.03s;
}
.nxrs-results .nxrs-product:nth-child(3) {
  animation-delay: 0.06s;
}
.nxrs-results .nxrs-product:nth-child(4) {
  animation-delay: 0.09s;
}
.nxrs-results .nxrs-product:nth-child(5) {
  animation-delay: 0.12s;
}
.nxrs-results .nxrs-product:nth-child(6) {
  animation-delay: 0.15s;
}
.nxrs-results .nxrs-product:nth-child(7) {
  animation-delay: 0.18s;
}
.nxrs-results .nxrs-product:nth-child(8) {
  animation-delay: 0.21s;
}
.nxrs-results .nxrs-product:nth-child(9) {
  animation-delay: 0.24s;
}
.nxrs-results .nxrs-product:nth-child(10) {
  animation-delay: 0.27s;
}
.nxrs-results .nxrs-product:nth-child(11) {
  animation-delay: 0.3s;
}
.nxrs-results .nxrs-product:nth-child(12) {
  animation-delay: 0.33s;
}
@media (prefers-reduced-motion: reduce) {
  .nxrs-overlay,
  .nxrs-overlay .nxrs-overlay__container,
  .nxrs-results .nxrs-product,
  .nxrs-skeleton {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 767px) {
  .nxrs-overlay__container {
    height: 100dvh;
  }
  .nxrs-overlay__header {
    padding: var(--nxrs-gap) var(--nxrs-gap) 0;
  }
  .nxrs-overlay__body {
    padding: var(--nxrs-gap);
  }
  .nxrs-search-box__input {
    font-size: 1rem;
  }
  .nxrs-overlay__close {
    width: 36px;
    height: 36px;
  }
  .nxrs-filters {
    display: none;
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-height: 60vh;
    gap: var(--nxrs-gap-lg);
    border-right: none;
    border-top: 2px solid var(--nxrs-border);
    border-radius: var(--nxrs-radius) var(--nxrs-radius) 0 0;
    padding: var(--nxrs-gap-lg) var(--nxrs-gap);
    background: var(--nxrs-bg);
    z-index: calc(var(--nxrs-overlay-z) + 1);
    box-shadow: 0 -4px 24px #00000026;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .nxrs-filters.nxrs-filters--drawer-open {
    display: flex;
    transform: translateY(0);
  }
  .nxrs-filter-toggle {
    display: inline-flex;
    position: fixed;
    bottom: var(--nxrs-gap);
    left: 50%;
    transform: translate(-50%);
    z-index: var(--nxrs-overlay-z);
    box-shadow: 0 4px 16px #0003;
  }
  .nxrs-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--nxrs-gap-sm);
  }
  .nxrs-product {
    padding: var(--nxrs-gap);
  }
  .nxrs-product__name {
    font-size: 0.8rem;
  }
  .nxrs-product__price {
    font-size: 0.9rem;
  }
  .nxrs-filter-item {
    padding: 10px 0;
    font-size: 0.9rem;
  }
  .nxrs-filter-group__title {
    font-size: 1.0625rem;
  }
  /* En 390 px el recuento y el orden no caben en una línea. */
  .nxrs-status {
    flex-wrap: wrap;
    gap: 4px;
  }
  .nxrs-sort-label {
    display: none;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --nxrs-pad-x: var(--nxrs-gap-lg);
    --nxrs-pad-y: var(--nxrs-gap);
  }
  .nxrs-filters {
    width: 240px;
  }
  .nxrs-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .nxrs-product {
    padding: var(--nxrs-gap);
  }
  .nxrs-filter-group__title {
    font-size: 1.0625rem;
  }
}
.nxrs-results-section-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 0 8px;
  margin-top: 4px;
}

.nxrs-results-section-header:first-child {
  margin-top: 0;
}

.nxrs-results-section-header--exact {
  color: var(--nxrs-accent);
  border-bottom: 1px solid var(--nxrs-accent);
  opacity: 0.9;
}

.nxrs-results-section-header--related {
  color: var(--nxrs-text-muted);
  border-bottom: 1px solid var(--nxrs-border);
}

.nxrs-product--exact {
  border-color: var(--nxrs-accent);
  box-shadow:
    0 0 0 2px var(--nxrs-accent),
    0 4px 16px rgba(0, 0, 0, 0.1);
  position: relative;
}

.nxrs-product--exact:hover,
.nxrs-product--exact:focus-visible {
  box-shadow:
    0 0 0 2px var(--nxrs-accent),
    0 6px 24px rgba(0, 0, 0, 0.14);
}

.nxrs-product__exact-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nxrs-accent);
  background: color-mix(in srgb, var(--nxrs-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--nxrs-accent) 30%, transparent);
  border-radius: var(--nxrs-radius-sm);
  padding: 2px 6px;
  margin-bottom: 2px;
  order: -1;
  align-self: flex-start;
}

/* Respaldo neutro para navegadores sin color-mix(): nunca un color de marca. */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .nxrs-product__exact-badge {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
  }
}

.nxrs-results-section-header--indirect {
  color: var(--nxrs-text-muted);
  border-bottom: 1px dashed var(--nxrs-border);
  opacity: 0.75;
}

.nxrs-filter-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding-bottom: var(--nxrs-gap-sm);
  border-bottom: none;
  user-select: none;
}

.nxrs-filter-group__header:hover .nxrs-filter-group__title {
  color: var(--nxrs-accent);
}

.nxrs-filter-group__header .nxrs-filter-group__title {
  border-bottom: none;
  padding-bottom: 0;
  margin: 0;
  flex: 1;
}

.nxrs-filter-group__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nxrs-text-muted);
  border-radius: var(--nxrs-radius-sm);
  flex-shrink: 0;
  transition:
    color var(--nxrs-transition),
    background var(--nxrs-transition);
  padding: 0;
}

.nxrs-filter-group__toggle:hover {
  color: var(--nxrs-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nxrs-filter-group__toggle svg {
  transition: transform 0.2s ease;
}

.nxrs-filter-group__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nxrs-filter-group__items,
.nxrs-filter-group__collapsible {
  overflow: hidden;
  transition: none;
}

.nxrs-filter-group__items:not([style*="display: none"]),
.nxrs-filter-group__collapsible:not([style*="display: none"]) {
  margin-top: var(--nxrs-gap-sm);
}

.nxrs-filters__header {
  padding-bottom: 0;
  margin-bottom: calc(var(--nxrs-gap-sm) * -1);
  border-bottom: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nxrs-gap-sm);
}

/* «Quitar filtros»: sale cuando hay filtros activos, también si han dejado el
   resultado a cero (antes no quedaba ninguna casilla que desmarcar). */
.nxrs-filters__reset {
  appearance: none;
  border: 1px solid var(--nxrs-border);
  background: transparent;
  color: var(--nxrs-primary);
  border-radius: var(--nxrs-radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--nxrs-transition), color var(--nxrs-transition);
}
.nxrs-filters__reset:hover,
.nxrs-filters__reset:focus-visible {
  background: var(--nxrs-primary);
  color: #ffffff;
}

.nxrs-filters__title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nxrs-text-muted);
}

.nxrs-popular__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--nxrs-gap-sm);
}

.nxrs-popular__tag {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  max-width: 100%;
  padding: 7px 11px;
  background: transparent;
  border: 1px solid #dce3df;
  border-radius: 6px;
  box-shadow: none;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--nxrs-text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--nxrs-transition), color var(--nxrs-transition);
}
.nxrs-popular__tag:hover {
  background: transparent;
  border-color: var(--nxrs-accent);
  color: var(--nxrs-accent);
}
.nxrs-popular__tag:focus-visible {
  outline: 2px solid var(--nxrs-accent);
  outline-offset: 3px;
}
.nxrs-popular__tag-num {
  min-width: 0;
  height: auto;
  padding: 0 0 0 7px;
  background: transparent;
  border-radius: 0;
  border-left: 1px solid var(--nxrs-border);
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--nxrs-text-muted);
  flex-shrink: 0;
  line-height: 1;
}
.nxrs-popular__tag-icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.55;
}
.nxrs-popular__tag-label {
  font-weight: 500;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.nxrs-popular__tag:hover .nxrs-popular__tag-label {
  text-decoration-line: underline;
}
@media (max-width: 767px) {
  .nxrs-popular__terms { gap: 8px; }
  .nxrs-popular__terms > h5 { flex-basis: 100%; }
  .nxrs-popular__tag { min-height: 44px; }
}

.nxrs-nav-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--nxrs-border);
}

.nxrs-nav-section__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--nxrs-text-muted);
}

.nxrs-nav-section__title svg {
  opacity: 0.55;
  flex-shrink: 0;
}

.nxrs-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nxrs-nav-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px 9px 11px;
  background: var(--nxrs-bg);
  border: 1.5px solid var(--nxrs-border);
  border-radius: var(--nxrs-radius);
  text-decoration: none;
  color: var(--nxrs-text);
  cursor: pointer;
  max-width: 260px;
  transition:
    background var(--nxrs-transition),
    border-color var(--nxrs-transition),
    color var(--nxrs-transition),
    box-shadow var(--nxrs-transition),
    transform var(--nxrs-transition);
  outline: none;
}

.nxrs-nav-link:hover {
  background: var(--nxrs-primary);
  border-color: var(--nxrs-primary);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

.nxrs-nav-link:focus-visible {
  outline: 2px solid var(--nxrs-accent);
  outline-offset: 2px;
}

.nxrs-nav-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--nxrs-radius-sm);
  background: rgba(0, 0, 0, 0.05);
  font-size: 18px;
  line-height: 1;
  color: var(--nxrs-text-muted);
  transition:
    background var(--nxrs-transition),
    color var(--nxrs-transition);
}

.nxrs-nav-link:hover .nxrs-nav-link__icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nxrs-nav-link__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nxrs-nav-link__label {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  color: var(--nxrs-text);
  transition: color var(--nxrs-transition);
}

.nxrs-nav-link:hover .nxrs-nav-link__label {
  color: #fff;
}

.nxrs-nav-link__breadcrumb {
  font-size: 0.71rem;
  color: var(--nxrs-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--nxrs-transition);
  line-height: 1.3;
}

.nxrs-nav-link:hover .nxrs-nav-link__breadcrumb {
  color: rgba(255, 255, 255, 0.75);
}

.nxrs-nav-link__badge {
  align-self: flex-start;
  display: inline-block;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.07);
  color: var(--nxrs-text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  transition:
    background var(--nxrs-transition),
    color var(--nxrs-transition);
  line-height: 1.5;
  white-space: nowrap;
}

.nxrs-nav-link:hover .nxrs-nav-link__badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.nxrs-nav-link__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .nxrs-nav-link {
    transition: none !important;
    transform: none !important;
  }
  .nxrs-nav-link__icon,
  .nxrs-nav-link__label,
  .nxrs-nav-link__breadcrumb,
  .nxrs-nav-link__badge {
    transition: none !important;
  }
}

@media (max-width: 767px) {
  .nxrs-nav-links {
    gap: 6px;
  }

  .nxrs-nav-link {
    padding: 8px 11px 8px 9px;
    max-width: 100%;
  }

  .nxrs-nav-link__icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .nxrs-nav-link__breadcrumb {
    display: none;
  }
}

.nxrs-featured-categories-container {
  margin-bottom: var(--nxrs-gap);
  padding: 0 var(--nxrs-gap-sm);
}

.nxrs-featured-categories {
  background: var(--nxrs-bg);
  border: 1px solid var(--nxrs-border);
  border-radius: var(--nxrs-radius);
  overflow: hidden;
}

.nxrs-featured-categories__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--nxrs-border);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--nxrs-text-muted);
}

.nxrs-featured-categories__header svg {
  flex-shrink: 0;
}

.nxrs-featured-categories__list {
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nxrs-featured-category {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--nxrs-border);
  border-radius: 32px;
  cursor: pointer;
  transition: all var(--nxrs-transition);
  overflow: hidden;
}

.nxrs-featured-category:hover {
  background: var(--nxrs-primary);
  border-color: var(--nxrs-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nxrs-featured-category:hover .nxrs-featured-category__name {
  color: #fff;
}

.nxrs-featured-category:hover .nxrs-featured-category__count {
  color: rgba(255, 255, 255, 0.8);
}

.nxrs-featured-category__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--nxrs-text);
  transition: color var(--nxrs-transition);
  white-space: nowrap;
}

.nxrs-featured-category__count {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--nxrs-text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 20px;
  transition: all var(--nxrs-transition);
  white-space: nowrap;
}

.nxrs-featured-category:hover .nxrs-featured-category__count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.nxrs-featured-category__bar {
  display: none;
}

.nxrs-featured-category--with-bar {
  position: relative;
}

.nxrs-featured-category--with-bar .nxrs-featured-category__bar {
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--nxrs-accent);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.nxrs-featured-category--compact {
  padding: 4px 10px;
}

.nxrs-featured-category--compact .nxrs-featured-category__count {
  font-size: 0.65rem;
  padding: 1px 4px;
}

.nxrs-category-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nxrs-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.8rem;
  z-index: calc(var(--nxrs-overlay-z) + 30);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
  .nxrs-featured-categories__list {
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nxrs-featured-category {
    flex-shrink: 0;
    padding: 5px 10px;
  }

  .nxrs-featured-category__name {
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .nxrs-featured-category__count {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .nxrs-category-toast {
    white-space: normal;
    text-align: center;
    max-width: 90%;
    font-size: 0.75rem;
  }
}

.nxrs-featured-category:active {
  transform: scale(0.96);
}

.nxrs-custom-message {
  background: linear-gradient(
    135deg,
    var(--nxrs-primary) 0%,
    var(--nxrs-accent) 100%
  );
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--nxrs-radius);
  margin-bottom: var(--nxrs-gap);
  font-size: 0.9rem;
  text-align: center;
}

.nxrs-custom-message a {
  color: #fff;
  text-decoration: underline;
}

.nxrs-custom-message a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.nxrs-custom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--nxrs-gap);
  padding: 0 var(--nxrs-gap-sm);
}

.nxrs-custom-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--nxrs-bg);
  border: 1px solid var(--nxrs-border);
  border-radius: 40px;
  color: var(--nxrs-text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--nxrs-transition);
}

.nxrs-custom-link:hover {
  background: var(--nxrs-primary);
  border-color: var(--nxrs-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nxrs-custom-link .material-icons {
  font-size: 18px;
}

@media (max-width: 767px) {
  .nxrs-custom-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .nxrs-custom-link {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .nxrs-custom-message {
    font-size: 0.8rem;
    padding: 10px 12px;
  }
}

.nxrs-warning-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--nxrs-radius);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: #856404;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nxrs-warning-banner .material-icons {
  font-size: 16px;
  color: #ffc107;
}

.nxrs-overlay__header {
  position: relative;
  width: 100%;
  max-width: var(--nxrs-content-maxw, none);
  margin: 0 auto;
}

.nxrs-search-box {
  position: relative;
  width: 100%;
}

/*
 * El aside sólo se pinta cuando hay facetas. No basta con :empty: la plantilla
 * deja saltos de línea dentro y eso ya cuenta como contenido.
 */
.nxrs-filters:not(:has(*)) {
  display: none;
}

/* --- Fix móvil buscador: iOS auto-zoom al enfocar el input --- */
/* iOS hace zoom al enfocar un input con font-size < 16px. Como el overlay
   auto-enfoca el buscador al abrirse, eso disparaba el "zoom raro" y dejaba
   los resultados fuera de pantalla. 16px explícitos lo evitan. */
@media (max-width: 767px) {
  .nxrs-search-box__input {
    font-size: 16px !important;
    text-align: left;
  }

  /* Tarjetas más pequeñas para ver más productos por pantalla. */
  .nxrs-results {
    gap: 8px;
  }
  .nxrs-product__info {
    padding: var(--nxrs-gap-sm) 0 0;
    gap: 2px;
  }
  .nxrs-product__name {
    font-size: 0.72rem !important;
    line-height: 1.2;
  }
  .nxrs-product__price {
    font-size: 0.78rem !important;
  }
  .nxrs-product__ref,
  .nxrs-product__manufacturer {
    display: none;
  }
}

/* Compact sorting control, isolated from the theme's select rules. */
.nxrs-overlay .nxrs-sort {
  width: 172px;
  max-width: 100%;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 4px 26px 4px 10px;
  border: 1px solid var(--nxrs-border);
  border-radius: var(--nxrs-radius-sm);
  background-color: #f7f8f8;
  background-position: right 9px center;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 22px;
  box-shadow: none;
}
.nxrs-sort-container { gap: 6px; }
.nxrs-sort-icon { flex-shrink: 0; color: var(--nxrs-text-muted); }
.nxrs-product__discount {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  padding: 4px 7px;
  border-radius: 4px;
  background: #cc0c39;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
