/**
 * .fx-card — canonical product / machine card (BEM)
 *
 * Canonical markup:
 *   <article class="fx-card">
 *     <a class="fx-card__media">…</a>
 *     <div class="fx-card__body">
 *       <h3 class="fx-card__title">…</h3>
 *       <p class="fx-card__model">…</p>
 *       <dl class="fx-card__specs">…</dl>
 *       <div class="fx-card__actions">…</div>
 *     </div>
 *   </article>
 *
 * Legacy aliases (do not remove until markup is fully migrated):
 *   .fx-product, .fx-machine-card, .cc-card, .card-productos
 */
.fx-card,
.fx-product,
.fx-machine-card,
.cc-card,
a.card-productos,
.card-productos {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--fx-white, #fff);
  border: 1px solid var(--fx-line, #d8e5e0);
  border-radius: var(--fx-radius-card, 16px);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(32, 59, 50, 0.055);
  color: var(--fx-ink, #203b32);
  text-decoration: none;
}

.fx-card:hover,
.fx-product:hover,
.fx-machine-card:hover,
.cc-card:hover,
a.card-productos:hover,
.card-productos:hover {
  border-color: var(--fx-primary, #4BB597);
  box-shadow: 0 8px 24px rgba(32, 59, 50, 0.055);
  transform: none;
}

.fx-card__media,
.fx-product__image,
.cc-card__photo,
.card-productos figure.imagen {
  display: block;
  margin: 0;
  padding: 20px 16px 12px;
  width: 100%;
  background: var(--fx-white, #fff);
  line-height: 0;
  flex-shrink: 0;
}

.fx-card__media img,
.fx-product__image img,
.cc-card__photo img,
.card-productos .imagen__producto {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: contain;
}

.fx-card__body,
.fx-product__body,
.fx-machine-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 8px 20px 20px;
  min-width: 0;
}

.fx-card__title,
.fx-card__body h3,
.fx-product h3,
.fx-machine-card :is(h2, h3),
.cc-card :is(h2, h3),
.card-productos .title h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.3px;
  color: #164b40;
}

.fx-card__title a,
.fx-product h3 a {
  color: inherit;
  text-decoration: none;
}

.fx-card__model,
.fx-model,
.cc-model,
.cc-detail__model,
.fx-internal-model {
  display: table;
  margin: 0 0 12px;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--fx-soft-2, #eef7f3);
  color: var(--fx-green-700, #287760);
  font-size: 11px;
  font-weight: 650;
}

.fx-card__specs,
.fx-product dl {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: auto 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--fx-line, #d8e5e0);
}

.fx-card__specs > div,
.fx-product dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  line-height: 1.5;
}

.fx-card__specs dt,
.fx-product dt {
  color: var(--fx-muted, #5e7069);
}

.fx-card__specs dd,
.fx-product dd {
  margin: 0;
  max-width: 55%;
  text-align: right;
  font-weight: 650;
}

.fx-card__actions,
.fx-product__actions,
.fx-machine-actions,
.cc-card__actions,
.card-productos .acciones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 8px;
  margin-top: auto;
  font-size: var(--fx-btn-font-size, 13px);
}

.fx-card__actions a,
.fx-product__actions a,
.fx-machine-actions a,
.cc-card__actions a,
.card-productos .acciones a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: var(--fx-btn-min-height, 44px);
  padding: 10px 10px;
  border: 1px solid #dce7df;
  border-radius: 999px;
  background: #fff;
  color: #247b65;
  font-size: var(--fx-btn-font-size, 13px);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.fx-card__actions a:hover,
.fx-product__actions a:hover,
.fx-machine-actions a:hover,
.cc-card__actions a:hover,
.card-productos .acciones a:hover {
  background: #edf5ef;
  border-color: var(--fx-primary, #4BB597);
  color: #1d6252;
}

.fx-card__actions a:last-child,
.fx-product__actions a:last-child,
.fx-machine-actions :is(.fx-machine-quote, a:last-child),
.cc-card__actions :is(.cc-quote, a:last-child),
.card-productos .acciones a:last-child {
  background: var(--fx-yellow, #FFB344);
  border-color: var(--fx-yellow, #FFB344);
  color: var(--fx-ink, #203b32);
}

.fx-card__actions a:last-child:hover,
.fx-product__actions a:last-child:hover,
.fx-machine-actions :is(.fx-machine-quote, a:last-child):hover,
.cc-card__actions :is(.cc-quote, a:last-child):hover,
.card-productos .acciones a:last-child:hover {
  background: var(--fx-yellow-hover, #e89a27);
  border-color: var(--fx-yellow-hover, #e89a27);
  color: var(--fx-ink, #203b32);
}

.fx-card__actions svg,
.fx-product__actions svg,
.fx-machine-actions svg,
.cc-card__actions svg {
  display: block;
  flex-shrink: 0;
}

.fx-card-grid,
.fx-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.fx-card-grid--wide,
.fx-product-grid--wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .fx-card-grid,
  .fx-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .fx-card-grid,
  .fx-product-grid,
  .fx-card-grid--wide,
  .fx-product-grid--wide {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .fx-card,
  .fx-product,
  .fx-machine-card,
  .cc-card,
  a.card-productos,
  .card-productos {
    height: auto;
    min-height: 0;
  }

  .fx-card__actions,
  .fx-product__actions,
  .fx-machine-actions,
  .cc-card__actions,
  .card-productos .acciones {
    grid-template-columns: 1fr;
  }

  .fx-card__actions a,
  .fx-product__actions a,
  .fx-machine-actions a,
  .cc-card__actions a,
  .card-productos .acciones a {
    width: 100%;
    white-space: nowrap;
  }
}
