/* Estructura y repisa integrada de herramientas para catálogo y tienda */
.category-page,
.shop-page {
  --shop-radius: 0.375rem;

  width: 100%;
  min-height: calc(100vh - 120px);
  padding: 2.25rem 0 4.5rem;
  background-color: var(--bg);
  box-sizing: border-box;
}

.category-page__container,
.shop-page__container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

/* Encabezado y descripción */
.category-page__header,
.shop-page__header {
  margin-bottom: 1.75rem;
}

.category-page__title,
.shop-page__title {
  margin: 0;
  color: var(--primary);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.category-page__description,
.shop-page__description {
  max-width: 56.25rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.category-page__description p,
.shop-page__description p {
  margin: 0;
}

.category-page__main,
.shop-page__main {
  width: 100%;
  min-width: 0;
}

/* Repisa enmarcada de herramientas */
.category-page__toolbar,
.shop-page__toolbar {
  width: 100%;
  margin-bottom: 2rem;
  padding: 0.875rem 1rem;
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
}

.category-page__toolbar-left,
.shop-page__toolbar-left {
  width: 100%;
}

/* Ocultar conteo y select nativo de WooCommerce */
.category-page .woocommerce-result-count,
.shop-page .woocommerce-result-count,
.category-page .woocommerce-ordering,
.shop-page .woocommerce-ordering {
  display: none !important;
}

/* Grilla de productos */
.category-page__grid,
.shop-page__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 1rem;
  width: 100%;
  margin-bottom: 2.25rem;
}

.category-page__grid > .product-card,
.shop-page__grid > .product-card {
  width: 100%;
  min-width: 0;
  height: 100%;
}

@media (min-width: 600px) {
  .category-page__grid,
  .shop-page__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media (min-width: 992px) {
  .category-page__grid,
  .shop-page__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media (min-width: 1280px) {
  .category-page__grid,
  .shop-page__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* Estado de carga de la grilla */
.category-page__grid.product-filters-loading,
.shop-page__grid.product-filters-loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Botón de carga incremental */
.category-page__load-more,
.shop-page__load-more {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.product-filters__load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13.5rem;
  height: 2.75rem;
  padding: 0 1.75rem;
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  background-color: var(--bg-light);
  border: 1.5px solid var(--primary);
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  box-sizing: border-box;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.product-filters__load-more-btn:hover:not(:disabled) {
  color: var(--text-inverse);
  background-color: var(--primary);
  border-color: var(--primary);
}

.product-filters__load-more-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.product-filters__load-more-btn:disabled,
.product-filters__load-more-btn--loading {
  color: var(--text-muted);
  background-color: var(--bg-dark);
  border-color: var(--border);
  box-shadow: none;
  cursor: default;
}

/* Estado sin resultados */
.category-page__empty,
.shop-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 14rem;
  padding: 4rem 1.5rem;
  color: var(--text);
  text-align: center;
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--shop-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.category-page__empty .woocommerce-info,
.shop-page__empty .woocommerce-info {
  margin: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.5;
  background: transparent;
  border: none;
}

/* Adaptabilidad responsive */
@media (max-width: 767px) {
  .category-page,
  .shop-page {
    padding: 1.75rem 0 3rem;
  }

  .category-page__container,
  .shop-page__container {
    padding: 0 1rem;
  }

  .category-page__header,
  .shop-page__header {
    margin-bottom: 1.25rem;
  }

  .category-page__title,
  .shop-page__title {
    font-size: var(--fs-lg);
  }

  .category-page__description,
  .shop-page__description {
    font-size: var(--fs-xs);
  }

  .category-page__toolbar,
  .shop-page__toolbar {
    padding: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .category-page__grid,
  .shop-page__grid {
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  .category-page__empty,
  .shop-page__empty {
    min-height: 11.25rem;
    padding: 3rem 1rem;
  }

  .category-page__load-more,
  .shop-page__load-more {
    margin-bottom: 2rem;
  }

  .product-filters__load-more-btn {
    width: 100%;
    min-width: 0;
  }
}