/* =====================================================================
   CASA TIELMES — Estilos principales
   Paleta unificada con las plantillas de anuncios
   ===================================================================== */

/* =====================
   VARIABLES & RESET
===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colores — idénticos a los ad templates */
  --bg-deepest:  #080402;
  --bg-deep:     #0d0705;
  --bg-warm:     #100804;
  --bg-section:  #130905;
  --bg-alt:      #1a0f08;
  --cream:       #F8F2E6;
  --cream-muted: #ede5d4;
  --gold:        #C9A357;
  --gold-light:  #D8BA78;
  --gold-dim:    rgba(201,163,87,0.45);
  --gold-glow:   rgba(201,163,87,0.12);
  --white:       #ffffff;

  /* Texto sobre oscuro */
  --text-primary:   rgba(255,255,255,0.92);
  --text-secondary: rgba(255,255,255,0.60);
  --text-muted:     rgba(255,255,255,0.35);
  --border-gold:    rgba(201,163,87,0.28);
  --border-light:   rgba(255,255,255,0.08);

  /* Texto sobre cream */
  --text-dark:     #1a0f08;
  --text-dark-mid: #4a3020;
  --text-dark-dim: #8a7060;

  --section-pad: 110px;
  --radius: 2px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  color: var(--text-primary);
  background: var(--bg-deep);
  overflow-x: hidden;
  /* Sutil textura de grano sobre el fondo */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* =====================
   TIPOGRAFÍA
===================== */
.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.label.center { text-align: center; }

h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}
h2 em { font-style: italic; color: var(--gold); }

h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  line-height: 1.2;
}

p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
p:last-child { margin-bottom: 0; }

.section-title { text-align: center; margin-bottom: 70px; }

/* Línea dorada decorativa */
.gold-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 28px auto;
}

/* =====================
   NAV
===================== */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 0;
  transition: background .4s, padding .4s, backdrop-filter .4s;
}
#nav.scrolled {
  background: rgba(13,7,5,0.92);
  padding: 16px 0;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 2px;
}
.nav-cta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  border: 1px solid var(--border-gold);
  padding: 11px 22px;
  transition: background .2s, border-color .2s, color .2s;
}
.nav-cta:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-deep);
}

/* =====================
   HERO
===================== */
#hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-media { position: absolute; inset: 0; }
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.hero-img.active { opacity: 1; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(13,7,5,0.25) 0%,
    rgba(13,7,5,0.50) 60%,
    rgba(13,7,5,0.82) 100%
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 860px;
  animation: heroIn 1.2s ease both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
  animation: heroIn 1.2s .15s ease both;
}
.hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 22px;
  animation: heroIn 1.2s .3s ease both;
}
.hero-content h1 em { font-style: italic; color: var(--gold-light); }
.hero-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 48px;
  font-weight: 400;
  animation: heroIn 1.2s .45s ease both;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: heroIn 1.2s .6s ease both;
}

/* Línea dorada debajo del hero */
#hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dim), transparent);
  z-index: 3;
}

/* =====================
   BOTONES
===================== */
.btn-primary {
  background: var(--gold);
  color: var(--bg-deep);
  padding: 15px 36px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  transition: background .2s, transform .2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-secondary {
  border: 1px solid rgba(255,255,255,0.45);
  color: var(--white);
  padding: 15px 36px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  transition: background .2s, border-color .2s;
  display: inline-block;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.7);
}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  animation: bounce 2.4s infinite;
  opacity: 0.55;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(10px); }
}

/* =====================
   HISTORIA
   (única sección clara — contraste deliberado)
===================== */
#historia {
  padding: var(--section-pad) 0;
  background: var(--cream);
  position: relative;
}
/* Top edge dorado */
#historia::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.5;
}

#historia h2 { color: var(--text-dark); }
#historia h2 em { color: var(--gold); }
#historia .label { color: var(--gold); }
#historia p { color: var(--text-dark-mid); }

.historia-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  align-items: center;
}
.historia-text h2 { margin-bottom: 28px; }
.historia-img-wrap { position: relative; }
.historia-img-wrap img {
  height: 520px;
  object-position: center;
  filter: brightness(0.96);
}
.historia-badge {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: var(--gold);
  color: var(--bg-deep);
  padding: 22px 28px;
  text-align: center;
}
.badge-year {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}
.badge-text {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 4px;
}

/* =====================
   STATS
===================== */
#stats {
  padding: 90px 0;
  background: var(--bg-deepest);
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
}
.stat {
  text-align: center;
  padding: 36px 16px;
  border-right: 1px solid var(--border-light);
  position: relative;
}
.stat:last-child { border-right: none; }
/* Punto dorado centrado en la línea divisoria */
.stat:not(:last-child)::after {
  content: '·';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dim);
  font-size: 1.2rem;
  line-height: 1;
}
.stat-num {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.stat-unit {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gold-dim);
  margin-left: 2px;
  font-weight: 400;
}
.stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 10px;
}

