/* =================================================================
   APGESTION INMOBILIARIA — Hoja de estilos principal
   Paleta: Navy + Dorado · Tipografía: system stack
   ================================================================= */

/* ---------- Variables ---------- */
:root {
  --navy:        #1a3550;
  --navy-deep:   #0f2338;
  --navy-soft:   #2d4a66;
  --gold:        #b8893a;
  --gold-soft:   #d4a560;
  --bg:          #ffffff;
  --bg-alt:      #f6f7f9;
  --bg-soft:     #fafbfc;
  --line:        #e3e6ea;
  --text:        #1a2333;
  --muted:       #5a6470;
  --muted-soft:  #8a929c;
  --whats:       #25d366;
  --whats-dark:  #1da851;
  --danger:      #c63d3d;
  --ok:          #2a8e58;

  --radius:     8px;
  --radius-lg:  14px;
  --shadow-sm:  0 1px 2px rgba(15,35,56,.06), 0 1px 4px rgba(15,35,56,.04);
  --shadow:     0 6px 18px rgba(15,35,56,.08);
  --shadow-lg:  0 18px 40px rgba(15,35,56,.14);
  --container:  1200px;
  --t:          200ms cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--gold); }
h1,h2,h3,h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; font-family: 'Lato', sans-serif; }
h1 { font-size: clamp(2.8rem, 5vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(2.1rem, 4vw, 3rem); font-weight: 900; }
h3 { font-size: 1.65rem; }
h4 { font-size: 1.3rem; }
p { margin: 0 0 1em; font-size: 1.1rem; }
ul { margin: 0; padding: 0; list-style: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.center { text-align: center; margin-top: 2rem; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy-deep);
  color: #c8d2dd;
  font-size: 1.1rem;
  padding: .7rem 0;
}
.topbar__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.topbar__info { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.topbar__item { color: #c8d2dd; }
.topbar__item:hover { color: var(--gold-soft); }
.topbar__social a {
  display: inline-block;
  width: 28px; height: 28px;
  margin-left: .35rem;
  border: 1px solid #3a4d62;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  font-size: .75rem;
  color: #c8d2dd;
}
.topbar__social a:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
@media (max-width: 700px) {
  .topbar__item--hide-mobile { display: none; }
  .topbar__inner { justify-content: center; }
}

/* ---------- Header & Nav ---------- */
.header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header__inner { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; }
.logo { display: inline-flex; align-items: center; gap: .65rem; }
.logo__img {
  height: 52px;
  width: auto;
  display: block;
}
.logo__img--footer {
  height: 75px;
  background: #fff;
  padding: 6px;
  border-radius: var(--radius);
}
/* Estilos antiguos del logo de texto (se mantienen por compatibilidad) */
.logo__mark {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: var(--gold);
  font-weight: 800; letter-spacing: .04em;
  border-radius: var(--radius);
  font-size: .95rem;
}
.logo__text { display: flex; flex-direction: column; line-height: 1.05; }
.logo__text strong { font-size: 1.05rem; color: var(--navy); letter-spacing: .04em; }
.logo__text small { font-size: .65rem; color: var(--muted); letter-spacing: .25em; }
.logo--footer { color: #fff; }
.logo--footer .logo__text strong, .logo--footer .logo__text small { color: #fff; }

.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav ul { display: flex; gap: 1.4rem; }
.nav a {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 500;
  position: relative;
  padding: .25rem 0;
}
.nav a.active, .nav a:hover { color: var(--gold); }
.nav a.active::after {
  content: ''; position: absolute; bottom: -6px; left: 0; right: 0;
  height: 2px; background: var(--gold);
}
.nav__cta { white-space: nowrap; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; padding: 8px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--navy); margin: 5px 0;
  transition: var(--t);
}

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 64px 0 0 auto;
    width: min(85%, 320px);
    background: #fff;
    flex-direction: column; align-items: stretch;
    padding: 1.5rem;
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform var(--t);
    box-shadow: var(--shadow-lg);
    height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav.is-open { transform: translateX(0); }
  .nav ul { flex-direction: column; gap: 0; width: 100%; }
  .nav ul li { border-bottom: 1px solid var(--line); }
  .nav ul a { display: block; padding: .85rem 0; }
  .nav__cta { margin-top: 1rem; text-align: center; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: 1.1rem 1.9rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.15rem;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  line-height: 1.2;
  font-family: 'Lato', sans-serif;
}
.btn--primary { background: var(--gold); color: #fff; }
.btn--primary:hover { background: var(--navy); color: #fff; }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: #fff; }
.btn--whatsapp { background: var(--whats); color: #fff; }
.btn--whatsapp:hover { background: var(--whats-dark); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #a02d2d; }
.btn--sm { padding: .5rem .9rem; font-size: .82rem; }
.btn--full { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-soft) 100%);
  color: #fff;
  overflow: hidden;
  padding: 4rem 0 3rem;
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(184,137,58,.18), transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(255,255,255,.05), transparent 40%);
  pointer-events: none;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative; z-index: 2;
}
.hero__copy h1 { color: #fff; margin-bottom: 1rem; }
.hero__copy h1 span { color: var(--gold-soft); display: block; }
.hero__copy p { font-size: 1.35rem; color: #d8dde4; max-width: 620px; margin-bottom: 1.75rem; }
.hero__eyebrow {
  display: inline-block;
  font-size: 1.05rem; letter-spacing: .2em; color: var(--gold-soft);
  margin-bottom: 1rem; font-weight: 700;
}
.hero__cta { display: flex; gap: .85rem; flex-wrap: wrap; }
.hero__cta .btn--ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.hero__cta .btn--ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }

/* ---------- Buscador ---------- */
.search {
  background: #fff;
  color: var(--text);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.search__title { font-size: 1.55rem; margin-bottom: 1.25rem; }
.search__row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin-bottom: 1.25rem; }
.search label, .form label { display: flex; flex-direction: column; font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.search label span { margin-bottom: .3rem; }
.search select, .search input,
.form input, .form select, .form textarea {
  border: 1px solid var(--line);
  background: #fff;
  padding: .9rem .95rem;
  border-radius: var(--radius);
  font-size: 1.15rem;
  color: var(--text);
  font-family: 'Lato', sans-serif;
  transition: border-color var(--t), box-shadow var(--t);
}
.search select:focus, .search input:focus,
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,137,58,.15);
}

@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0 2rem; }
}

/* ---------- Secciones ---------- */
.section { padding: 4rem 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.section__eyebrow {
  display: inline-block;
  font-size: 1.05rem; letter-spacing: .2em; color: var(--gold);
  margin-bottom: .75rem; font-weight: 700;
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid--services { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: transform var(--t), box-shadow var(--t);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  display: block;
  background: var(--bg-alt);
}
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms ease;
}
.card:hover .card__media img { transform: scale(1.04); }
.card__badge {
  position: absolute; top: .75rem;
  padding: .3rem .65rem;
  border-radius: 4px;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.card__badge--gold { left: .75rem; background: var(--gold); color: #fff; }
.card__badge--op   { right: .75rem; background: rgba(15,35,56,.85); color: #fff; }
.card__badge--venta    { background: rgba(184,137,58,.95); }
.card__badge--arriendo { background: rgba(42,142,88,.95); }

.card__body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.card__type { font-size: 1rem; color: var(--muted); letter-spacing: .03em; margin-bottom: .4rem; }
.card__title { font-size: 1.3rem; margin: 0 0 .5rem; min-height: 2.6em; }
.card__title a { color: var(--navy); }
.card__title a:hover { color: var(--gold); }
.card__price { color: var(--gold); font-weight: 900; font-size: 1.65rem; margin-bottom: .8rem; }
.card__features {
  display: flex; flex-wrap: wrap; gap: .75rem;
  font-size: 1.05rem; color: var(--muted);
  padding-bottom: .9rem; border-bottom: 1px solid var(--line); margin-bottom: .9rem;
}
.card__actions { display: flex; gap: .5rem; margin-top: auto; }
.card__actions .btn { flex: 1; padding: .75rem .5rem; font-size: 1.05rem; }

/* ---------- Servicios ---------- */
.service {
  background: #fff;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform var(--t), border-color var(--t);
}
.service:hover { transform: translateY(-3px); border-color: var(--gold); }
.service__icon {
  width: 50px; height: 50px;
  background: rgba(184,137,58,.12);
  color: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.service h3 { margin-bottom: .5rem; }
.service p { color: var(--muted); margin: 0; font-size: 1.15rem; }

/* ---------- Banner para propietarios ---------- */
.banner { background: var(--navy); color: #fff; padding: 4rem 0; }
.banner h2 { color: #fff; }
.banner__inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.banner__copy p { color: #c8d2dd; }
.banner .section__eyebrow { color: var(--gold-soft); }
.checks { margin: 1.25rem 0 1.75rem; }
.checks li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: .55rem;
  color: #d8dde4;
}
.checks li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.banner__visual { display: flex; justify-content: center; }
.banner__visual svg { max-width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.banner__img {
  max-width: 100%;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.checks li { font-size: 1.22rem; }
@media (max-width: 880px) {
  .banner__inner { grid-template-columns: 1fr; }
  .banner__visual { order: -1; }
  .banner__img { max-height: 400px; }
}

/* ---------- Quiénes somos ---------- */
.nosotros { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.nosotros__stats { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.stat {
  background: #fff;
  border-left: 4px solid var(--gold);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat strong { display: block; font-size: 2.8rem; color: var(--navy); font-weight: 900; }
.stat span { color: var(--muted); font-size: 1.15rem; }
@media (max-width: 880px) { .nosotros { grid-template-columns: 1fr; } }

/* ---------- Contacto ---------- */
.contacto { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contacto__data { margin-top: 1.5rem; }
.contacto__data li { padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
.contacto__data li strong { color: var(--navy); display: inline-block; min-width: 130px; }
.form { display: flex; flex-direction: column; gap: 1rem; background: #fff; padding: 2rem; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.form h3 { margin: 0 0 .5rem; }
.form label { color: var(--text); font-size: 1.1rem; font-weight: 600; gap: .35rem; }
.form textarea { resize: vertical; min-height: 120px; }
@media (max-width: 880px) { .contacto { grid-template-columns: 1fr; } }

.alert { padding: 1.1rem 1.25rem; border-radius: var(--radius); font-size: 1.1rem; }
.alert--ok    { background: #e8f5ee; color: #1f6b3f; border: 1px solid #c2e3cf; }
.alert--aviso { background: #fff7e0; color: #7a5a10; border: 1px solid #f1d97c; }
.alert--err   { background: #fbeaea; color: #8e2828; border: 1px solid #efc6c6; }

/* ---------- Page head (listado) ---------- */
.page-head { background: var(--bg-alt); padding: 3rem 0 2rem; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: .25rem; }
.page-head p { color: var(--muted); margin: 0; }

/* ---------- Listado con filtros ---------- */
.layout--listado { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: flex-start; }
.filtros {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky; top: 90px;
}
.filtros h3 { margin-top: 0; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.filtros form { display: flex; flex-direction: column; gap: 1rem; }
.filtros label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); font-weight: 500; }
.filtros input, .filtros select {
  border: 1px solid var(--line); padding: .55rem .65rem;
  border-radius: var(--radius); font-size: .9rem;
}
.filtros .btn { margin-top: .25rem; }
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line);
}
.empty h3 { color: var(--navy); }
.empty p { color: var(--muted); margin-bottom: 1.25rem; }
@media (max-width: 880px) {
  .layout--listado { grid-template-columns: 1fr; }
  .filtros { position: static; }
}

/* ---------- Detalle de propiedad ---------- */
.propiedad-detalle { padding: 2rem 0 4rem; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { color: var(--navy); font-weight: 500; }

.detalle__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.detalle__head h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: .5rem 0 .25rem; }
.detalle__ubic { color: var(--muted); margin: 0; }
.detalle__precio {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
}
.tag {
  display: inline-block; padding: .25rem .6rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 4px;
  margin-right: .35rem;
  background: var(--navy); color: #fff;
}
.tag--venta { background: var(--gold); }
.tag--arriendo { background: var(--ok); }
.tag--gold { background: var(--gold); }

.galeria { margin-bottom: 2rem; }
.galeria__main {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  margin-bottom: .75rem;
}
.galeria__main img { width: 100%; height: 100%; object-fit: cover; }
.galeria__thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumb {
  width: 90px; aspect-ratio: 4/3;
  background: var(--bg-alt);
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0; cursor: pointer;
  transition: border-color var(--t);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active, .thumb:hover { border-color: var(--gold); }

.detalle__body { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; }
.caracteristicas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
}
.caract { text-align: center; }
.caract span { font-size: 1.4rem; display: block; }
.caract strong { font-size: 1.1rem; color: var(--navy); display: block; }
.caract small { color: var(--muted); font-size: .8rem; }
.descripcion { color: var(--text); line-height: 1.75; margin-bottom: 1.5rem; }
.codigo { font-size: .85rem; color: var(--muted); }

.detalle__side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 90px; align-self: flex-start; }
.contact-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.contact-box h3 { margin-top: 0; }
.contact-box .btn { margin-bottom: .5rem; }
.contact-box .btn:last-child { margin-bottom: 0; }
.contact-box--alt { background: var(--navy); color: #fff; }
.contact-box--alt strong { color: #fff; display: block; margin-bottom: .25rem; font-size: 1rem; }
.contact-box--alt p { color: #c8d2dd; font-size: .9rem; margin: 0 0 .5rem; }
.contact-box--alt small { color: var(--gold-soft); font-size: .8rem; }

@media (max-width: 880px) {
  .detalle__body { grid-template-columns: 1fr; }
  .detalle__side { position: static; }
}

/* ---------- Footer ---------- */
.footer { background: var(--navy-deep); color: #c8d2dd; padding: 3rem 0 0; margin-top: 4rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer h4 { color: #fff; margin-bottom: 1rem; font-size: 1.3rem; }
.footer__about { color: #a8b3c0; line-height: 1.7; margin: 1rem 0 0; font-size: 1.12rem; }
.footer__links li, .footer__contact li { padding: .5rem 0; font-size: 1.12rem; }
.footer__links a, .footer__contact a { color: #c8d2dd; }
.footer__links a:hover, .footer__contact a:hover { color: var(--gold-soft); }
.footer__bottom { background: #07182a; padding: 1.2rem 0; }
.footer__bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; font-size: 1.05rem; }
.footer__admin { color: #5f6e80; font-size: 1rem; }
.footer__admin:hover { color: var(--gold-soft); }
@media (max-width: 700px) {
  .footer__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer__bottom-inner { justify-content: center; text-align: center; }
}

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px;
  width: 58px; height: 58px;
  background: var(--whats);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.4);
  z-index: 999;
  transition: transform var(--t);
  animation: whatsBeat 2.5s ease-in-out infinite;
}
.whatsapp-float:hover { transform: scale(1.08); background: var(--whats-dark); }
@keyframes whatsBeat {
  0%,100% { box-shadow: 0 6px 20px rgba(37,211,102,.4); }
  50%     { box-shadow: 0 6px 20px rgba(37,211,102,.7), 0 0 0 12px rgba(37,211,102,0); }
}
@media (max-width: 600px) {
  .whatsapp-float { width: 52px; height: 52px; bottom: 18px; right: 18px; }
}
