/* ============================================================
   cards.css — Lokal
   Tarjetas de publicaciones, grid, estados y botones de acción
   ============================================================ */


/* ════════════════════════════════════════
   SECCIÓN ARTÍCULOS + GRID
   ════════════════════════════════════════ */

.articulos-section {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.articulos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.articulos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}


/* ════════════════════════════════════════
   TARJETA
   ════════════════════════════════════════ */

.card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: all 0.25s;
  cursor: pointer;
  border: 1px solid rgba(45,106,79,0.08);
  animation: fadeUp 0.5s ease both;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(45,106,79,0.18);
}

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

/* Imagen */
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--crema-oscura), var(--crema));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
}

/* Botón Favorito ❤️ */
.btn-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 5;
  padding: 0;
}

.btn-fav:hover {
  transform: scale(1.15);
  background: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-fav.active {
  background: white;
  border-color: #fee2e2;
}

.btn-fav:active {
  transform: scale(0.9);
}


/* Cuerpo */
.card-body {
  padding: 14px 16px 16px;
}

.card-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--verde-claro);
  margin-bottom: 4px;
}

.card-title {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--cafe);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-desc {
  font-size: 13px;
  color: var(--gris);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-ubicacion {
  font-size: 11px;
  color: var(--gris);
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

/* Footer */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-precio {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--verde);
}

.card-precio span {
  font-size: 13px;
  font-weight: 400;
  color: var(--gris);
  font-family: 'DM Sans', sans-serif;
}

/* Vendedor */
.card-vendedor {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.vendedor-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--verde);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.vendedor-nombre {
  font-size: 12px;
  color: var(--gris);
}


/* ════════════════════════════════════════
   BOTONES DE ACCIÓN EN CARD
   ════════════════════════════════════════ */

.card-footer-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-footer-btns .btn-reportar,
.card-footer-btns .btn-wa,
.card-footer-btns .btn-eliminar-pub {
  flex: 1;
  min-width: 70px;
}

@media (max-width: 360px) {
  .card-footer-btns .btn-reportar,
  .card-footer-btns .btn-wa,
  .card-footer-btns .btn-eliminar-pub {
    font-size: 11px;
    padding: 7px 6px;
  }
}

/* WhatsApp */
.btn-wa {
  background: #25D366;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
  flex: 1;
}

.btn-wa:hover { background: #1ebe5d; transform: scale(1.05); }

/* Eliminar */
.btn-eliminar-pub {
  background: #fff0f0;
  color: #c53030;
  border: 1.5px solid #fca5a5;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-eliminar-pub:hover { background: #fee2e2; border-color: #c53030; }

/* Reportar */
.btn-reportar {
  background: white;
  border: 2px solid #fca5a5;
  cursor: pointer;
  color: #c53030;
  padding: 7px 10px;
  border-radius: 10px;
  transition: all 0.15s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 12px;
  flex: 1;
}

.btn-reportar::before { content: '🚩'; font-size: 13px; }
.btn-reportar:hover { background: #fff0f0; border-color: #c53030; transform: scale(1.03); }
.btn-reportar.reportado { background: #fff0f0; border-color: #c53030; color: #c53030; }


/* ════════════════════════════════════════
   ESTADO VACÍO (sin resultados)
   ════════════════════════════════════════ */

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gris);
}

.empty-icon { font-size: 56px; margin-bottom: 16px; }

.empty h3 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--cafe);
  margin-bottom: 8px;
}


/* ════════════════════════════════════════
   BADGE IA
   ════════════════════════════════════════ */

.badge-ia {
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}


/* ════════════════════════════════════════
   SPINNER DE CARGA
   ════════════════════════════════════════ */

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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