/* COMPONENTE BASE: CARD (Reutilizable) */
.card {
  background: var(--color-white, #ffffff);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border, #e8ecef);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

/* Áreas internas de la Card */

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: var(--font-h4, 1.15rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-title a {
  color: var(--color-text-dark, #1a202c);
  text-decoration: none;
  transition: color var(--transition-fast, 0.2s ease);
}

.card-title a:hover {
  color: var(--color-yellow, #CDAA67);
}

/* ==========================================
   TRATAMIENTO UNIFICADO DE IMÁGENES
   ========================================== */
.card img {
  max-width: 100%;
  display: block;
}

.card-media {
  position: relative;
  width: 100%;
  height: 230px;
  overflow: hidden;
  background-color: var(--color-blue, #163A43);
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-media-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* 3. Contenedor de Fotos para Equipo / Asesores */
/* Estilo Premium para Socios */
.card-asesor.is-socio .card-avatar {
  border-color: var(--color-yellow, #CDAA67);
  box-shadow: 0 4px 14px rgba(205, 170, 103, 0.3);
}

/* 4. Adaptabilidad para Pantallas Chicas (Móviles hasta 768px) */
@media (max-width: 768px) {
  .card-media {
    height: 200px; /* Reducimos ligeramente la altura en pantallas pequeñas */
  }

  .card-asesor .card-avatar {
    width: 120px;
    height: 120px;
  }
}

/* ==========================================
   FORMATEO DE IMÁGENES POR TIPO DE TARJETA
   ========================================== */

/* 1. PROPIEDADES & BLOG: Formato Rectangular Apaisado (No circular) */
.card-propiedad .card-media,
.card-blog .card-media {
  position: relative;
  width: 100%;
  height: 230px;
  overflow: hidden;
  background-color: var(--color-blue, #163A43);
  border-radius: 12px 12px 0 0;
}

/* Forzar que las fotos de las casas NUNCA se deformen */
.card-media img,
.card-media-link img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform 0.5s ease;
}
.card:hover .card-media img,
.card:hover .card-media-link img {
  transform: scale(1.05);
}
.card-media img {
  object-position: center !important;
  display: block;
}

/* Estilo para cuando no hay foto (Placeholder / Logo) */
.card-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--color-blue, #163A43);
  color: var(--color-yellow, #CDAA67);
  gap: 8px;
}

.card-media-placeholder span {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}


/* 2. EQUIPO / ASESORES: Formato Circular Exclusivo */
.card-asesor .card-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50% !important;
  margin: 25px auto 10px auto;
  overflow: hidden;
  border: 3px solid var(--color-border, #e2e8f0);
  background-color: var(--color-blue, #163A43);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.card-asesor .card-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* ==========================================
   BOTONES DE ACCIÓN PARA LA CARD DE ASESOR
   ========================================== */

.card-asesor-acciones {
  margin-top: auto;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

/* Botón Principal: WhatsApp (Fondo verde vibrante o Azul Corporativo) */
.btn-asesor-wa,
.btn-asesor-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px; /* Estilo píldora/cápsula moderna */
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast, 0.2s ease);
}

/* 1. Botón WhatsApp */
.btn-asesor-wa {
  flex: 1;
  background-color: var(--color-whatsapp, #1B5E4F);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.2);
}

.btn-asesor-wa:hover {
  background-color: var(--color-whatsapp-hover, #20ba5a);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.35);
  color: #ffffff;
}

/* 2. Botón Email */
.btn-asesor-email {
  background-color: var(--color-blue, #163A43);
  color: var(--color-white, #ffffff);
  box-shadow: 0 3px 10px rgba(22, 58, 67, 0.15);
}

.btn-asesor-email:hover {
  background-color: var(--color-yellow, #CDAA67);
  color: #163A43;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(205, 170, 103, 0.3);
}

/* Control del tamaño de los SVG inyectados */
.btn-asesor-wa svg.icon-wa,
.btn-asesor-email svg.icon-mail {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Efecto de micro-animación al presionar/pasar el cursor */
.btn-asesor-wa:hover svg {
  transform: scale(1.15) rotate(-5deg);
}

.btn-asesor-email:hover svg {
  transform: scale(1.15);
}

/* ==========================================
   AJUSTE DE IMÁGENES Y LOGO EN PROPIEDADES
   ========================================== */

/* Marco apaisado para la portada de la propiedad */


.card-propiedad .card-media-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* CASO A: Fotos reales de Inmuebles */
.card-propiedad img.img-propiedad-foto {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

/* CASO B: Logo fallback cuando la propiedad no tiene foto */
.card-propiedad .card-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: var(--color-blue, #163A43) !important;
  padding: 25px;
  box-sizing: border-box;
}

.card-propiedad img.img-propiedad-logo {
  width: auto !important;
  height: auto !important;
  max-width: 60% !important;
  max-height: 80px !important;
  object-fit: contain !important;
  display: block !important;
  margin: auto !important;
}

/* FIX DEFINITIVO TARJETAS DE PROPIEDADES */
.card-propiedad .card-media {
  position: relative;
  width: 100%;
  height: 230px !important;
  background-color: var(--color-blue, #163A43) !important;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.card-propiedad .card-media-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Fotos normales de inmuebles */
.card-propiedad img.img-propiedad-foto {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

/* Contenedor e Isotipo sin foto */
.card-propiedad .card-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: var(--color-blue, #163A43) !important;
  padding: 25px;
  box-sizing: border-box;
}

.card-propiedad img.img-propiedad-logo {
  width: auto !important;
  height: auto !important;
  max-width: 60% !important;
  max-height: 80px !important;
  object-fit: contain !important;
  display: block !important;
  margin: auto !important;
}

/* ==========================================
   ESTRUCTURA Y ESTILOS DE CARD PROPIEDAD
   ========================================== */

/* 1. Contenedor de la Tarjeta */
.card-propiedad {
  display: flex !important;
  flex-direction: column !important;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.card-propiedad:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 2. Zona Superior (Imagen y Badges) */
.card-propiedad-media {
  position: relative !important;
  width: 100% !important;
  height: 220px !important;
  overflow: hidden;
  background-color: #163A43;
}

.card-media-link {
  display: block;
  width: 100%;
  height: 100%;
}

.img-propiedad-foto {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.card-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.img-propiedad-logo {
  max-width: 60%;
  max-height: 80px;
  object-fit: contain;
}

/* 3. Posicionamiento de Badges */
.card-badges-top {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.badge-operacion, .badge-estado {
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.badge-operacion, .badge-venta {
  background-color: var(--color-yellow, #CDAA67);
}

.badge-alquiler {
  background-color: var(--color-blue, #163A43);
}

.card-badge-precio {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--color-blue);
  backdrop-filter: blur(4px);
  color: var(--color-yellow);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

/* 4. Cuerpo de la Tarjeta */
.card-propiedad-body {
  padding: 20px;
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1;
}

.card-barrio {
  font-size: 0.85rem;
  color: var(--color-text-muted, #718096);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.card-titulo {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 15px;
}

.card-titulo a {
  color: var(--color-blue, #163A43);
  text-decoration: none;
}

.card-features {
  display: flex;
  align-items: center;
  background: var(--color-bg-light, #f7fafc);
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--color-text-dark, #1a202c);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feature-divider {
  width: 1px;
  height: 18px;
  background-color: var(--color-border, #cbd5e0);
  margin: 0 15px;
}

/* 5. Botón Ver Ficha Completa */
.btn-card-detalle {
  margin-top: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  background-color: transparent;
  color: var(--color-blue);
  border: 1.5px solid var(--color-border);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-card-detalle:hover {
  background-color: var(--color-blue);
  color: var(--color-yellow);
}

/* .btn-card-detalle svg {
  transition: transform 0.2s ease;
} */

.btn-card-detalle:hover svg {
  transform: translateX(4px);
}

/* GRID DE PROPIEDADES (3 a 4 COLUMNAS) */

.contenedor-propiedades {
  max-width: 1300px;
  margin: 40px auto;
  padding: 0 20px;
}

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

/* Grilla responsive flexible */
.grid-propiedades {
  display: grid !important;
  /* Mínimo 280px por tarjeta. Cabe 4 en pantallas amplias (1400px+), 3 en pantallas normales, 2 en tablet */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 24px !important;
  margin-bottom: 40px;
}

/* ESTILOS DE PAGINACIÓN */

.paginacion-propiedades {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.paginacion-propiedades ul.page-numbers {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.paginacion-propiedades .page-numbers li a,
.paginacion-propiedades .page-numbers li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1a202c;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  background-color: #ffffff;
}

.paginacion-propiedades .page-numbers li a:hover {
  border-color: #CDAA67;
  color: #CDAA67;
  background-color: #f8fafc;
}

.paginacion-propiedades .page-numbers li span.current {
  background-color: #163A43;
  color: #ffffff;
  border-color: #163A43;
}