/* === Productos (listado) – estilos corregidos y unificados === */

/* Encabezado compacto */
.catalog-header {
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.catalog-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: .8rem 0;
}
.catalog-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  color: #1f2937;
  text-decoration: none;
}
.catalog-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.catalog-links {
  display: flex;
  gap: .8rem;
  align-items: center;
}
.catalog-links a {
  color: #374151;
  padding: .5rem .7rem;
  border-radius: 10px;
  text-decoration: none;
}
.catalog-links a:hover { background: var(--surface); }

/* Buscador */
.catalog-search {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.catalog-search input {
  width: min(52vw, 420px);
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
}
.catalog-search button {
  padding: .6rem .9rem;
  border-radius: 10px;
  background: var(--action);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}
.catalog-search button:hover { background: var(--action-700); }

/* Contenido principal */
.catalog-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.6rem 1.25rem 2.4rem;
}
.catalog-main h1 {
  margin: 0 0 .4rem;
  font-size: 1.6rem;
  text-align: center;
}
.catalog-summary {
  margin: 0 0 1rem;
  color: #6b7280;
  text-align: center;
}

/* === Grilla de productos (mismo layout que index) === */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  justify-items: center;
}

@media (max-width: 1100px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }

/* === Tarjetas (idénticas a las del home/index) === */
.catalog-grid .home-product-card,
.catalog-card {
  width: 100%;
  max-width: 280px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.catalog-grid .home-product-card:hover,
.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
}

/* Imagen */
.catalog-grid .home-product-card .media,
.catalog-card-media {
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 260px;
  overflow: hidden;
  padding: 10px 0;
  border-bottom: 1px solid #f3f3f3;
  box-sizing: border-box;
}
.catalog-grid .home-product-card .media img,
.catalog-card-media img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.12));
}

/* Contenido */
.catalog-grid .home-product-card .body,
.catalog-card-body {
  text-align: center;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.catalog-grid .home-product-card .title,
.catalog-card-body h2 {
  margin: 0 0 .4rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}
.catalog-grid .home-product-card .price,
.catalog-card-body .price {
  color: var(--brand-700);
  font-weight: 700;
  font-size: 1.1rem;
}
.catalog-qty {
  width: 64px;
  margin: 0 auto .35rem;
  text-align: center;
  padding: .25rem .35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  display: block;
}
.catalog-qty:focus {
  outline: 2px solid #ffd4c3;
}

/* Botones */
.catalog-grid .home-product-card .actions,
.catalog-card-actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: stretch;
  justify-content: stretch;
  padding: 0 1rem 1rem;
  margin-top: auto;
}
.catalog-grid .home-product-card .actions .more,
.catalog-card-actions a.view {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  color: var(--action);
  border: 1px solid var(--action);
  border-radius: 10px;
  padding: .6rem .9rem;
  font-weight: 600;
  transition: background .2s ease;
  text-decoration: none;
  margin: 0;
}
.catalog-grid .home-product-card .actions .more:hover,
.catalog-card-actions a.view:hover {
  background: #fff5f5;
}
.catalog-grid .home-product-card .actions .add,
.catalog-card-actions button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .7rem .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
  margin: 0;
}
.catalog-grid .home-product-card .actions .add:hover,
.catalog-card-actions button:hover {
  background: var(--action-700);
}

/* Estado vacio */
.catalog-empty {
  margin-top: 1rem;
  padding: 1rem;
  background: #fff8f7;
  border: 1px dashed #fecaca;
  border-radius: 12px;
  color: #b91c1c;
  text-align: center;
}

/* Responsividad */
@media (max-width: 520px) {
  .catalog-grid .home-product-card { max-width: 100%; }
  .catalog-grid .home-product-card .media { height: 220px; }
  .catalog-header .container { flex-wrap: wrap; gap: .6rem; }
  .catalog-links { width: 100%; justify-content: flex-end; }
  .catalog-search { width: 100%; }
  .catalog-search input { width: 100%; }
}
