:root {
  --color-primary: #295d6b;
  --color-primary-dark: #1b3e48;
  --color-accent: #ed956f;
  --color-whatsapp: #25d366;
  --color-bg-soft: #f6f8fa;
  --radius: .6rem;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #212529;
  background-color: #fff;
}

a { color: inherit; }

.text-primary { color: var(--color-primary) !important; }
.bg-primary { background-color: var(--color-primary) !important; }
.bg-accent { background-color: var(--color-accent) !important; }
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}
.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline-primary:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.navbar-brand { font-size: 1.35rem; padding-top: 0; padding-bottom: 0; }
.header-logo { height: 52px; width: auto; display: block; }
.footer-logo {
  height: 60px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: .5rem;
  padding: .5rem .75rem;
}

.nav-link {
  font-weight: 500;
  color: #33465c;
}
.nav-link:hover { color: var(--color-primary); }

/* Buscar y perfil: siempre visibles, sin menú hamburguesa. */
.navbar-acciones {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
}
.navbar-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #33465c;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.navbar-accion:hover { background: var(--color-bg-soft); color: var(--color-primary); }
.navbar-accion svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.navbar-accion-perfil::after { display: none; }  /* sin la flechita del dropdown */

@media (min-width: 992px) {
  /* En escritorio el menú ya ocupa el centro; las acciones no empujan. */
  .navbar-acciones { margin-left: .5rem; }
}

/* --- Hero / buscador --- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 4.5rem 0 6rem;
}
.hero h1 { font-weight: 700; }
.hero-subtitulo { color: rgba(255,255,255,.85); }

.buscador-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1rem 3rem rgba(0,0,0,.15);
  padding: 1.5rem;
  margin-top: -3.5rem;
  position: relative;
  z-index: 2;
}

/* --- Tarjetas de inmuebles --- */
.tarjeta-inmueble {
  border: 1px solid #e9ecef;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tarjeta-inmueble:hover {
  transform: translateY(-4px);
  box-shadow: 0 .75rem 1.5rem rgba(20,50,74,.12);
}
.tarjeta-imagen {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: #e9ecef;
  overflow: hidden;
}
.tarjeta-imagen .card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tarjeta-imagen-vacia {
  width: 100%;
  height: 100%;
}
.badge-operacion {
  position: absolute;
  top: .6rem;
  left: .6rem;
}
/* Debajo del badge de operación: la esquina superior derecha la ocupa
   ahora el corazón de "guardar propiedad". */
.badge-estado {
  position: absolute;
  top: 2.6rem;
  left: .6rem;
}
.caracteristicas li:not(:last-child)::after {
  content: "•";
  margin-left: .5rem;
  color: #adb5bd;
}

/* --- Banner de Reels (home) --- */
.reels-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(115deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 .6rem 1.5rem rgba(237, 149, 111, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.reels-banner:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 .9rem 2rem rgba(237, 149, 111, .4);
}
.reels-banner-play {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: reels-pulso 2s ease-in-out infinite;
}
@keyframes reels-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); }
  50% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}
.reels-banner-texto {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  line-height: 1.3;
}
.reels-banner-badge {
  align-self: flex-start;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: rgba(255,255,255,.9);
  color: var(--color-primary-dark);
  border-radius: 1rem;
  padding: .1rem .5rem;
  margin-bottom: .3rem;
}
.reels-banner-texto strong {
  font-size: 1.05rem;
}
.reels-banner-sub {
  font-size: .85rem;
  opacity: .92;
}
.reels-banner-flecha {
  flex-shrink: 0;
  opacity: .85;
}
@media (max-width: 575.98px) {
  .reels-banner-sub { display: none; }
}
/* En móvil el acceso a los Reels ya está en la barra inferior ("Mira Aquí"),
   así que el banner del home sobra y solo ocupa espacio. */
@media (max-width: 768px) {
  .reels-banner { display: none; }
}

/* --- Sección destacados / sobre nosotros --- */
.seccion { padding: 4rem 0; }
.seccion-alt { background-color: var(--color-bg-soft); }

/* --- Filtros de listado --- */
.filtros-card {
  border-radius: var(--radius);
  border: 1px solid #e9ecef;
}


/* --- Botón flotante WhatsApp --- */
.whatsapp-flotante {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 56px;
  height: 56px;
  background-color: var(--color-whatsapp);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.25);
  z-index: 1030;
  transition: transform .15s ease;
}
.whatsapp-flotante:hover { transform: scale(1.08); color: #fff; }

/* --- Footer --- */
.footer-site {
  background-color: var(--color-primary-dark);
}
.footer-links a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  display: inline-block;
  padding: .15rem 0;
}
.footer-links a:hover { color: #fff; }
.text-light-50 { color: rgba(255,255,255,.6); }
.footer-social {
  color: rgba(255,255,255,.8);
  display: inline-flex;
}
.footer-social:hover { color: #fff; }
.footer-bottom {
  background-color: #081521;
  color: rgba(255,255,255,.55);
}

/* ==========================================================================
   Cuentas: login, registro, perfil, favoritos y agenda de visitas
   ========================================================================== */

/* --- Tarjeta de las pantallas de cuenta --- */
.tarjeta-cuenta {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: var(--radius);
  box-shadow: 0 .5rem 2rem rgba(0,0,0,.06);
  padding: 2rem;
}

.icono-estado {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  line-height: 1;
}
.icono-estado-ok { background: rgba(41,93,107,.1); color: var(--color-primary); }
.icono-estado-alerta { background: rgba(237,149,111,.18); color: #c76a41; }

/* Separador "o con tu correo" entre el botón de Google y el formulario */
.separador-o {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #adb5bd;
  font-size: .85rem;
}
.separador-o::before,
.separador-o::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e9ecef;
}

/* --- Botón de Google --- */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  background: #fff;
  border: 1px solid #dadce0;
  color: #3c4043;
  font-weight: 500;
  padding: .625rem 1rem;
  border-radius: var(--radius);
  transition: background-color .15s ease, box-shadow .15s ease;
}
.btn-google:hover:not(:disabled) {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60,64,67,.2);
}
.btn-google:disabled { opacity: .6; }