/* =====================
   ESPACIOS DESTACADOS
===================== */
#espacios {
  padding: var(--section-pad) 0 calc(var(--section-pad) / 2);
  background: var(--bg-deep);
}
#espacios .container {
  margin-bottom: 60px;
}
#espacios h2 { color: var(--white); }
#espacios .label { color: var(--gold); }

.espacio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  margin-bottom: 3px;
  overflow: hidden;
}
.espacio-reverse .espacio-img { order: 2; }
.espacio-reverse .espacio-text { order: 1; }

.espacio-img {
  overflow: hidden;
  min-height: 500px;
  position: relative;
}
.espacio-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s ease;
}
.espacio:hover .espacio-img img { transform: scale(1.03); }

/* Espacio jardín — strip de fotos adicionales */
.espacio-jardin .espacio-img {
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.espacio-jardin .espacio-img > img:first-child {
  height: 370px;
  width: 100%;
  object-fit: cover;
  flex-shrink: 0;
}
.espacio-img-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  flex-shrink: 0;
}
.espacio-jardin .espacio-img-strip img {
  height: 145px;
  width: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.7s ease, opacity 0.3s;
}
.espacio-jardin .espacio-img-strip img:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

/* Callout del pozo — destaque dentro del espacio jardín */
.espacio-highlight {
  margin-top: 4px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: rgba(201,163,87,0.08);
  color: var(--gold-light) !important;
  font-size: 0.93rem;
  line-height: 1.6;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/*
  Los .espacio son hijos 2–7 de #espacios (el hijo 1 es el .container del título).
  Por eso los impares (01, 03, 05) caen en nth-child EVEN y los pares en ODD.
*/

/* Espacios 01, 03, 05 (escalera, bodega, jardín): oscuro */
.espacio:nth-child(even) .espacio-text {
  background: var(--bg-warm);
}
.espacio:nth-child(even) .espacio-text h3 { color: var(--white); }
.espacio:nth-child(even) .espacio-text p  { color: var(--text-secondary); }
.espacio:nth-child(even) .espacio-num     { color: rgba(201,163,87,0.08); }

/* Espacios 02, 04, 06 (salón, sala multiusos, dormitorio): cream */
.espacio:nth-child(odd) .espacio-text {
  background: var(--cream);
}
.espacio:nth-child(odd) .espacio-text h3 { color: var(--text-dark); }
.espacio:nth-child(odd) .espacio-text p  { color: var(--text-dark-mid); }
.espacio:nth-child(odd) .espacio-num     { color: rgba(26,15,8,0.06); }

.espacio-text {
  padding: 70px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
/* Línea dorada izquierda en el texto */
.espacio-text::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  opacity: 0.4;
}
.espacio-reverse .espacio-text::before {
  left: auto;
  right: 0;
}

.espacio-num {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: -2px;
}
.espacio-text h3 { margin-bottom: 18px; }

/* =====================
   GALERÍA
===================== */
#galeria {
  padding: 0;
  background: var(--bg-deepest);
}
.galeria-header {
  padding: 70px 0 44px;
  text-align: center;
  border-top: 1px solid var(--border-gold);
}
.galeria-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--white);
}

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 0 3px 3px;
}
.galeria-item {
  height: 250px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.galeria-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(201,163,87,0);
  transition: background .35s;
}
.galeria-item:hover::after { background: rgba(201,163,87,0.18); }
.galeria-item img { transition: transform .5s ease; }
.galeria-item:hover img { transform: scale(1.06); }

/* Ítems grandes */
.galeria-item:nth-child(1),
.galeria-item:nth-child(5) {
  grid-column: span 2;
  height: 340px;
}

/* =====================
   LIGHTBOX
===================== */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,4,2,0.97);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#lightbox.active { display: flex; }
#lb-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-muted);
}
#lb-img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lb-close {
  position: absolute;
  top: 24px; right: 36px;
  background: none; border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity .2s, color .2s;
}
.lb-close:hover { opacity: 1; color: var(--gold); }
.lb-prev, .lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: var(--white);
  font-size: 3.5rem;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity .2s, color .2s;
  padding: 20px;
  font-weight: 300;
}
.lb-prev:hover, .lb-next:hover { opacity: 1; color: var(--gold); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* =====================
   DISTRIBUCIÓN
===================== */
#distribucion {
  padding: var(--section-pad) 0;
  background: var(--bg-section);
  border-top: 1px solid var(--border-light);
}
#distribucion h2 { color: var(--white); margin-bottom: 70px; }
#distribucion .label { color: var(--gold); }

