/* ============================================================
   SmartBienes — sistema de diseño
   Dirección: confianza documental, papel y sello, calidez costeña.
   El Carmen, Manabí — no es una plataforma anónima, es Alfredo
   revisando cada propiedad papel por papel antes de publicarla.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Marca — celeste real del logo (nunca verde) */
  --celeste: #0098e0;
  --celeste-oscuro: #0077b3;

  /* Papel y tinta — reemplaza el blanco/negro genérico */
  --papel: #FBF6EC;
  --papel-card: #FFFDF8;
  --tinta: #241F1A;
  --tinta-suave: #524A40;

  /* Acento costeño — tejas, atardecer en el malecón */
  --terracota: #C4602A;
  --terracota-oscuro: #A34E20;

  --borde: #E8DFCE;
  --sombra: 0 12px 30px -12px rgba(36, 31, 26, 0.25);
  --sombra-suave: 0 4px 14px -6px rgba(36, 31, 26, 0.15);

  --radio: 18px;
  --radio-chico: 10px;

  /* Curva de movimiento — respuesta rápida, asentado suave, sin rebote */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--tinta);
  background: var(--papel);
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  text-wrap: balance;
}

/* Jerarquía tipográfica: el tamaño más grande lleva el trazado más
   apretado y el interlineado más corto; ambos se relajan a medida que
   el texto se hace más chico (disciplina óptica, no un solo valor fijo) */
h1 { line-height: 1.05; letter-spacing: -0.025em; }
h2 { line-height: 1.15; letter-spacing: -0.015em; }
h3 { line-height: 1.3; letter-spacing: -0.005em; }

a { color: var(--celeste-oscuro); }

/* ---------- Nav ---------- */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(251, 246, 236, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(232, 223, 206, 0.7);
  position: sticky;
  top: 0;
  z-index: 20;
}

@media (prefers-reduced-transparency: reduce) {
  nav { background: var(--papel); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .hero .eyebrow { background: rgba(36, 31, 26, 0.75); backdrop-filter: none; }
  .hero-doc-card { background: var(--tinta); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

nav .brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
nav img.logo { height: 56px; width: 56px; display: block; object-fit: contain; }
nav .brand-text { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 700; color: var(--tinta); line-height: 1; }
nav .brand-text b { color: var(--celeste); font-weight: 700; }

nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { color: var(--tinta); text-decoration: none; font-weight: 800; font-size: 1.1rem; transition: color 150ms var(--ease); }
nav a:hover { color: var(--celeste-oscuro); }

@media (max-width: 480px) {
  nav { padding: .75rem 1rem; }
  nav img.logo { height: 40px; width: 40px; }
  nav .brand-text { font-size: 1rem; }
  nav ul { gap: .75rem; }
  nav a { font-size: .85rem; }
}

/* ---------- Sello de verificación — elemento firma ---------- */

.badge-verificado {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--papel-card);
  color: var(--celeste-oscuro);
  border: 1.5px solid var(--celeste);
  padding: .4rem .85rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  margin: .9rem 0;
  transform: rotate(-2deg);
  box-shadow: var(--sombra-suave);
}
.badge-verificado::before { content: "✓"; font-size: 1rem; }

.badge-vendido {
  display: inline-block;
  background: var(--tinta);
  color: var(--papel);
  padding: .4rem .85rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  margin: .9rem 0;
  transform: rotate(-2deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-bottom: .5rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center 65%;
  filter: saturate(1.5) contrast(1.1) brightness(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36, 31, 26, 0.4) 0%, rgba(36, 31, 26, 0.18) 40%, rgba(36, 31, 26, 0.55) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem 3rem;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  text-align: center;
}

.hero-texto { max-width: 46ch; }

@media (min-width: 860px) {
  .hero-inner {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 3.5rem;
  }
  .hero-texto { flex: 1 1 auto; }
  .hero-doc { flex: 0 0 auto; }
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: #fff;
  background: rgba(36, 31, 26, 0.4);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(251, 246, 236, 0.55);
  padding: .55rem 1.2rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  max-width: 16ch;
  margin-bottom: 1.1rem;
  color: var(--papel);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.hero h1 .resalta { color: #fff; text-decoration: underline; text-decoration-color: var(--terracota); text-decoration-thickness: 3px; text-underline-offset: 6px; }

.hero p.lead {
  font-size: 1.1rem;
  color: rgba(251, 246, 236, 0.92);
  max-width: 42ch;
  margin-bottom: 1.75rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

.hero-doc {
  position: relative;
  width: 320px;
  max-width: 82vw;
  flex-shrink: 0;
}

.hero-doc-card {
  background: rgba(36, 31, 26, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(251, 246, 236, 0.15);
  border-radius: var(--radio);
  box-shadow: 0 24px 50px -16px rgba(36, 31, 26, 0.45);
  padding: 2.25rem 1.85rem;
  transform: rotate(-2deg);
}

.hero-doc-titulo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--papel);
  margin-bottom: 1.5rem;
}

.hero-doc-check {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(251, 246, 236, 0.18);
}
.hero-doc-check li {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .88rem;
  font-weight: 600;
  color: rgba(251, 246, 236, 0.85);
}
.hero-doc-tic {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--celeste);
  color: #fff;
  font-size: .7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-doc-sello {
  position: absolute;
  right: -1rem;
  bottom: -1.1rem;
  background: var(--terracota);
  border: 3px solid var(--papel);
  border-radius: 999px;
  padding: .85rem 1.4rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  transform: rotate(9deg);
  box-shadow: var(--sombra);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .hero-doc-sello { right: 50%; transform: translateX(50%) rotate(9deg); bottom: -1.25rem; font-size: .9rem; }
}

.cta-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--terracota);
  color: #fff;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  width: fit-content;
  box-shadow: var(--sombra-suave);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.cta-whatsapp:hover { transform: translateY(-2px); box-shadow: var(--sombra); }
.cta-whatsapp:active { transform: scale(.96); transition-duration: 100ms; }

.cta-secundario {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--celeste-oscuro);
  border: 1.5px solid var(--celeste);
  padding: .85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 220ms var(--ease);
}
.cta-secundario:hover { background: var(--celeste); color: #fff; }
.cta-secundario:active { transform: scale(.96); transition-duration: 100ms; }

/* ---------- Secciones ---------- */

section.propiedades {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

section.propiedades h2 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--papel-card);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  text-decoration: none;
  color: var(--tinta);
  display: block;
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sombra); }
.card:active { transform: translateY(-4px) scale(.985); transition-duration: 100ms; }

.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.card .card-body { padding: 1.1rem 1.25rem 1.35rem; }
.card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; line-height: 1.3; }
.card .precio { color: var(--terracota-oscuro); font-weight: 700; font-family: 'Fraunces', serif; font-size: 1.15rem; }

.ver-todo-wrap { text-align: center; margin-top: 2rem; }

/* ---------- Ficha de propiedad ---------- */

.ficha-hero {
  background: var(--borde);
  display: flex;
  justify-content: center;
}
.ficha-hero img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.galeria-thumbs {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  padding: .85rem 1.5rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  background: var(--papel-card);
  border-bottom: 1px solid var(--borde);
}
.galeria-thumb {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: var(--radio-chico);
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  opacity: .65;
  transition: opacity 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
  scroll-snap-align: start;
}
.galeria-thumb:hover { opacity: 1; }
.galeria-thumb:active { transform: scale(.94); }
.galeria-thumb.activa { opacity: 1; border-color: var(--celeste); }

.volver {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--tinta-suave);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 1.25rem;
}
.volver:hover { color: var(--celeste-oscuro); }

