/* ============================================================
   ReformaNM — estilos
   ============================================================ */

:root {
  --gold: #B8963E;
  --gold-light: #C9A961;
  --gold-ink: #806527;
  --cream: #F7F4EF;
  --white: #FCFAF6;
  --charcoal: #16181C;
  --text-gray: #5C564C;
  --whatsapp-green: #15803D;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', Arial, sans-serif;

  --max-width: 1160px;
  --section-pad: 90px;
  --radius: 14px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body, h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; }

body {
  font-family: var(--font-sans);
  color: var(--text-gray);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--charcoal);
  line-height: 1.2;
  font-weight: 600;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: var(--section-pad) 0; }

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 14px;
}

.section-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); }
.section-head p { margin-top: 16px; font-size: 17px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
  min-height: 44px;
  white-space: nowrap;
}
/* .btn fija su propio display, lo que por especificidad de origen anula el
   display:none del atributo [hidden] del navegador: lo restauramos aquí. */
.btn[hidden] { display: none; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--charcoal);
  box-shadow: 0 8px 24px rgba(184, 150, 62, .28);
}
.btn-gold:hover { background: var(--gold); }
.btn-gold:active { background: var(--gold); filter: brightness(.94); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-outline:active { background: var(--charcoal); color: var(--white); opacity: .88; }

.btn-outline {
  background: transparent;
  color: var(--charcoal);
  border: 1.5px solid var(--charcoal);
}
.btn-outline:hover { background: var(--charcoal); color: var(--white); }

.btn-sm { padding: 11px 22px; font-size: 14px; }
.btn-block { width: 100%; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: background-color .3s ease, box-shadow .3s ease;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo-link { display: flex; align-items: center; }
.site-header .logo-light { display: none; }
.site-header .logo-dark { display: block; }

.site-header.is-transparent .logo-light { display: block; }
.site-header.is-transparent .logo-dark { display: none; }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--charcoal);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }

.site-header.is-transparent { background: transparent; box-shadow: none; }
.site-header.is-transparent .nav-links a { color: var(--white); }

.site-header.is-solid {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  padding: 12px 0;
  backdrop-filter: blur(6px);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  width: 24px; height: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .25s ease;
}
.site-header.is-transparent .hamburger { color: var(--white); }
.site-header.is-solid .hamburger, .site-header:not(.is-transparent) .hamburger { color: var(--charcoal); }

.mobile-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(320px, 84vw);
  height: 100vh;
  background: var(--charcoal);
  transform: translateX(100%);
  transition: transform .35s ease;
  z-index: 1100;
  padding: 100px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav a { color: var(--white); font-size: 18px; font-weight: 500; }
.mobile-nav .btn { align-self: flex-start; }

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 1050;
}
.nav-scrim.is-open { opacity: 1; pointer-events: auto; }

.close-menu {
  position: absolute;
  top: 28px; right: 28px;
  color: var(--white);
  font-size: 28px;
  width: 44px; height: 44px;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cream), var(--gold-light));
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
}
.hero-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,24,28,.55) 0%, rgba(22,24,28,.72) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 140px 24px 80px;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(34px, 5.6vw, 62px);
  margin-bottom: 22px;
}

.hero p {
  font-size: clamp(16px, 2vw, 19px);
  color: rgba(255,255,255,.88);
  max-width: 560px;
  margin-bottom: 36px;
}

/* ============================================================
   Beneficios
   ============================================================ */
.benefits { background: var(--cream); }
.benefits-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.benefit-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 36px;
  text-align: left;
}
.benefit-row:first-child { padding-left: 0; }
.benefit-row:last-child { padding-right: 0; }
.benefit-row:not(:first-child) { border-left: 1px solid rgba(22,24,28,.12); }
.benefit-icon { width: 28px; height: 28px; flex-shrink: 0; margin-top: 3px; color: var(--gold-ink); }
.benefit-row h3 { font-size: 18px; margin-bottom: 6px; }
.benefit-row p { font-size: 14.5px; }

/* ============================================================
   Comparador antes/despues
   ============================================================ */
.before-after { padding: 60px 0; }
.compare-slider {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,.16);
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
}
.compare-slider .img-frame { position: absolute; inset: 0; border-radius: 0; }
.compare-before { z-index: 1; }
/* La capa "después" ocupa SIEMPRE todo el comparador y se recorta con
   clip-path (lo mueve el JS). Así ambas fotos van exactamente a la misma
   escala en cualquier pantalla; con un ancho fijo se descuadraban en móvil. */
.compare-after {
  z-index: 2;
  position: absolute;
  inset: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}
.compare-after .img-frame { width: 100%; max-width: none; height: 100%; }
.compare-after .img-frame img { width: 100%; max-width: none; }