.dist-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.dist-planta {
  padding: 0 32px;
  border-right: 1px solid var(--border-light);
}
.dist-planta:first-child { padding-left: 0; }
.dist-planta:last-child  { padding-right: 0; border-right: none; }

.dist-planta h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.0rem;
  font-weight: 700;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-gold);
  color: var(--gold);
  letter-spacing: 0.5px;
}
.dist-planta ul {
  list-style: none;
  padding: 0;
}
.dist-planta li {
  font-size: 0.84rem;
  font-weight: 300;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.5;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.dist-planta li::before {
  content: '—';
  color: var(--gold);
  font-size: 0.65rem;
  flex-shrink: 0;
  opacity: 0.7;
}
/* Sala multiusos — ítem especial */
.dist-planta li:has-text("multiusos"),
.dist-sala-especial {
  color: var(--gold-light);
}

/* =====================
   INVERSIÓN
===================== */
#inversion {
  padding: var(--section-pad) 0;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-gold);
}
#inversion .label { color: var(--gold); }
#inversion h2 { color: var(--white); margin-bottom: 28px; }
#inversion h2 em { color: var(--gold-light); }
#inversion p { color: var(--text-secondary); }

.inversion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 90px;
  align-items: center;
}
.inversion-items {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 40px;
}
.inv-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-light);
}
.inv-item:last-child { border-bottom: none; padding-bottom: 0; }
.inv-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.inv-item strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}
.inv-item p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}
.inversion-visual {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  height: 560px;
}
.inversion-visual img { height: 100%; object-fit: cover; }

/* =====================
   UBICACIÓN
===================== */
#ubicacion {
  padding: var(--section-pad) 0;
  background: var(--bg-warm);
  border-top: 1px solid var(--border-light);
}
#ubicacion h2 { color: var(--white); margin-bottom: 28px; }
#ubicacion .label { color: var(--gold); }
#ubicacion p { color: var(--text-secondary); }

.ubic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.ubic-text h2 { margin-bottom: 28px; }
.ubic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}
.pill {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  padding: 8px 16px;
  transition: background .2s, border-color .2s;
}
.pill:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
}
.ubic-ref {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.8;
  letter-spacing: 0.3px;
}
.ubic-map iframe {
  width: 100%;
  height: 420px;
  border: none;
  display: block;
  filter: grayscale(0.3) brightness(0.9);
}

/* =====================
   CONTACTO (CTA final)
===================== */
#contacto {
  position: relative;
  padding: 170px 0;
  overflow: hidden;
  text-align: center;
}
.contacto-bg { position: absolute; inset: 0; }
.contacto-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.7);
}
.contacto-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,4,2,0.6) 0%,
    rgba(8,4,2,0.82) 100%
  );
}
#contacto .container { position: relative; z-index: 2; }
#contacto .label { color: var(--gold); }
#contacto .section-title { color: var(--white); margin-bottom: 44px; }
#contacto .section-title em { color: var(--gold-light); font-style: italic; }

.contacto-inner { text-align: center; }
.precio-badge {
  display: inline-block;
  border: 1px solid var(--border-gold);
  padding: 28px 56px;
  margin-bottom: 40px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  position: relative;
}
.precio-badge::before,
.precio-badge::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.6;
  transition: opacity .2s;
}
.precio-badge::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.precio-badge::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.precio-badge:hover { border-color: var(--gold); background: var(--gold-glow); }
.precio-badge:hover::before,
.precio-badge:hover::after { opacity: 1; }

.precio-num {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1;
}
.precio-desc {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 10px;
}
.btn-lg { padding: 18px 52px; font-size: 0.85rem; letter-spacing: 2.5px; }
.precio-negociable {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(201,163,87,0.60);
  margin-top: 6px;
}
.precio-cta {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 16px;
}
.modal-negociable {
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(201,163,87,0.55);
  margin-top: 2px;
}
.contacto-wa { margin-top: 28px; }
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(37,211,102,0.10);
  border: 1px solid rgba(37,211,102,0.30);
  color: #4ade80;
  padding: 13px 30px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  transition: background .2s, border-color .2s;
}
.btn-whatsapp:hover {
  background: rgba(37,211,102,0.20);
  border-color: #4ade80;
}

/* =====================
   MODAL
===================== */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
}
#modal-overlay.active { display: flex; }

