/* ====== BASE CARD GÉNÉRIQUE ====== */

.card {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Compatibilité avec l’ancien HTML (thumb/body/title…) */
.thumb {
  height: 180px;
  background: rgba(255, 255, 255, .02);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.body {
  padding: 12px;
}

.title {
  margin: 0 0 6px;
  font-weight: 800;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.price {
  font-weight: 900;
  color: var(--text);
}

/* ====== NOUVELLE STRUCTURE DE CARTE (listes & propriétés) ====== */

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  /* ratio standard */
  overflow: hidden;
  background: rgba(15, 23, 42, .04);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.card-link:hover .card-media img {
  transform: scale(1.03);
}

.card-body {
  padding: 10px 10px 12px;
}

.card-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
}

.card-text {
  margin: 4px 0 0;
  font-size: 13px;
}

/* Badges / pills (prix, ville, type) */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  background: rgba(148, 163, 184, .08);
}

.pill-strong {
  background: rgba(37, 99, 235, .12);
  font-weight: 800;
}

.pill-soft {
  background: rgba(15, 23, 42, .03);
}

/* =========================
   HOME HERO – أحدث العروض
   ========================= */

/* Grille des 3 cartes dans le bloc blanc */
.hero-card #latestGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .hero-card #latestGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hero-card #latestGrid {
    grid-template-columns: 1fr;
  }
}

/* Carte dans le bloc "أحدث العروض" */
.hero-card #latestGrid .card {
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Ratio fixe pour l’image dans le hero (4:3) */
.hero-card #latestGrid .card-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

/* Image du hero */
.hero-card #latestGrid .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-card #latestGrid .card-body {
  padding: 10px 10px 12px;
}

.hero-card #latestGrid .card-title {
  margin: 0 0 6px;
  font-size: 15px;
}

.hero-card #latestGrid .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}