.compare-tag {
  position: absolute;
  top: 20px;
  z-index: 3;
  background: rgba(22,24,28,.72);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 7px 14px;
  border-radius: 999px;
}
.compare-tag.before-tag { left: 20px; }
.compare-tag.after-tag { right: 20px; }

.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  z-index: 4;
  width: 4px;
  background: var(--white);
  transform: translateX(-50%);
  cursor: ew-resize;
}
.compare-handle::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.compare-handle::after {
  content: '⇔';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  color: var(--charcoal);
  font-size: 18px;
  font-weight: 700;
}

/* ============================================================
   Servicios
   ============================================================ */
.services { background: var(--cream); }
.services-head {
  text-align: left;
  margin: 0 0 48px;
  max-width: 640px;
}
.services-list { border-top: 1px solid rgba(22,24,28,.14); }
.service-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 30px 0;
  border-bottom: 1px solid rgba(22,24,28,.14);
}
.service-num {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--gold-ink);
  font-variant-numeric: tabular-nums;
}
.service-row-body h3 { font-size: 19px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.service-row-body p { font-size: 14.5px; max-width: 46ch; }
.service-row .btn { flex-shrink: 0; justify-self: end; }

.badge-inline {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--charcoal);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Icono compartido con la banda dorada (Rentabilidad) */
.service-icon { width: 46px; height: 46px; }

/* ============================================================
   Proyectos (masonry)
   ============================================================ */
.gallery-masonry {
  columns: 3 220px;
  column-gap: 20px;
}
.gallery-item {
  position: relative;
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery-item .img-frame { position: static; aspect-ratio: auto; }
/* Patrón vertical / apaisada / cuadrada que se repite cada 3 fotos,
   así la galería admite cualquier número de proyectos sin tocar el CSS. */
.gallery-item:nth-child(3n+1) .img-frame { aspect-ratio: 3/4; }
.gallery-item:nth-child(3n+2) .img-frame { aspect-ratio: 4/3; }
.gallery-item:nth-child(3n)   .img-frame { aspect-ratio: 1/1; }

.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 18px 16px;
  background: linear-gradient(0deg, rgba(22,24,28,.82), rgba(22,24,28,0));
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
}

/* ============================================================
   Banda dorada
   ============================================================ */
.gold-band {
  background: var(--cream);
  color: var(--charcoal);
  padding: 110px 0;
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
}
.gold-band .section-head h2 { color: var(--charcoal); }
.gold-band .section-head p { color: var(--charcoal); }
.gold-band-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  text-align: center;
}
.gold-band-item { padding: 0 10px; }
.gold-band-item .service-icon { margin: 0 auto 16px; }
.gold-band-item h3 { font-size: 18px; color: var(--charcoal); }

/* ============================================================
   Nosotros
   ============================================================ */
.about { background: var(--cream); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-copy p { margin-bottom: 18px; font-size: 16px; }
.about-copy strong { color: var(--charcoal); }
.about-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; }
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.stat { text-align: center; }
.stat strong { display: block; font-family: var(--font-serif); font-size: 30px; color: var(--gold-ink); }
.stat span { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

/* ============================================================
   Contacto
   ============================================================ */
.contact { background: var(--white); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
}

.contact-form {
  display: grid;
  gap: 18px;
}
.form-row { display: grid; gap: 8px; }
.form-row label { font-size: 13.5px; font-weight: 600; color: var(--charcoal); }
.form-row input, .form-row select, .form-row textarea {
  padding: 14px 16px;
  border: 1.5px solid #E4DFD3;
  border-radius: 10px;
  background: var(--cream);
  font-size: 15px;
  color: var(--charcoal);
  transition: border-color .2s ease;
  min-height: 44px;
}
.form-row textarea { min-height: 120px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
  border-color: var(--gold);
}
.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error textarea { border-color: #C0392B; }
.field-error { font-size: 12.5px; color: #C0392B; min-height: 16px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 6px; }
.form-status { font-size: 14px; }
.form-status.success { color: #2E7D32; }
.form-status.error { color: #C0392B; }

.contact-info {
  background: var(--charcoal);
  color: rgba(255,255,255,.85);
  border-radius: var(--radius);
  padding: 40px 34px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.whatsapp-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--whatsapp-green);
  color: var(--white);
  padding: 18px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  min-height: 56px;
  transition: transform .2s ease, filter .2s ease;
}
.whatsapp-cta:hover { transform: translateY(-2px); filter: brightness(1.06); }
.whatsapp-cta:active { transform: translateY(0); filter: brightness(.95); }
.whatsapp-cta svg { width: 26px; height: 26px; flex-shrink: 0; }

.contact-detail { display: flex; gap: 14px; align-items: flex-start; }
.contact-detail svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--gold-light); margin-top: 2px; }
.contact-detail a, .contact-detail p { font-size: 14.5px; color: rgba(255,255,255,.85); }
.contact-detail strong { display: block; color: var(--white); font-size: 14px; margin-bottom: 2px; }

.map-frame {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
}
.map-frame iframe { width: 100%; height: 220px; display: block; border: 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--charcoal);
  color: rgba(255,255,255,.6);
  padding: 56px 0 28px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 24px;
}
.footer-address { font-size: 14px; line-height: 1.8; }
.footer-address a { color: rgba(255,255,255,.75); }
.social-icons { display: flex; gap: 14px; }
.social-icons a {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  transition: background-color .2s ease, border-color .2s ease;
}
.social-icons a:hover { background: var(--gold); border-color: var(--gold); }
.social-icons svg { width: 18px; height: 18px; }
.footer-bottom { font-size: 13px; text-align: center; }

/* ============================================================
   WhatsApp flotante
   ============================================================ */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px; height: 60px;
  min-width: 56px; min-height: 56px;
  border-radius: 50%;
  background: var(--whatsapp-green);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(21,128,61,.45);
  z-index: 900;
  transition: transform .2s ease;
}
.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float:active { transform: scale(1.02); }
.whatsapp-float svg { width: 30px; height: 30px; }

