/* ═══════════════════════════════════════════════
   Dale Catálogo v2 - Estilo Marketplace
   Móvil 2 columnas / PC 3-4 columnas
   ═══════════════════════════════════════════════ */

/* ─── Barra de búsqueda sticky (queda fija al hacer scroll) ─── */
.cat-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  padding: 12px 16px;
  border-bottom: 1px solid #E5E7EB;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cat-search-form {
  display: flex;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
}

.cat-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.cat-search-icono {
  position: absolute;
  left: 14px;
  font-size: 15px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}
.cat-search-icono svg {
  width: 17px;
  height: 17px;
  fill: #9CA3AF;
}

.cat-search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid #E5E7EB;
  border-radius: 999px;
  font-size: 14px;
  background: #F9FAFB;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.cat-search-input:focus {
  border-color: #0F6E56;
  background: white;
}

.cat-btn-filtrar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  background: #1F2937;
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.cat-btn-filtrar:hover { background: #993C1D; }

.cat-filtro-activo-dot {
  width: 8px;
  height: 8px;
  background: #BA7517;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 8px;
  border: 2px solid #1F2937;
}

/* ─── Barra de resultados ─── */
.cat-resultados-barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px 8px;
  font-size: 14px;
  color: #6B7280;
}

.cat-resultados-barra strong { color: #1F2937; font-size: 16px; }

.cat-orden-select {
  padding: 7px 10px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 13px;
  background: white;
  color: #374151;
  outline: none;
}

/* ─── GRILLA DE AUTOS ─── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);  /* móvil: 2 columnas */
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

@media (min-width: 700px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 1000px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─── TARJETA DE AUTO ─── */
.cat-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease, border-color .2s;
  animation: catCardIn .5s cubic-bezier(.2,.8,.2,1) backwards;
}

.cat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(17,24,39,0.18);
  border-color: #E7D6CE;
}

@keyframes catCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cat-card:nth-child(1){animation-delay:.02s}
.cat-card:nth-child(2){animation-delay:.06s}
.cat-card:nth-child(3){animation-delay:.10s}
.cat-card:nth-child(4){animation-delay:.14s}
.cat-card:nth-child(5){animation-delay:.18s}
.cat-card:nth-child(6){animation-delay:.22s}
.cat-card:nth-child(7){animation-delay:.26s}
.cat-card:nth-child(8){animation-delay:.30s}

.cat-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #F3F4F6;
  overflow: hidden;
}

.cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.cat-card:hover .cat-card-img img { transform: scale(1.07); }

.cat-card-img.sin-foto {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-card-img.sin-foto::after {
  content: "Sin foto";
  font-size: 13px;
  color: #9CA3AF;
  font-weight: 600;
}

.cat-card-sinfoto {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 42px;
  opacity: 0.4;
}
.cat-card-sinfoto svg {
  width: 56px;
  height: 56px;
  fill: #9CA3AF;
}

.cat-card-badge {
  position: absolute;
  top: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cat-card-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex-shrink: 0;
}

.cat-card-badge.verificado {
  left: 8px;
  background: #0F6E56;
}

.cat-card-badge.importado {
  right: 8px;
  background: #BA7517;
}

.cat-card-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-card-precio {
  font-size: 17px;
  font-weight: 800;
  color: #1F2937;
  margin: 0;
}

.cat-card-titulo {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 2px 0 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card-meta {
  font-size: 12px;
  color: #6B7280;
  margin: 0;
}

.cat-card-ciudad {
  font-size: 12px;
  color: #9CA3AF;
  margin: 4px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cat-card-ciudad svg {
  width: 13px;
  height: 13px;
  fill: #993C1D;
  flex-shrink: 0;
}

/* ─── PANEL DE FILTROS (modal deslizable) ─── */
.cat-filtros-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s;
}

.cat-filtros-overlay.activo {
  opacity: 1;
  visibility: visible;
}

.cat-filtros-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90%;
  max-width: 380px;
  background: white;
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,0.2);
}

.cat-filtros-panel.activo {
  transform: translateX(0);
}

.cat-filtros-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}

.cat-filtros-head h3 {
  margin: 0;
  font-size: 17px;
  color: #1F2937;
}

.cat-filtros-cerrar {
  background: #F3F4F6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: #6B7280;
}

.cat-filtros-cerrar:hover { background: #E5E7EB; }

.cat-filtros-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cat-filtros-body .filtro-grupo { margin-bottom: 16px; }

.cat-filtros-body .filtro-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}

.cat-filtros-body .campo-input,
.cat-filtros-body .campo-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.cat-filtros-body .campo-input:focus,
.cat-filtros-body .campo-select:focus {
  border-color: #0F6E56;
}

.cat-filtros-body .filtro-rango {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cat-filtros-acciones {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #E5E7EB;
}

.cat-btn-limpiar {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: #F3F4F6;
  color: #374151;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.cat-btn-aplicar {
  flex: 2;
  padding: 12px;
  background: #0F6E56;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.cat-btn-aplicar:hover { background: #0c5a46; }

/* ─── Fondo del catálogo: textura de puntos sutil (coherente con paneles) ─── */
.cat-fondo {
  background-color: var(--gris-50);
  background-image: radial-gradient(rgba(153, 60, 29, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Respeta a quien prefiere menos movimiento (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
  .cat-card { animation: none; }
  .cat-card:hover { transform: none; }
  .cat-card-img img,
  .cat-card:hover .cat-card-img img { transition: none; transform: none; }
}