/* --- Avatar en el header --- */
.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e9ecef;
}
.header-avatar-iniciales {
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 600;
  border: none;
}

/* --- Corazón de favoritos --- */
.btn-favorito {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: rgba(255,255,255,.92);
  border: 1px solid #e9ecef;
  border-radius: 50rem;
  color: #6c757d;
  padding: .5rem;
  line-height: 0;
  cursor: pointer;
  transition: color .15s ease, transform .15s ease, background-color .15s ease;
}
.btn-favorito svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.btn-favorito:hover { color: #e0245e; transform: scale(1.08); }
.btn-favorito.es-favorito { color: #e0245e; }
.btn-favorito.es-favorito svg { fill: #e0245e; }

/* Rebote al guardar o quitar, para que el clic se sienta */
.btn-favorito.late svg { animation: latido .35s ease; }
@keyframes latido {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Sobre la foto, en las tarjetas del listado. El corazón es hermano del
   enlace de la tarjeta (no va dentro), así que se posiciona contra esta
   envoltura. */
.tarjeta-envoltura {
  position: relative;
  height: 100%;
}
.btn-favorito-flotante {
  position: absolute;
  top: .625rem;
  right: .625rem;
  z-index: 3;
  box-shadow: 0 .125rem .5rem rgba(0,0,0,.15);
}

/* Ancho completo, en la barra lateral del detalle */
.btn-favorito-ancho {
  width: 100%;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  line-height: 1.5;
  font-weight: 500;
}
.btn-favorito-texto { line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  .btn-favorito,
  .btn-favorito.late svg { transition: none; animation: none; }
}

/* --- Perfil --- */
.perfil-encabezado {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.perfil-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.perfil-avatar-iniciales {
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
}

.estado-vacio {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-bg-soft);
  border-radius: var(--radius);
}

/* Miniaturas de los videos guardados */
.video-guardado {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #000;
}
.video-guardado video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-guardado-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  text-shadow: 0 .125rem .5rem rgba(0,0,0,.5);
}
.video-guardado-titulo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem .75rem .625rem;
  color: #fff;
  font-size: .8rem;
  line-height: 1.3;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}

/* --- Citas --- */
.tarjeta-cita,
.resumen-cita {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid #e9ecef;
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff;
  height: 100%;
}
.cita-fecha,
.resumen-cita-fecha {
  flex-shrink: 0;
  width: 62px;
  text-align: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  padding: .5rem .25rem;
}
.cita-dia {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.cita-mes {
  display: block;
  font-size: .7rem;
  letter-spacing: .08em;
  opacity: .85;
}
.cita-hora {
  font-weight: 600;
  color: var(--color-primary);
  text-transform: capitalize;
}
.resumen-cita { background: var(--color-bg-soft); }

/* ==========================================================================
   Barra de navegación inferior (solo móvil)
   ========================================================================== */

/* Oculta por defecto: en escritorio manda el header de arriba. */
.bottom-nav { display: none; }

@media (max-width: 768px) {

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;               /* por encima del botón flotante de WhatsApp */
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    background: #fff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -.25rem 1rem rgba(0,0,0,.07);
    /* El padding extra de abajo respeta el indicador de inicio del iPhone. */
    padding: .5rem 0 calc(.4rem + env(safe-area-inset-bottom));
  }

  .bottom-nav-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .1rem .25rem;
    color: #6c757d;              /* gris de la sección inactiva */
    font-size: .68rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: color .15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Sección activa, en el color de marca */
  .bottom-nav-item.activo { color: var(--color-primary); }
  .bottom-nav-item.activo svg { stroke-width: 2.1; }

  /* Puntito sobre el corazón cuando hay propiedades guardadas */
  .bottom-nav-punto {
    position: absolute;
    top: .1rem;
    left: 50%;
    margin-left: .35rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 1.5px solid #fff;
  }

  /* --- Botón central "Mira Aquí" ---
     Es el CTA principal de la barra: sobresale por encima del borde superior
     y mantiene el círculo de color esté activo o no. */
  .bottom-nav-destacado {
    color: #c76a41;              /* naranja de marca, oscurecido para que el texto se lea */
    font-weight: 600;
  }

  .bottom-nav-circulo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: -22px;           /* lo saca por encima de la barra */
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid #fff;
    box-shadow: 0 .35rem .9rem rgba(237,149,111,.55);
    transition: transform .15s ease;
  }

  .bottom-nav-circulo svg {
    width: 24px;
    height: 24px;
    margin-left: 2px;            /* centra ópticamente el triángulo de play */
    fill: #fff;
    stroke: none;
  }

  .bottom-nav-destacado:active .bottom-nav-circulo { transform: scale(.93); }

  /* Deja aire al final de la página para que la barra no tape el contenido
     ni el footer. */
  body { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); }

  /* El botón flotante de WhatsApp sube para no quedar debajo de la barra. */
  .whatsapp-flotante {
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bottom-nav-item,
  .bottom-nav-circulo { transition: none; }
}