/* ============================================================
   Imagenes con fallback degradado
   ============================================================ */
.img-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--cream), var(--gold-light));
  overflow: hidden;
}
.img-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.img-frame.is-broken img { display: none; }

/* ============================================================
   Animaciones de entrada
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.hero-content.reveal { transform: translateY(36px); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn,
  .btn-gold:hover,
  .whatsapp-cta,
  .whatsapp-cta:hover,
  .whatsapp-float,
  .whatsapp-float:hover,
  .mobile-nav,
  .nav-links a::after,
  .hamburger span,
  .social-icons a,
  .nav-links .dropdown { transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  :root { --section-pad: 64px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }
  .gold-band-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-media { aspect-ratio: 16/9; }
  .gallery-masonry { columns: 2 200px; }
  .benefits-strip { grid-template-columns: 1fr; gap: 24px; }
  .benefit-row { padding: 0; border-left: none !important; }
  .benefit-row:not(:first-child) { padding-top: 24px; border-top: 1px solid rgba(22,24,28,.12); }
}

@media (max-width: 640px) {
  .gold-band-grid { grid-template-columns: 1fr; }
  .gallery-masonry { columns: 1; }
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .hero-content { padding: 120px 20px 64px; }
  .footer-top { flex-direction: column; }
  .compare-tag { font-size: 10px; padding: 5px 10px; }
  .service-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas: "num body" ".   cta";
    row-gap: 14px;
    padding: 24px 0;
  }
  .service-num { grid-area: num; font-size: 18px; }
  .service-row-body { grid-area: body; }
  .service-row-body h3 { font-size: 17px; }
  .service-row .btn { grid-area: cta; justify-self: start; }
}

/* ============================================================
   Footer — columnas de navegación (compartido)
   ============================================================ */
.footer-brand { max-width: 340px; }
.footer-brand .footer-address { margin-top: 14px; }
.footer-brand .social-icons { margin-top: 18px; }
.footer-nav h4 {
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}
.footer-nav ul { display: grid; gap: 10px; }
.footer-nav a { color: rgba(255,255,255,.65); font-size: 14px; }
.footer-nav a:hover { color: var(--gold-light); }
@media (max-width: 640px) {
  .footer-brand { max-width: none; }
}

/* ============================================================
   Header — dropdown de Servicios (compartido)
   ============================================================ */
.nav-links .has-dropdown { position: relative; }
.nav-links .has-dropdown > a::before { content: ''; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; }
.nav-links .has-dropdown > a::after { content: '⌄'; margin-left: 5px; font-size: 12px; position: relative; top: -2px; }
.nav-links .dropdown {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 258px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 44px rgba(0,0,0,.14);
  padding: 10px;
  display: grid; gap: 2px;
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1200;
}
.nav-links .has-dropdown:hover .dropdown,
.nav-links .has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(6px);
}
.site-header .nav-links .dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--charcoal);
}
.nav-links .dropdown a::after { display: none; }
.site-header .nav-links .dropdown a:hover { background: var(--cream); color: var(--gold); }

/* Submenú en el menú móvil */
.mobile-nav .mobile-sub { font-size: 15px; color: var(--gold-light); margin-top: -16px; padding-left: 14px; }
