/* Catálogo: filtros al costado desde 601px (el mismo corte que usa WooCommerce para su panel). */
.catalogo__cabecera {
  display: grid;
  gap: 0.35rem;
}

.catalogo__cabecera > * {
  margin-block: 0 !important;
}

.catalogo__cabecera .wp-block-query-title {
  font-size: var(--wp--preset--font-size--titulo-m);
}

.catalogo__cuerpo {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: var(--wp--preset--spacing--5);
}

.catalogo__cuerpo > * {
  margin-block: 0 !important;
}

@media (width >= 601px) {
  .catalogo__cuerpo {
    grid-template-columns: minmax(16rem, 18rem) minmax(0, 1fr);
    gap: var(--wp--preset--spacing--6);
    align-items: start;
  }
}

.catalogo__resultados > * {
  margin-block: 0 !important;
}

.catalogo__herramientas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem !important;
}

.catalogo__herramientas > * {
  margin-block: 0 !important;
}

.woocommerce-result-count {
  margin: 0;
  font-size: var(--wp--preset--font-size--s);
  color: var(--wp--preset--color--tinta-suave);
}

.woocommerce-ordering select {
  min-height: var(--wp--custom--alto-tactil);
  padding: 0.5rem 2.25rem 0.5rem 0.9rem;
  border: 1px solid var(--wp--custom--borde);
  border-radius: var(--wp--custom--radio--pildora);
  background: var(--wp--preset--color--superficie)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23106397' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    right 0.75rem center / 1rem no-repeat;
  color: var(--wp--preset--color--tinta);
  font: inherit;
  font-size: var(--wp--preset--font-size--s);
  appearance: none;
}

/* Filtros */
.tarjeta__cuerpo > *,
.catalogo__vacio > * {
  margin-block: 0 !important;
}

.tarjeta__boton .wp-block-button__link {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: var(--wp--preset--font-size--s);
}

.catalogo__filtros {
  --wc-product-filters-overlay-icon-size: 1.25rem;

  min-width: 0;
  overflow-x: clip;
}

.catalogo__filtros .wc-block-product-filters__overlay,
.catalogo__filtros .wc-block-product-filters__overlay-wrapper,
.catalogo__filtros .wc-block-product-filters__overlay-dialog,
.catalogo__filtros .wc-block-product-filters__overlay-content {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.catalogo__filtros .wc-block-product-filters__open-overlay {
  gap: 0.5rem;
  min-height: var(--wp--custom--alto-tactil);
  padding: 0 1.1rem;
  border: 1px solid var(--wp--custom--borde);
  border-radius: var(--wp--custom--radio--pildora);
  background: var(--wp--preset--color--superficie);
  color: var(--wp--preset--color--azul);
  font-size: var(--wp--preset--font-size--s);
  font-weight: 700;
}

.catalogo__filtros .wc-block-product-filters__overlay-content {
  display: grid;
  gap: 1.5rem;
}

.catalogo__filtros .wc-block-product-filters__overlay-content > * {
  margin-block: 0 !important;
}

.catalogo__filtros .wp-block-woocommerce-product-filter-taxonomy,
.catalogo__filtros .wp-block-woocommerce-product-filter-attribute,
.catalogo__filtros .wp-block-woocommerce-product-filter-price,
.catalogo__filtros .wp-block-woocommerce-product-filter-status {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--wp--custom--borde);
}

.catalogo__filtros .wp-block-woocommerce-product-filter-checkbox-list fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.catalogo__filtros h3.wp-block-heading {
  margin: 0 0 0.6rem !important;
  font-size: var(--wp--preset--font-size--s);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--tinta);
}

.catalogo__filtros .wc-block-product-filter-checkbox-list__items {
  display: grid;
  gap: 0.1rem;
}

.catalogo__filtros .wc-block-product-filter-checkbox-list__label {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 2.25rem;
  cursor: pointer;
}

.catalogo__filtros .wc-block-product-filter-checkbox-list__input-wrapper {
  flex-shrink: 0;
}

.catalogo__filtros .wc-block-product-filter-checkbox-list__input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--wp--preset--color--azul);
}