.modal {
  display: grid;
  grid-template-columns: 320px 1fr;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  animation: modalIn .35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-left { position: relative; overflow: hidden; min-height: 420px; }
.modal-left img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.modal-left-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,4,2,0.92) 35%, rgba(8,4,2,0.25));
}
.modal-left-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 30px;
}
.modal-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.modal-left-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 18px;
  line-height: 1.2;
}
.modal-facts { display: flex; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.modal-fact span {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--gold);
  font-weight: 700;
}
.modal-fact small {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.modal-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--white);
  font-weight: 700;
  border-top: 1px solid rgba(201,163,87,0.25);
  padding-top: 16px;
  margin: 0;
}
.modal-right {
  background: var(--cream);
  padding: 38px 38px 32px;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none; border: none;
  font-size: 1.0rem;
  color: var(--text-dark-dim);
  cursor: pointer;
  transition: color .2s;
  line-height: 1;
  z-index: 1;
}
.modal-close:hover { color: var(--text-dark); }
.modal-subtitle {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 22px;
}
#contacto-form { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; margin-bottom: 12px; }
.form-group label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dark-dim);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: #fff;
  border: 1px solid #ddd5c8;
  color: var(--text-dark);
  padding: 12px 14px;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #c0b8ae; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,163,87,0.12);
}
.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C9A357' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-group textarea { resize: vertical; min-height: 82px; }
.btn-submit {
  width: 100%;
  background: var(--gold);
  color: var(--bg-deep);
  border: none;
  padding: 16px 32px;
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-top: 6px;
}
.btn-submit:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  text-align: center;
  padding: 24px;
}
.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-deep);
  font-size: 1.6rem;
  margin-bottom: 22px;
}
.form-success p { color: var(--text-dark); font-size: 1.05rem; font-weight: 700; margin: 0; }
.success-sub {
  color: var(--text-dark-mid) !important;
  font-size: 0.86rem !important;
  font-weight: 300 !important;
  margin-top: 10px !important;
}

@media (max-width: 700px) {
  .modal { grid-template-columns: 1fr; }
  .modal-left { height: 190px; min-height: unset; }
  .modal-right { padding: 26px 22px; }
  .form-row { grid-template-columns: 1fr; }
}

/* =====================
   WHATSAPP FLOTANTE
===================== */
.wa-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 150;
  background: #25d366;
  color: var(--white);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}
.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.wa-float svg { flex-shrink: 0; }

/* =====================
   FOOTER
===================== */
footer {
  background: var(--bg-deepest);
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border-light);
}
footer p {
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
/* Línea dorada en el footer */
footer::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--gold-dim);
  margin: 0 auto 24px;
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stat { border-bottom: 1px solid var(--border-light); }
  .stat:nth-child(3) { border-right: none; }
  .dist-grid { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .dist-planta { padding: 32px; border-right: none; border-bottom: 1px solid var(--border-light); }
  .dist-planta:nth-child(odd) { border-right: 1px solid var(--border-light); }
  .dist-planta:last-child { border-bottom: none; }
  .galeria-grid { grid-template-columns: repeat(3, 1fr); }
  .inversion-grid { gap: 50px; }
}

@media (max-width: 768px) {
  :root { --section-pad: 70px; }
  .container { padding: 0 24px; }

  .historia-grid,
  .espacio,
  .ubic-grid,
  .inversion-grid { grid-template-columns: 1fr; gap: 0; }

  .espacio-reverse { direction: ltr; }
  .espacio-reverse .espacio-img { order: unset; }
  .espacio-reverse .espacio-text { order: unset; }

  .historia-img-wrap img { height: 320px; }
  .historia-badge { bottom: -16px; left: 16px; }
  .historia-grid { gap: 60px; }

  .espacio-img { min-height: 320px; }
  .espacio-jardin .espacio-img > img:first-child { height: 260px; }
  .espacio-jardin .espacio-img-strip img { height: 110px; }
  .espacio-text { padding: 44px 28px; }
  .espacio-text::before { display: none; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(n)::after { display: none; }

  .galeria-grid { grid-template-columns: repeat(2, 1fr); }
  .galeria-item:nth-child(1),
  .galeria-item:nth-child(5) { grid-column: span 1; height: 240px; }

  .dist-grid { grid-template-columns: 1fr; }
  .dist-planta { border-right: none !important; }

  .precio-badge { padding: 22px 36px; }
  .precio-num { font-size: 2.4rem; }

  .hero-actions { flex-direction: column; align-items: center; }

  .inversion-visual { height: 360px; }
  .ubic-grid { gap: 40px; }
}

@media (max-width: 480px) {
  .galeria-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-inner { padding: 0 20px; }
}

/* =====================
   SCROLL REVEAL
   (activado por JS en main.js)
===================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.35s; }
