/* ============================
   GRILLE DES CARTES
============================ */
.cats-wrapper {
  max-width: 1100px;
  margin: 30px auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 COLONNES MAX SUR PC */
  gap: 30px;
}

/* ============================
   CARTE
============================ */
.cat-card-rect {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  font-family: system-ui, sans-serif;
  display: flex;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.cat-card-rect img {
  width: 180px;
  height: 240px;
  object-fit: cover;
  border-radius: 14px;
}

.cat-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cat-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.cat-card-description {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.45;
  margin-bottom: 6px;
  max-height: 85px;
  overflow: hidden;
  position: relative;
}

.cat-card-description:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 30px;
  width: 100%;
  background: linear-gradient(to bottom, transparent, #fff);
}

.btn-small {
  border: none;
  background: transparent;
  color: #777;
  font-size: 0.8rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  margin-bottom: 10px;
}

.cat-card-info {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.cat-card-info span {
  font-weight: 600;
}

.cat-card-status {
  margin-top: 8px;
  font-weight: 700;
}

/* états */
.cat-card-status.etat-disponible { color: #1b8a3a; }
.cat-card-status.etat-vendu { color: #c0392b; }
.cat-card-status.etat-attente { color: #f1c40f; }
.cat-card-status.etat-ancien { color: #c0392b; }

/* Bouton */
.cat-card-button {
  margin-top: auto;
  text-align: right;
}

.cat-card-button a {
  background: #c27a3a;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: 0.15s ease;
  white-space: nowrap;
}

.cat-card-button a:hover {
  background: #a9652f;
  transform: translateY(-1px);
}

/* ============================
   COUPLES
============================ */
.couple-card {
  align-items: stretch;
}

.couple-card .couple-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.couple-card .couple-images img {
  width: 180px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
}

/* ============================
   POPUP
============================ */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup-content {
  background: #fff;
  max-width: 480px;
  width: 90%;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font-family: system-ui, sans-serif;
}

.popup-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.popup-text {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 14px;
}

.popup-close {
  text-align: right;
}

.popup-close button {
  background: #c27a3a;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ============================
   MOBILE FIX (DÉFINITIF)
============================ */
@media (max-width: 600px) {

  /* On neutralise les marges du thème */
  .entry-content,
  .wp-block-group,
  .wp-block-post-content,
  .site-content,
  .content-area,
  .container,
  .content,
  .page-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Wrapper */
  .cats-wrapper {
    grid-template-columns: 1fr !important; /* 1 COLONNE SUR MOBILE */
    padding: 0 10px !important;
    width: 100% !important;
  }

  /* Carte */
  .cat-card-rect {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px !important;
    gap: 14px !important;
  }

  .cat-card-rect img {
    width: 100% !important;
    height: auto !important;
    max-height: 260px !important;
    object-fit: cover !important;
  }

  .cat-card-body {
    width: 100% !important;
  }

  .cat-card-button {
    text-align: center !important;
    margin-top: 15px !important;
  }
}
