/* ── Filtros ───────────────────────────────────────────────────────── */
.imf-ch-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.imf-ch-filter {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff !important;
  border: 1px solid #E5E5E5 !important;
  color: #5A5A5A !important;
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 16px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  transition: color .15s, box-shadow .15s;
  font-family: inherit;
}

.imf-ch-filter:hover {
  color: #1A1A1A !important;
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.1) !important;
}

.imf-ch-filter.active {
  background: #1A1A1A !important;
  border-color: #1A1A1A !important;
  color: #fff !important;
}

.imf-ch-filter.active:hover {
  box-shadow: none !important;
}

.imf-ch-count {
  background: rgba(255,255,255,.2);
  color: inherit;
  font-size: 10.5px;
  border-radius: 999px;
  padding: 1px 7px;
}

.imf-ch-filter:not(.active) .imf-ch-count {
  background: #F0F0F0;
  color: #888;
}

/* ── Grid ──────────────────────────────────────────────────────────── */
.imf-ch-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 20px;
}

/* ── Card ──────────────────────────────────────────────────────────── */
.imf-ch-card {
  position: relative;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .2s, transform .2s;
}

.imf-ch-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

/* Badge top-right */
.imf-ch-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 4px;
}

.imf-ch-badge--orange { background: #E94E1B; color: #fff; }
.imf-ch-badge--dark   { background: #1A1A1A; color: #fff; }

/* Meta strip */
.imf-ch-meta {
  padding: 14px 16px 0;
}

.imf-ch-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.imf-ch-brand-tag {
  background: #1A1A1A;
  color: #fff;
  padding: 2px 7px;
  border-radius: 3px;
}

.imf-ch-brand-cat { color: #888; }

/* Image */
.imf-ch-imgwrap {
  position: relative;
  margin: 10px 16px;
  border-radius: 8px;
  background: #F8F7F5;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.imf-ch-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
  display: block;
}

.imf-ch-no-img {
  width: 100%;
  height: 100%;
  background: #F0F0F0;
}

.imf-ch-dot {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E94E1B;
  z-index: 2;
}

.imf-ch-stock {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.95);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 4px;
  color: #1A1A1A;
}

.imf-ch-stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.imf-ch-stock--green .imf-ch-stock-dot  { background: #22c55e; }
.imf-ch-stock--yellow .imf-ch-stock-dot { background: #f59e0b; }
.imf-ch-stock--red .imf-ch-stock-dot    { background: #ef4444; }

/* Body */
.imf-ch-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.imf-ch-h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1.3;
  margin: 0 0 6px;
}

.imf-ch-p {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin: 0 0 10px;
  flex: 1;
}

/* Specs */
.imf-ch-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.imf-ch-specs span {
  font-size: 11px;
  color: #888;
  background: #F5F5F5;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Actions — ocultas por defecto, visibles en hover de la card */
.imf-ch-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.imf-ch-card:hover .imf-ch-actions {
  opacity: 1;
  pointer-events: auto;
}

.imf-ch-btn-cotizar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #E94E1B;
  color: #fff !important;
  font-weight: 600;
  font-size: 13px;
  height: 42px;
  border-radius: 8px;
  text-decoration: none !important;
  transition: background .2s, opacity .2s;
  overflow: hidden;
}

.imf-ch-btn-cotizar:hover { background: #c73d12; }

/* Estado cargando */
.imf-ch-btn-cotizar.loading {
  opacity: .7;
  pointer-events: none;
}

/* Estado añadido */
.imf-ch-btn-cotizar.added {
  background: #16a34a;
  pointer-events: none;
}

.imf-ch-btn-cotizar.added:hover { background: #16a34a; }

/* Texto alternativo: visible solo en estado added */
.imf-ch-btn-txt    { display: inline-flex; align-items: center; gap: 6px; }
.imf-ch-btn-added  { display: none; align-items: center; gap: 6px; }

.imf-ch-btn-cotizar.added .imf-ch-btn-txt   { display: none; }
.imf-ch-btn-cotizar.added .imf-ch-btn-added { display: inline-flex; }

.imf-ch-btn-ver {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #E5E5E5;
  color: #1A1A1A !important;
  text-decoration: none !important;
  transition: border-color .2s;
}

.imf-ch-btn-ver:hover { border-color: #1A1A1A; }
.imf-ch-btn-ver svg   { width: 16px; height: 16px; }

/* ── Empty state ───────────────────────────────────────────────────── */
.imf-ch-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  background: #F8F7F5;
  border: 1px dashed #D5D5D5;
  border-radius: 12px;
  text-align: center;
  padding: 40px 24px;
}

.imf-ch-empty svg {
  width: 36px;
  height: 36px;
  color: #BBBBBB;
}

.imf-ch-empty p {
  font-size: 15px;
  color: #888;
  margin: 0;
}

.imf-ch-empty a {
  font-size: 13px;
  font-weight: 600;
  color: #E94E1B !important;
  text-decoration: none !important;
}

.imf-ch-empty a:hover { text-decoration: underline !important; }

/* ── CTA inferior ──────────────────────────────────────────────────── */
.imf-ch-cta {
  margin-top: 40px;
  text-align: center;
}

.imf-ch-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1A1A1A;
  color: #fff !important;
  font-weight: 600;
  font-size: 15px;
  padding: 0 28px;
  height: 52px;
  border-radius: 10px;
  text-decoration: none !important;
  transition: background .2s;
}

.imf-ch-cta a:hover { background: #333; }
.imf-ch-cta svg     { width: 16px; height: 16px; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .imf-ch-grid { grid-template-columns: repeat(2, 1fr); }
  .imf-ch-actions { opacity: 1; pointer-events: auto; }
}

@media (max-width: 767px) {
  /* Filtros */
  .imf-ch-filters { gap: 6px; margin-bottom: 16px; }
  .imf-ch-filter  { font-size: 12px; padding: 0 12px; height: 34px; }

  /* Grid: 1 columna */
  .imf-ch-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Card horizontal */
  .imf-ch-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Imagen ocupa las dos filas a la izquierda */
  .imf-ch-imgwrap {
    grid-column: 1;
    grid-row: 1 / 3;
    margin: 10px;
    aspect-ratio: 1 / 1;
  }

  /* Meta arriba a la derecha */
  .imf-ch-meta {
    grid-column: 2;
    grid-row: 1;
    padding: 12px 12px 0 6px;
  }

  /* Cuerpo abajo a la derecha */
  .imf-ch-body {
    grid-column: 2;
    grid-row: 2;
    padding: 6px 12px 12px 6px;
  }

  /* Ocultar descripción y specs en móvil */
  .imf-ch-p    { display: none; }
  .imf-ch-specs { display: none; }

  /* Tipografía más compacta */
  .imf-ch-h3 { font-size: 14px; margin-bottom: 10px; }

  /* Botones siempre visibles y más pequeños */
  .imf-ch-actions         { opacity: 1; pointer-events: auto; gap: 6px; }
  .imf-ch-btn-cotizar     { font-size: 12px; height: 36px; }
  .imf-ch-btn-ver         { width: 36px; height: 36px; }

  /* Badge top */
  .imf-ch-badge { top: 8px; right: 8px; }

  /* Stock badge más pequeño */
  .imf-ch-stock { font-size: 9px; padding: 2px 6px; }

  /* CTA */
  .imf-ch-cta a { font-size: 14px; height: 46px; padding: 0 20px; }
}