.catalogo__filtros .wc-block-product-filter-chips__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.catalogo__filtros .wc-block-product-filter-chips__item {
  min-height: 2.25rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--wp--custom--borde);
  border-radius: var(--wp--custom--radio--pildora);
  background: var(--wp--preset--color--superficie);
  color: var(--wp--preset--color--tinta);
  font: inherit;
  font-size: var(--wp--preset--font-size--s);
  text-align: left;
  cursor: pointer;
}

.catalogo__filtros .wc-block-product-filter-chips__item[aria-checked='true'] {
  border-color: var(--wp--preset--color--azul);
  background: var(--wp--preset--color--azul);
  color: #fff;
}

.catalogo__filtros .wc-block-product-filter-removable-chips__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalogo__filtros .wc-block-product-filter-removable-chips__item {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  padding: 0.2rem 0.3rem 0.2rem 0.75rem;
  border-radius: var(--wp--custom--radio--pildora);
  background: var(--wp--preset--color--azul-suave);
  color: var(--wp--preset--color--azul-hondo);
  font-size: var(--wp--preset--font-size--s);
  font-weight: 600;
}

.catalogo__filtros .wc-block-product-filter-removable-chips__remove {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.catalogo__filtros .wc-block-product-filter-removable-chips__remove-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentcolor;
}

.catalogo__filtros .wc-block-product-filter-clear-button .wp-block-button__link {
  padding: 0.5rem 1rem;
  font-size: var(--wp--preset--font-size--s);
}

.catalogo__filtros .wc-block-product-filter-price-slider input[type='text'] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  border: 1px solid var(--wp--custom--borde);
  border-radius: var(--wp--custom--radio--s);
  font-size: max(16px, 0.9rem);
}

.catalogo__filtros .wp-block-woocommerce-product-filter-price-slider,
.catalogo__filtros .wc-block-product-filter-price-slider__content,
.catalogo__filtros .wc-block-product-filter-price-slider__range,
.catalogo__filtros .wc-block-product-filter-price-slider__left,
.catalogo__filtros .wc-block-product-filter-price-slider__right {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.catalogo__filtros .wc-block-product-filter-price-slider__content {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (width <= 600px) {
  .catalogo__filtros .wc-block-product-filters__overlay-dialog {
    background: var(--wp--preset--color--fondo);
    visibility: hidden;
    pointer-events: none;
  }

  .catalogo__filtros.is-overlay-opened .wc-block-product-filters__overlay-dialog {
    visibility: visible;
    pointer-events: auto;
  }

  .catalogo__filtros .wc-block-product-filters__overlay-header {
    padding: 1rem var(--wp--custom--margen-lateral);
  }

  .catalogo__filtros .wc-block-product-filters__overlay-content {
    padding: 0 var(--wp--custom--margen-lateral) 1.5rem;
  }

  .catalogo__filtros .wc-block-product-filters__close-overlay {
    min-height: var(--wp--custom--alto-tactil);
    font-weight: 700;
  }
}

@media (width >= 601px) {
  .catalogo__filtros {
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - 2rem);
    padding: 1.25rem;
    overflow-y: auto;
    border: 1px solid var(--wp--custom--borde);
    border-radius: var(--wp--custom--radio--m);
    background: var(--wp--preset--color--superficie);
    scrollbar-width: thin;
  }
}

/* Tarjetas de producto (catálogo y relacionados) */
.tarjetas.wc-block-product-template {
  display: grid !important;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, max(9.5rem, calc(50% - 0.5rem))), 1fr)
  ) !important;
  gap: 1rem !important;
  margin: 0;
  padding: 0;
}

@media (width >= 48rem) {
  .tarjetas.wc-block-product-template {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)) !important;
    gap: 1.25rem !important;
  }
}

.tarjetas > .wc-block-product {
  position: relative;
  display: flex;
  flex-direction: column;
  width: auto !important;
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid var(--wp--custom--borde);
  border-radius: var(--wp--custom--radio--m);
  background: var(--wp--preset--color--superficie);
  transition:
    box-shadow 0.25s var(--wp--custom--curva-suave),
    transform 0.25s var(--wp--custom--curva-suave);
}

