/* Grid wrapper for all publication cards */
.publicaciones-grid {
  display: grid;
  grid-template-columns: 1fr; /* Desktop: single card per row */
  gap: 2rem;
  padding: 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card base - Desktop: horizontal */
.card-publicacion {
  display: grid;
  grid-template-columns: 1fr 2fr;
  background: white;
  border-radius: 4px;
  overflow: hidden;
  font-family: 'Open Sans', sans-serif;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  min-height: 240px;
}

.card-image {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 100%;
}

.estado-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.estado-en-venta { background-color: #0077cc; }
.estado-en-alquiler { background-color: #cc7700; }
.estado-alquiler-temporario { background-color: #28a745; }
.estado-vendida { background-color: #dc3545; }
.estado-alquilada { background-color: #6c757d; }

.card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.head-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.head-container h2 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  color: #222;
}

.inner-location {
  font-size: 1rem;
  color: #666;
}

.details {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}

.detail-container {
  display: flex;
  align-items: center;
}

.details--inner {
  font-size: 0.95rem;
  color: #333;
}

.details--inner sup {
  font-size: 0.7rem;
}

.description {
  font-size: 0.8rem;
  margin-top: 1rem;
  color: #444;
  text-align: left;
}

.banos-s {
  display: inline;
}

.card-footer {
  margin-top: 1rem;
}

.ver-publicacion-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  background-color: #415A77;
  color: white;
  font-weight: bold;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.ver-publicacion-link:hover {
  background-color: #0077cc;
}

.load-more {
  background-color: #415A77;
  color: #fff;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  margin: 2rem auto;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.load-more:hover {
  background-color: #324B64;
  transform: scale(1.03);
}

.load-more:active {
  transform: scale(0.97);
  background-color: #2a3f55;
}

.load-more:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.spinner {
  border: 3px solid #fff;
  border-top: 3px solid #324B64;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  margin-left: 10px;
  display: inline-block;
  vertical-align: middle;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}







.details--inner::before {
  display: inline-block;
  margin-right: 0.5rem;
  width: 24px;
  height: 24px;
  content: "";
  background-size: contain; /* ← Important */
  background-repeat: no-repeat; /* ← Important */
  background-position: center; /* ← Optional but helpful */
  vertical-align: middle;
}


.details--inner-metros::before {
  background-image: url(https://img.icons8.com/?size=24&id=16620&format=png&color=111111);
}

.details--inner-ambientes::before {
  background-image: url(https://img.icons8.com/?size=24&id=dwkgUg0VMRUt&format=png&color=111111);
}

.details--inner-dormitorios::before {
  background-image: url(https://img.icons8.com/?size=24&id=7546&format=png&color=111111);
}

.details--inner-bano::before {
  background-image: url(https://img.icons8.com/?size=24&id=9141&format=png&color=111111);
}

.details--inner-cochera::before {
  background-image: url(https://img.icons8.com/?size=24&id=1625&format=png&color=111111);
}

.card-image {
  position: relative;
  overflow: hidden;
}

.card-image-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 4s ease-in-out;
}

.card-publicacion:hover .card-image-inner {
  transform: scale(1.1); /* slight zoom */
}



/* Tablet view: 2 columns, vertical card layout */
@media (max-width: 1199px) {

  .card-publicacion {
    grid-template-columns: 1fr;
  }

  .card-image {
    min-height: 200px;
  }
}

/* Mobile view: 1 column, vertical card layout */
@media (max-width: 767px) {
    
  .details {
      justify-content: space-around;
  }
    
  .head-container {
      display: block;
  }
  
  .publicaciones-grid {
    grid-template-columns: 1fr;
  }

  .card-publicacion {
    grid-template-columns: 1fr;
  }

  .card-image {
    min-height: 200px;
  }
}
