/* Cards del catálogo: capa aislada cargada después del CSS principal. */
html.is-appending-products {
  scroll-behavior: auto !important;
  overflow-anchor: none;
}

html.is-appending-products .catalog-main,
html.is-appending-products .catalog-grid,
html.is-appending-products .catalog-load-more {
  overflow-anchor: none;
}

.catalog-grid.is-flat,
.catalog-products-grid {
  gap: 28px 22px;
}

.catalog-grid .product-card {
  min-width: 0;
  min-height: 100%;
  border: 1px solid #d9e2d4;
  border-radius: 14px;
  background: #fff;
  grid-template-rows: 238px 1fr;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(23, 63, 42, .07);
  transition: none;
}

.catalog-grid .product-card:hover,
.catalog-grid .product-card:focus-within {
  border-color: #a6bf97;
  transform: none;
  box-shadow: 0 18px 42px rgba(23, 63, 42, .14);
}

.catalog-grid .product-media-link {
  min-width: 0;
  height: 100%;
  background: #eef3e9;
  display: block;
  position: relative;
  overflow: hidden;
}

.catalog-grid .product-visual {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #f6f8f3, #e8efe3);
}

.catalog-grid .product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: none;
}

.catalog-grid .product-card:hover .product-image {
  transform: scale(1.001);
}

.catalog-grid .product-visual .badge-row {
  pointer-events: none;
  align-items: flex-start;
  gap: 8px;
  display: flex;
  inset: 13px 13px auto;
}

.catalog-grid .product-visual .badge,
.catalog-grid .product-card:hover .badge-row .badge:first-child {
  width: auto;
  min-height: 29px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .025em;
  box-shadow: 0 5px 16px rgba(12, 31, 21, .14);
  backdrop-filter: blur(8px);
}

.catalog-grid .product-visual .product-category-badge {
  color: #fff;
  background: rgba(32, 77, 47, .94);
}

.catalog-grid .product-visual .product-status-badge {
  color: #23452e;
  background: rgba(255, 255, 255, .94);
  margin-left: auto;
}

.catalog-grid .product-body {
  min-width: 0;
  padding: 21px;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 17px;
  display: grid;
}

.catalog-grid .product-copy {
  min-width: 0;
}

.catalog-grid .product-title {
  min-height: 48px;
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -.018em;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-grid .product-title a {
  color: #172019;
  text-decoration: none;
}

.catalog-grid .product-title a:hover {
  color: #315f22;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.catalog-grid .product-meta {
  min-height: 20px;
  margin: 9px 0 17px;
  color: #697266;
  gap: 5px 10px;
  font-size: 13px;
  line-height: 1.4;
}

.catalog-grid .product-meta span + span::before {
  content: "·";
  color: #86a676;
  margin-right: 10px;
}

.catalog-grid .product-price-row {
  min-height: 34px;
  align-items: end;
}

.catalog-grid .product-price {
  color: #214f31;
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -.035em;
}

.catalog-grid .product-price-consult {
  max-width: none;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.catalog-grid .availability {
  min-width: 0;
  border: 1px solid #dce8d5;
  border-radius: 9px;
  background: #f4f8f1;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  display: flex;
}

.catalog-grid .availability-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #5b9b35;
  box-shadow: 0 0 0 4px rgba(91, 155, 53, .13);
}

.catalog-grid .availability-label {
  color: #75806f;
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.catalog-grid .availability strong {
  color: #294b31;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.catalog-grid .product-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 1px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  display: grid;
}

.catalog-grid .product-detail-link,
.catalog-grid .product-contact-link {
  min-height: 43px;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  display: inline-flex;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.catalog-grid .product-detail-link {
  color: #315f22;
  border: 1px solid #b8ccb0;
  background: #fff;
}

.catalog-grid .product-detail-link span[aria-hidden="true"] {
  display: none;
}

.catalog-grid .product-detail-link:hover {
  color: #214f31;
  border-color: #78996b;
  background: #f3f8ef;
  text-decoration: none;
}

.catalog-grid .product-contact-link {
  color: #fff;
  border: 1px solid #315f22;
  background: #315f22;
  padding-inline: 17px;
}

.catalog-grid .product-contact-link:hover {
  color: #fff;
  border-color: #173f2a;
  background: #173f2a;
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .catalog-grid.is-flat,
  .catalog-products-grid {
    gap: 18px 12px;
  }

  .catalog-grid .product-card {
    grid-template-rows: 190px 1fr;
    border-radius: 11px;
  }

  .catalog-grid .product-body {
    gap: 14px;
    padding: 16px;
  }

  .catalog-grid .product-title {
    min-height: 43px;
    font-size: 18px;
  }

  .catalog-grid .product-price {
    font-size: 25px;
  }

  .catalog-grid .product-actions {
    grid-template-columns: 1fr;
  }

  .catalog-grid .product-contact-link,
  .catalog-grid .product-detail-link {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .catalog-grid.is-flat,
  .catalog-products-grid {
    gap: 24px;
  }

  .catalog-grid .product-card {
    grid-template-rows: minmax(255px, 68vw) 1fr;
  }

  .catalog-grid .product-body {
    padding: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-grid .product-card,
  .catalog-grid .product-image,
  .catalog-grid .product-contact-link {
    transition: none;
  }
}

.catalog-load-more {
  justify-content: center;
  padding: 38px 0 8px;
  display: flex;
}

.catalog-load-more .btn {
  min-width: 210px;
}

.catalog-load-more .btn.is-loading {
  pointer-events: none;
  cursor: wait;
  opacity: .86;
}

.catalog-load-more .btn.is-loading::before {
  content: "";
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: catalogLoaderSpin .7s linear infinite;
}

.catalog-grid .product-card.is-newly-loaded {
  opacity: 1;
  animation: none;
}

@keyframes catalogLoaderSpin {
  to { transform: rotate(360deg); }
}

@keyframes catalogCardLoad {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.catalog-load-more .btn[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .catalog-load-more .btn.is-loading::before,
  .catalog-grid .product-card.is-newly-loaded {
    animation: none;
  }

  .catalog-grid .product-card.is-newly-loaded {
    opacity: 1;
  }
}
/* Cuatro controles en escritorio: busqueda, categoria, estado y rastro. */
.catalog-tools {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(130px, 1fr));
}

@media (max-width: 760px) {
  .catalog-tools {
    grid-template-columns: 1fr;
  }
}
