/* VARIABLES DE COLOR */
:root {
  --color-verde: #23ce7c;
  --color-azul: #133d7a;
  --color-blanco: #ffffff;
  --color-texto: #133d7a;
  --color-borde: #e2e8f0;
}

/* FILTROS */
.am-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 25px;
}

.am-filters input,
.am-filters select {
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-borde);
  background: var(--color-blanco);
  font-size: 14px;
  min-width: 150px;
  color: var(--color-texto);
}

/* GRID DE CARDS — 4 columnas fijas en desktop */
.am-grid.am-grid-anuncios {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

/* CARD ANUNCIO */
.am-card {
  background: var(--color-blanco);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.05);
  transition: 0.3s;
  display: flex;
  flex-direction: column;
}

.am-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* IMAGEN DEL ANUNCIO */
.am-card img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #f0f0f0;
  border-bottom: 1px solid var(--color-borde);
}

/* PLACEHOLDER CUANDO NO HAY IMAGEN (evita depender de un archivo de assets
   que podría no existir en esta carpeta) */
.am-no-img {
  width: 100%;
  height: 200px;
  background-color: #f0f0f0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ccd3da'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 56px;
  border-bottom: 1px solid var(--color-borde);
}

/* BODY DE CARD */
.am-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.am-body h3 {
  margin: 0 0 5px;
  font-size: 18px;
  color: var(--color-azul);
}

.am-badge {
  background: var(--color-verde);
  color: var(--color-blanco);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 10px;
}

.am-body p.desc {
  font-size: 14px;
  margin: 10px 0;
  color: #555;
}

/* BOTÓN VER MÁS */
.am-body a {
  display: inline-block;
  padding: 10px 15px;
  background: var(--color-verde);
  color: var(--color-blanco);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
  margin-top: auto;
}

.am-body a:hover {
  background: var(--color-azul);
  color: var(--color-blanco);
}

/* BOTÓN CARGAR MÁS */
#ama-loadmore {
  margin: 25px auto 0;
  display: block;
  padding: 12px 25px;
  background: var(--color-verde);
  color: var(--color-blanco);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

#ama-loadmore:hover {
  background: var(--color-azul);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .am-grid.am-grid-anuncios {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .am-grid.am-grid-anuncios {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .am-grid.am-grid-anuncios {
    grid-template-columns: 1fr;
  }
}
/* ESTADO VACÍO */
.am-vacio {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
}
.am-vacio-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8faf1;
  color: #23ce7c;
}
.am-vacio-icono svg { width: 26px; height: 26px; }
.am-vacio-titulo { font-size: 18px; color: #133d7a; }
.am-vacio-texto { max-width: 460px; font-size: 15px; line-height: 1.5; color: #64748b; }
.am-vacio-btn {
  margin-top: 10px;
  padding: 11px 26px;
  border-radius: 10px;
  background: #23ce7c;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background .25s;
}
.am-vacio-btn:hover { background: #133d7a; color: #fff; }

/* Atenúa el listado mientras carga */
.am-grid.am-cargando { opacity: .55; transition: opacity .2s; }