@media (hover: hover) {
  .tarjetas > .wc-block-product:hover {
    box-shadow: var(--wp--preset--shadow--m);
    transform: translateY(-2px);
  }

  .tarjetas > .wc-block-product:hover .tarjeta__imagen img {
    transform: scale(1.025);
  }
}

.tarjetas .tarjeta__imagen {
  aspect-ratio: 4 / 3;
  margin: 0 !important;
  overflow: hidden;
  background: var(--wp--preset--color--superficie-2);
}

.tarjetas .tarjeta__imagen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--wp--custom--curva-suave);
}

.tarjeta__cuerpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 0.85rem 0.9rem;
}

.tarjeta__marca {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tarjeta__marca a {
  color: var(--wp--preset--color--azul);
  text-decoration: none;
}

.tarjeta__titulo {
  font-size: var(--wp--preset--font-size--m) !important;
  line-height: 1.3 !important;
}

.tarjeta__titulo a {
  color: var(--wp--preset--color--tinta);
  text-decoration: none;
}

/* Toda la tarjeta lleva al producto, sin sumar un enlace más para el lector de pantalla. */
.tarjeta__titulo a::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: '';
}

.tarjeta__marca a,
.tarjeta__boton {
  position: relative;
  z-index: 2;
}

.tarjeta__precio {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.35rem;
  margin-top: 0.2rem !important;
  font-size: var(--wp--preset--font-size--l);
  font-weight: 700;
}

/* Con varias medidas, el precio es un rango ("$X – $Y"): en la tarjeta mostramos solo el precio de
   entrada ("Desde $X"), que es lo que sirve para comparar de un vistazo. El rango completo se ve en
   la ficha del producto, donde el ancho no obliga a cortar la línea en cualquier lado. */
.tarjeta__precio:has(.woocommerce-Price-amount + span)::before {
  width: 100%;
  color: var(--wp--preset--color--tinta-suave);
  content: 'Desde';
  font-size: var(--wp--preset--font-size--s);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tarjeta__precio .woocommerce-Price-amount + span,
.tarjeta__precio .woocommerce-Price-amount + span + .woocommerce-Price-amount {
  display: none;
}

.tarjeta__precio del {
  font-size: 0.8em;
  font-weight: 400;
  color: var(--wp--preset--color--tinta-suave);
}

.tarjeta__stock.wc-block-components-product-stock-indicator--in-stock {
  display: none;
}

.tarjeta__stock {
  font-size: var(--wp--preset--font-size--s);
  font-weight: 700;
  color: var(--wp--preset--color--bordo);
}

.tarjeta__boton {
  margin-top: auto !important;
  padding-top: 0.6rem;
}

.tarjeta__boton .added_to_cart {
  display: block;
  margin-top: 0.4rem;
  font-size: var(--wp--preset--font-size--s);
  font-weight: 600;
  text-align: center;
}

.wc-block-components-product-sale-badge {
  border: 0;
  border-radius: var(--wp--custom--radio--pildora);
  background: var(--wp--preset--color--bordo);
  color: #fff;
  font-weight: 700;
}

.wp-block-query-pagination {
  gap: 0.4rem;
  margin-top: var(--wp--preset--spacing--6) !important;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .current {
  display: inline-grid;
  place-items: center;
  min-width: var(--wp--custom--alto-tactil);
  min-height: var(--wp--custom--alto-tactil);
  padding-inline: 0.6rem;
  border-radius: var(--wp--custom--radio--pildora);
  text-decoration: none;
}

.wp-block-query-pagination .current {
  background: var(--wp--preset--color--azul);
  color: #fff;
}

.catalogo__vacio {
  display: grid;
  gap: 0.75rem;
  padding: var(--wp--preset--spacing--6);
  border-radius: var(--wp--custom--radio--l);
  background: var(--wp--preset--color--superficie);
}

.catalogo__confianza {
  margin-top: var(--wp--preset--spacing--seccion) !important;
}
