/* Colores principales: cambia estos valores para cambiar los colores de toda la página */
:root {
  --principal: #1f4e5f;
  --acento: #d9a441;
  --texto: #23303a;
  --gris: #f4f6f7;
  --verde-wa: #25d366;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Poppins", Arial, sans-serif; color: var(--texto); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.contenedor { width: min(1150px, 92%); margin: 0 auto; }
.oculto { position: absolute; left: -9999px; }

/* Botones */
.boton { display: inline-block; background: var(--acento); color: #fff; text-decoration: none; font-weight: 600;
  padding: .8rem 1.4rem; border-radius: 8px; border: 0; cursor: pointer; font-size: 1rem; text-align: center; transition: .2s; }
.boton:hover { filter: brightness(1.08); transform: translateY(-1px); }
.boton--blanco { background: #fff; color: var(--principal); }
.boton--chico { padding: .45rem 1rem; background: var(--verde-wa); }
.boton--ancho { display: block; width: 100%; }
.boton--apagado { background: #b8c0c5; cursor: default; }
.boton--apagado:hover { transform: none; filter: none; }

/* Barra superior */
.barra { position: sticky; top: 0; z-index: 10; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.barra__fila { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--principal); text-decoration: none; }
.menu { display: flex; gap: 1.6rem; align-items: center; }
.menu a:not(.boton) { text-decoration: none; font-weight: 500; }
.menu a:not(.boton):hover { color: var(--acento); }
.menu-btn { display: none; background: none; border: 0; font-size: 1.8rem; cursor: pointer; color: var(--principal); }

/* Portada */
.portada { min-height: 78vh; display: flex; align-items: center; color: #fff;
  background: linear-gradient(rgba(20,40,50,.55), rgba(20,40,50,.55)), url("img/portada.svg") center/cover; }
.portada h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.15; max-width: 700px; }
.portada p { font-size: 1.15rem; margin: 1rem 0 2rem; max-width: 560px; }
.portada__botones { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Secciones */
.seccion { padding: 5rem 0; }
.seccion--gris { background: var(--gris); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); color: var(--principal); margin-bottom: .5rem; }
.sub { color: #66737c; margin-bottom: 1.5rem; }

/* Filtros */
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filtro { border: 1px solid #cdd5da; background: #fff; padding: .45rem 1rem; border-radius: 30px; cursor: pointer; font: inherit; }
.filtro.activo { background: var(--principal); color: #fff; border-color: var(--principal); }

/* Tarjetas de casas */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.8rem; }
.tarjeta { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 22px rgba(0,0,0,.08);
  display: flex; flex-direction: column; transition: .2s; }
.tarjeta:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.tarjeta__foto { position: relative; aspect-ratio: 4/3; }
.tarjeta__foto img { width: 100%; height: 100%; object-fit: cover; }
.estado { position: absolute; top: 12px; left: 12px; padding: .2rem .8rem; border-radius: 20px; font-size: .8rem; font-weight: 600; color: #fff; }
.estado--venta { background: #2e8b57; }
.estado--apartada { background: #d9a441; }
.estado--vendida { background: #b33a3a; }
.estado--preventa { background: #2a6fb0; }
.estado--construccion { background: #e07b24; }
.tarjeta__cuerpo { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.precio { font-size: 1.5rem; font-weight: 700; color: var(--principal); }
.tarjeta h3 { font-size: 1.1rem; margin: .2rem 0; }
.ubicacion { color: #66737c; font-size: .95rem; }
.caracteristicas { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: .8rem 0; font-size: .9rem;
  padding: .6rem 0; border-top: 1px solid #eef1f3; border-bottom: 1px solid #eef1f3; }
.descripcion { font-size: .93rem; margin-bottom: 1rem; flex: 1; }

/* Nosotros */
.nosotros { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.ventajas { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ventajas li { background: #fff; padding: 1.2rem; border-radius: 12px; border-left: 4px solid var(--acento); }
.ventajas strong { display: block; color: var(--principal); }
.ventajas span { font-size: .92rem; color: #55626b; }

/* Contacto */
.contacto { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.datos { list-style: none; margin-top: 1.5rem; display: grid; gap: .7rem; font-size: 1.05rem; }
.datos a { text-decoration: none; }
.datos a:hover { color: var(--acento); }
.formulario { background: var(--gris); padding: 2rem; border-radius: 14px; display: grid; gap: 1rem; }
.formulario label { display: grid; gap: .3rem; font-weight: 500; font-size: .95rem; }
.formulario input, .formulario textarea { font: inherit; padding: .7rem .9rem; border: 1px solid #cdd5da; border-radius: 8px; background: #fff; }
.formulario input:focus, .formulario textarea:focus { outline: 2px solid var(--acento); border-color: transparent; }
.aviso { padding: .8rem 1rem; border-radius: 8px; font-weight: 500; }
.aviso--ok { background: #d9f2e3; color: #1d6b3f; }
.aviso--error { background: #f8dcdc; color: #8a2a2a; }

/* Pie y botón flotante */
.pie { background: var(--principal); color: #dfe8ec; text-align: center; padding: 1.6rem 0; font-size: .9rem; }
.wa-flotante { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; background: var(--verde-wa);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 20; transition: .2s; }
.wa-flotante:hover { transform: scale(1.08); }

/* Menú desplegable de casas */
.desplegable { position: relative; }
.desplegable__btn { background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; color: inherit; padding: 0; }
.desplegable__btn:hover { color: var(--acento); }
.desplegable__lista { display: none; position: absolute; top: 140%; left: 50%; transform: translateX(-50%); width: 320px; max-height: 70vh; overflow-y: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.15); padding: .5rem; z-index: 30; }
.desplegable.abierto .desplegable__lista { display: block; }
.desplegable__lista a { display: block; padding: .55rem .8rem; border-radius: 8px; text-decoration: none; line-height: 1.3; }
.desplegable__lista a:hover { background: var(--gris); }
.desplegable__lista span { display: block; font-weight: 500; font-size: .95rem; }
.desplegable__lista small { color: #66737c; }
.desplegable__lista .desplegable__todas { font-weight: 600; color: var(--principal); border-bottom: 1px solid #eef1f3; border-radius: 0; margin-bottom: .3rem; }

/* Tarjetas: enlaces */
.tarjeta h3 a { text-decoration: none; }
.tarjeta h3 a:hover { color: var(--acento); }
.contador { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; padding: .15rem .6rem; border-radius: 20px; font-size: .8rem; }

/* Página de detalle */
.detalle-seccion { padding-top: 2rem; }
.volver { display: inline-block; margin-bottom: 1.2rem; text-decoration: none; color: var(--principal); font-weight: 500; }
.volver:hover { color: var(--acento); }
.detalle { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: start; }
.galeria__principal { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; background: #000; }
.galeria__principal img { width: 100%; height: 100%; object-fit: cover; }
.flecha { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--principal); }
.flecha--izq { left: 12px; } .flecha--der { right: 12px; }
.galeria__miniaturas { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .6rem; margin-top: .7rem; }
.galeria__miniaturas img { aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .6; border: 3px solid transparent; }
.galeria__miniaturas img.activa, .galeria__miniaturas img:hover { opacity: 1; border-color: var(--acento); }
.ficha { background: #fff; border-radius: 14px; padding: 1.6rem; box-shadow: 0 6px 22px rgba(0,0,0,.08); display: grid; gap: .8rem; position: sticky; top: 90px; }
.ficha h1 { font-size: 1.5rem; line-height: 1.25; color: var(--texto); }
.precio--grande { font-size: 2rem; }
.ficha__datos { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .4rem 0; }
.ficha__datos li { background: var(--gris); border-radius: 10px; padding: .7rem; text-align: center; font-size: .85rem; color: #55626b; }
.ficha__datos strong { display: block; font-size: 1.25rem; color: var(--principal); }
.boton--wa { background: var(--verde-wa); }
.boton--blanco-borde { background: #fff; color: var(--principal); border: 2px solid var(--principal); }
.detalle__info { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 3rem; }
.detalle__info h2 { font-size: 1.4rem; margin-top: 1rem; }
.extras { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.mapa { width: 100%; height: 320px; border: 0; border-radius: 14px; }
.anterior-siguiente { display: flex; justify-content: space-between; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid #eef1f3; }
.anterior-siguiente a { text-decoration: none; font-weight: 600; color: var(--principal); }
.anterior-siguiente a:hover { color: var(--acento); }

/* Celular */
@media (max-width: 800px) {
  .menu-btn { display: block; }
  .menu { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column;
    padding: 1.2rem; gap: 1rem; box-shadow: 0 8px 16px rgba(0,0,0,.08); }
  .menu-abierto .menu { display: flex; }
  .nosotros, .contacto { grid-template-columns: 1fr; gap: 2rem; }
  .ventajas { grid-template-columns: 1fr; }
  .seccion { padding: 3.5rem 0; }
  .formulario { padding: 1.4rem; }
  .desplegable { width: 100%; text-align: center; }
  .desplegable__lista { text-align: left; position: static; transform: none; width: 100%; box-shadow: none; background: var(--gris); margin-top: .5rem; max-height: 50vh; }
  .detalle, .detalle__info { grid-template-columns: 1fr; }
  .ficha { position: static; }
  .extras { grid-template-columns: 1fr; }
  .flecha { width: 38px; height: 38px; }
}
.caracteristicas:not(:has(li)) { display: none; }