.ficha-body { padding: 2rem 1.5rem; max-width: 680px; margin: 0 auto; }
.ficha-body h1 { font-size: 1.9rem; margin-bottom: .5rem; }
.ficha-body h2 { font-size: 1.3rem; margin-top: 1.75rem; margin-bottom: .5rem; }
.ficha-body p { color: var(--tinta-suave); }
.ficha-body .precio {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  color: var(--terracota-oscuro);
  font-weight: 700;
  margin-bottom: .5rem;
}

.ficha-body dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1.5rem;
  margin: 1.25rem 0;
  padding: 1.1rem 1.25rem;
  background: var(--papel-card);
  border: 1px solid var(--borde);
  border-radius: var(--radio-chico);
}
.ficha-body dt { color: var(--tinta-suave); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.ficha-body dd { font-weight: 700; }

.foto-perfil {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  margin-bottom: 1.25rem;
  border: 3px solid var(--papel-card);
  box-shadow: var(--sombra-suave);
}

.cta-row { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.75rem; }

form.contacto {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  background: var(--papel-card);
  border: 1px solid var(--borde);
  border-radius: var(--radio-chico);
  padding: 1.1rem;
}
form.contacto input {
  padding: .8rem .9rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio-chico);
  font-size: 1rem;
  font-family: inherit;
  background: var(--papel);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
form.contacto input:focus {
  outline: 2px solid var(--celeste);
  outline-offset: 1px;
}
form.contacto button {
  background: var(--celeste);
  color: #fff;
  border: none;
  padding: .9rem;
  border-radius: var(--radio-chico);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}
form.contacto button:hover { background: var(--celeste-oscuro); }
form.contacto button:active { transform: scale(.97); transition-duration: 100ms; }

/* ---------- Contacto directo ---------- */

.contacto-directo {
  background: linear-gradient(180deg, rgba(0, 152, 224, 0.08), rgba(0, 152, 224, 0.02));
  border-top: 1px solid var(--borde);
  padding: 3rem 1.5rem;
}

.contacto-directo-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.contacto-directo h2 {
  font-size: 1.6rem;
  margin-bottom: .6rem;
}

.contacto-directo p {
  color: var(--tinta-suave);
  margin-bottom: 1.75rem;
}

.contacto-directo-acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.contacto-telefono {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--papel-card);
  color: var(--tinta);
  border: 1.5px solid var(--borde);
  padding: .85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 180ms var(--ease), transform 220ms var(--ease);
}
.contacto-telefono:hover { border-color: var(--celeste); color: var(--celeste-oscuro); }
.contacto-telefono:active { transform: scale(.96); transition-duration: 100ms; }

/* ---------- Footer ---------- */

footer {
  padding: 2.5rem 1.5rem;
  color: var(--tinta-suave);
  font-size: .85rem;
  border-top: 1px solid var(--borde);
  text-align: center;
}
footer p { margin-bottom: .5rem; }
footer p:last-child { margin-bottom: 0; }
footer .footer-aviso {
  font-size: .78rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  opacity: .75;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
