/* ============================================================
   MARKETPLACE INMOBILIARIO — Estilos compartidos
   Identidad: vibrante, amarillo + azul, tipo Mercado Libre
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --azul: #1547E0;
  --azul-oscuro: #0F2F9E;
  --menta: #3ED9A3;
  --menta-clara: #B7F5DF;
  --fondo: #F7F9FC;
  --texto: #16213A;
  --texto-gris: #667085;
  --verde: #1E8E5A;
  --rojo: #FF4D4D;
  --blanco: #FFFFFF;
  /* alias para no romper el código existente */
  --amarillo: var(--menta);
  --amarillo-claro: var(--menta-clara);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  font-size: 16px;
}

a { text-decoration: none; color: inherit; }

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--azul-oscuro);
  color: #fff;
  padding: 8px 24px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

/* ---------- Encabezado / navegación ---------- */
.navbar {
  background: var(--blanco);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
  gap: 10px;
}
.navbar .logo {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 21px;
  color: var(--azul);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.navbar .logo img { height: 34px; width: auto; }
.navbar .logo span { color: var(--menta); }
.navbar nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.navbar nav a { font-size: 15px; font-weight: 600; color: var(--texto); }

@media (max-width: 640px) {
  .navbar { padding: 12px 16px; gap: 12px 16px; }
  .navbar .logo { font-size: 18px; }
  .navbar .logo img { height: 28px; }
  .navbar nav { width: 100%; justify-content: flex-start; gap: 14px 18px; }
  .navbar nav a { font-size: 14px; }
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover { background: var(--azul-oscuro); }
.btn-secundario { background: var(--menta); color: #0A3D2C; }
.btn-secundario:hover { background: var(--menta-clara); }
.btn-texto { background: none; color: var(--azul); font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  padding: 40px 24px;
  background: linear-gradient(135deg, var(--amarillo) 0%, var(--amarillo-claro) 100%);
}
.hero h1 {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 36px;
  color: var(--azul);
  line-height: 1.2;
  max-width: 620px;
}
.hero p { margin-top: 10px; font-size: 17px; color: #3A3A3A; font-weight: 500; }

.search-box {
  margin-top: 24px;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  display: flex;
  gap: 8px;
  max-width: 760px;
  box-shadow: 0 6px 0 rgba(11,59,140,.15);
  flex-wrap: wrap;
}
.search-box input, .search-box select {
  flex: 1;
  min-width: 120px;
  border: none;
  outline: none;
  padding: 15px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}
.search-box button {
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 26px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}

.boton-publicar-destacado {
  background: var(--menta);
  color: #0A3D2C;
  border: none;
  border-radius: 8px;
  padding: 15px 20px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(10,61,44,.2);
}
.boton-publicar-destacado:hover { background: var(--menta-clara); }

.pills { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: var(--azul);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 100px;
  cursor: pointer;
  border: none;
}
.pill.activa { background: var(--azul-oscuro); }

/* ---------- Listado de propiedades ---------- */
.listado { padding: 32px 24px 56px; max-width: 1200px; margin: 0 auto; }
.listado h2 {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--azul);
}
.listado .instruccion { font-size: 14px; color: var(--texto-gris); margin-bottom: 18px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  position: relative;
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card img { width: 100%; height: 150px; object-fit: contain; background: var(--fondo); display: block; }
.ribbon {
  position: absolute; top: 10px; left: 10px;
  background: var(--rojo); color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 100px;
}
.card-body { padding: 14px; }
.card .precio { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 20px; color: var(--azul); }
.card .ubicacion { font-size: 13px; color: var(--texto-gris); margin-top: 2px; }
.card .verificado { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--verde); font-weight: 700; }
.card .ver-mas { display: block; margin-top: 8px; font-size: 12px; color: var(--azul); font-weight: 700; }

.estado-vacio {
  text-align: center; padding: 60px 20px; color: var(--texto-gris);
}

/* ---------- Formularios (login/registro) ---------- */
.form-container {
  max-width: 440px;
  margin: 60px auto;
  background: #fff;
  border-radius: 14px;
  padding: 36px;
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
.form-container h1 {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--azul);
  margin-bottom: 6px;
}
.form-container p.sub { font-size: 14px; color: var(--texto-gris); margin-bottom: 24px; }
.campo { margin-bottom: 16px; }
.campo label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.campo input, .campo select, .campo textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #E4E4E4;
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--azul); }
.form-container .btn { width: 100%; padding: 14px; font-size: 15px; margin-top: 6px; }
.mensaje-error {
  background: #FFECEC; color: #C0392B; padding: 12px 14px;
  border-radius: 8px; font-size: 14px; margin-bottom: 16px; display: none;
}
.mensaje-exito {
  background: #E9F9F0; color: var(--verde); padding: 12px 14px;
  border-radius: 8px; font-size: 14px; margin-bottom: 16px; display: none;
}
.form-footer { text-align: center; margin-top: 18px; font-size: 14px; color: var(--texto-gris); }
.form-footer a { color: var(--azul); font-weight: 700; }
.cambiar-modo {
  background: #EEF3FF; border: 1.5px dashed var(--azul);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 22px;
  font-size: 14px; text-align: center; color: var(--azul-oscuro);
}
.cambiar-modo a { color: var(--azul); font-weight: 800; text-decoration: underline; }
.campo-password { position: relative; }
.campo-password input { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 12px; top: 38px; background: none; border: none;
  cursor: pointer; font-size: 18px; color: #888;
}

footer {
  background: var(--azul-oscuro);
  color: #cbd5ee;
  padding: 24px;
  text-align: center;
  font-size: 12px;
}

/* ---------- Pin personalizado de KasaJal en los mapas ---------- */
.pin-kasajal {
  background: #fff;
  border-radius: 50%;
  border: 3px solid var(--azul);
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
  padding: 3px;
  object-fit: contain;
}

/* ---------- Pin de precio en el mapa general de propiedades ---------- */
.pin-precio { background: none; border: none; cursor: pointer; }
.pin-precio-globo {
  background: var(--azul, #0B3B8C);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 100px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,.25);
  transform: translate(-50%, -100%);
}
.pin-precio-punta {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--azul, #0B3B8C);
  transform: translate(-50%, -100%);
}
.pin-precio:hover .pin-precio-globo { background: var(--verde, #16A085); }

/* ---------- Pin con logo de KasaJal + precio (mapa general) ---------- */
.pin-kasajal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
  cursor: pointer;
}
.pin-kasajal-logo {
  width: 34px; height: 34px;
  background: #fff;
  border: 3px solid var(--azul, #0B3B8C);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
  overflow: hidden;
  margin-bottom: 3px;
  flex-shrink: 0;
}
.pin-kasajal-logo img { width: 24px; height: 24px; object-fit: contain; }
.pin-kasajal-precio {
  background: var(--azul, #0B3B8C);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 100px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.pin-kasajal-punta {
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--azul, #0B3B8C);
  margin-top: -1px;
}
.pin-kasajal-wrap:hover .pin-kasajal-precio,
.pin-kasajal-wrap:hover .pin-kasajal-punta { border-top-color: var(--verde, #16A085); background: var(--verde, #16A085); }

/* ---------- Pin de casa con logo: mapa grande de propiedades ---------- */
.pin-casa-contenedor {
  width: 108px !important;
  height: 104px !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.pin-casa-kasajal {
  position: relative;
  width: 108px;
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3));
}
.pin-casa-techo {
  width: 0;
  height: 0;
  border-right: 36px solid transparent;
  border-bottom: 31px solid var(--azul, #0B3B8C);
  border-left: 36px solid transparent;
  margin-bottom: -2px;
}
.pin-casa-cuerpo {
  width: 58px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--azul, #0B3B8C);
  border-radius: 4px 4px 8px 8px;
  background: #fff;
}
.pin-casa-cuerpo img {
  width: 32px;
  height: 28px;
  object-fit: contain;
}
.pin-casa-etiqueta {
  margin-top: 4px;
  padding: 4px 9px;
  border-radius: 100px;
  background: var(--verde, #16A085);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.pin-casa-punta {
  width: 0;
  height: 0;
  border-top: 8px solid var(--verde, #16A085);
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
}
.pin-casa-kasajal:hover .pin-casa-techo { border-bottom-color: var(--verde, #16A085); }
.pin-casa-kasajal:hover .pin-casa-cuerpo { border-color: var(--verde, #16A085); }
.pin-casa-kasajal:hover .pin-casa-etiqueta,
.pin-casa-kasajal:hover .pin-casa-punta { background: var(--azul, #0B3B8C); border-top-color: var(--azul, #0B3B8C); }

/* ---------- Toggle Lista / Mapa ---------- */
.toggle-vista {
  display: inline-flex;
  background: #EEF1F6;
  border-radius: 100px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}
.toggle-vista button {
  border: none;
  background: none;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #667085;
  cursor: pointer;
}
.toggle-vista button.activo {
  background: #fff;
  color: var(--azul, #0B3B8C);
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.aviso-acceso-mapa {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 620px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #D6E2F4;
  border-radius: 11px;
  background: #F2F7FF;
  color: var(--azul, #0B3B8C);
  font-size: 13px;
  line-height: 1.5;
}
.aviso-acceso-mapa > span { font-size: 19px; }
.aviso-acceso-mapa a { color: var(--verde, #16A085); font-weight: 800; }
/* ---------- Mapa general a pantalla grande ---------- */
body.mapa-abierto { overflow: hidden; }
.mapa-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  padding: 22px;
  background: rgba(7, 24, 45, .72);
  backdrop-filter: blur(5px);
}
.mapa-modal[hidden] { display: none; }
.mapa-modal-contenido {
  width: min(1420px, 100%);
  height: min(900px, calc(100dvh - 44px));
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 90px rgba(0, 0, 0, .42);
}
.mapa-modal-cabecera {
  min-height: 100px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #E6EAF0;
}
.mapa-modal-eyebrow {
  margin: 0 0 4px;
  color: var(--verde, #16A085);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}
.mapa-modal-cabecera h2 {
  margin: 0;
  color: var(--azul, #0B3B8C);
  font-family: 'Sora', sans-serif;
  font-size: 20px;
}
.mapa-modal-cabecera p:not(.mapa-modal-eyebrow) {
  margin: 4px 0 0;
  color: var(--texto-gris, #667085);
  font-size: 13px;
}
#btn-cerrar-mapa {
  flex: 0 0 auto;
  border: 1px solid #D8E0EA;
  border-radius: 9px;
  padding: 10px 14px;
  background: #fff;
  color: var(--azul, #0B3B8C);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
#btn-cerrar-mapa:hover { background: #EEF3FF; }
#mapa-general {
  width: 100%;
  height: calc(100% - 100px);
  z-index: 1;
}
.mapa-sin-coordenadas {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(360px, calc(100% - 44px));
  margin: 0;
  padding: 16px 18px;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  color: var(--azul, #0B3B8C);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.mapa-modal-contenido { position: relative; }
.popup-mapa { min-width: 190px; }
.popup-mapa img {
  display: block;
  width: 100%;
  height: 100px;
  margin-bottom: 9px;
  border-radius: 7px;
  object-fit: cover;
}
.popup-mapa strong { display: block; color: var(--azul, #0B3B8C); font-size: 13px; line-height: 1.3; }
.popup-mapa p { margin: 4px 0 9px; color: #667085; font-size: 12px; }
.popup-mapa a { color: var(--verde, #16A085); font-size: 12px; font-weight: 800; text-decoration: none; }

@media (max-width: 600px) {
  .mapa-modal { padding: 0; }
  .mapa-modal-contenido { height: 100dvh; border-radius: 0; }
  .mapa-modal-cabecera { min-height: 92px; padding: 14px 16px; }
  .mapa-modal-cabecera h2 { font-size: 16px; }
  #btn-cerrar-mapa { padding: 9px 10px; }
  #btn-cerrar-mapa span { display: none; }
  #mapa-general { height: calc(100% - 92px); }
}
