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

/* ── Card ──────────────────────────────────────────────────────────── */
.imf-cg-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-cg-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

/* Badge top-right */
.imf-cg-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-cg-badge--orange { background: #E94E1B; color: #fff; }
.imf-cg-badge--dark   { background: #1A1A1A; color: #fff; }

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

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

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

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

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

.imf-cg-img { width: 100%; height: 100%; object-fit: contain; padding: 20px; display: block; }
.imf-cg-no-img { width: 100%; height: 100%; background: #F0F0F0; }

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

.imf-cg-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-cg-stock-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.imf-cg-stock--green .imf-cg-stock-dot  { background: #22c55e; }
.imf-cg-stock--yellow .imf-cg-stock-dot { background: #f59e0b; }
.imf-cg-stock--red .imf-cg-stock-dot    { background: #ef4444; }

/* Body */
.imf-cg-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.imf-cg-h3 { font-size: 15.5px; font-weight: 700; color: #1A1A1A; line-height: 1.3; margin: 0 0 6px; }
.imf-cg-p { font-size: 13px; color: #666; line-height: 1.5; margin: 0 0 10px; flex: 1; }

/* Specs */
.imf-cg-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.imf-cg-specs span { font-size: 11px; color: #888; background: #F5F5F5; padding: 2px 8px; border-radius: 4px; }

/* Actions — siempre visibles */
.imf-cg-actions {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  opacity: 1; pointer-events: auto;
}

.imf-cg-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-cg-btn-cotizar:hover { background: #c73d12; }

.imf-cg-btn-cotizar.loading { opacity: .7; pointer-events: none; }
.imf-cg-btn-cotizar.added { background: #16a34a; pointer-events: none; }
.imf-cg-btn-cotizar.added:hover { background: #16a34a; }

.imf-cg-btn-txt    { display: inline-flex; align-items: center; gap: 6px; }
.imf-cg-btn-added  { display: none; align-items: center; gap: 6px; }
.imf-cg-btn-cotizar.added .imf-cg-btn-txt   { display: none; }
.imf-cg-btn-cotizar.added .imf-cg-btn-added { display: inline-flex; }

.imf-cg-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-cg-btn-ver:hover { border-color: #1A1A1A; }
.imf-cg-btn-ver svg   { width: 16px; height: 16px; }

/* ── Empty state ───────────────────────────────────────────────────── */
.imf-cg-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-cg-empty svg { width: 36px; height: 36px; color: #BBBBBB; }
.imf-cg-empty p { font-size: 15px; color: #888; margin: 0; }
.imf-cg-empty-sub { font-size: 13.5px !important; }
.imf-cg-empty a { font-size: 13px; font-weight: 600; color: #E94E1B !important; text-decoration: none !important; }
.imf-cg-empty a:hover { text-decoration: underline !important; }

/* ── Paginación ────────────────────────────────────────────────────── */
.imf-cg-pagination {
  margin-top: 40px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap;
}
.imf-cg-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: #1A1A1A;
  background: #fff; border: 1px solid #E5E5E5;
  text-decoration: none !important; transition: border-color .2s;
}
.imf-cg-pagination .page-numbers:hover { border-color: #1A1A1A; }
.imf-cg-pagination .page-numbers.current { background: #1A1A1A; border-color: #1A1A1A; color: #fff; }
.imf-cg-pagination .page-numbers.dots { border: none; background: none; }

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

@media (max-width: 767px) {
  .imf-cg-grid { grid-template-columns: 1fr; gap: 10px; }

  .imf-cg-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    grid-template-rows: auto 1fr;
  }

  .imf-cg-imgwrap { grid-column: 1; grid-row: 1 / 3; margin: 10px; aspect-ratio: 1 / 1; }
  .imf-cg-meta { grid-column: 2; grid-row: 1; padding: 12px 12px 0 6px; }
  .imf-cg-body { grid-column: 2; grid-row: 2; padding: 6px 12px 12px 6px; }

  .imf-cg-p     { display: none; }
  .imf-cg-specs { display: none; }
  .imf-cg-h3    { font-size: 14px; margin-bottom: 10px; }

  .imf-cg-actions     { opacity: 1; pointer-events: auto; gap: 6px; }
  .imf-cg-btn-cotizar { font-size: 12px; height: 36px; }
  .imf-cg-btn-ver     { width: 36px; height: 36px; }

  .imf-cg-badge { top: 8px; right: 8px; }
  .imf-cg-stock { font-size: 9px; padding: 2px 6px; }

  .imf-cg-pagination .page-numbers { width: 34px; height: 34px; font-size: 13px; }
}
