/* =========================================================
   RINCÓN DE PIRIA — main.css
   Sistema de diseño extraído por muestreo real de píxeles
   de las capturas provistas por el cliente (no inferido).
   Fuentes: PENDIENTE de confirmación exacta (ver README).
   ========================================================= */

:root {
  /* Colores verificados (muestreados de las capturas reales) */
  --green-dark:      #2E4735; /* header, footer, cajas oscuras */
  --green-accent:    #2F7A52; /* tab / estado activo */
  --gold:             #DCA54A; /* botones y acentos */
  --gold-soft:        #E8C27C;
  --bg-cream:          #F9F9F6; /* fondo de secciones claras */
  --bg-white:          #FFFFFF;
  --text-heading:      #0F172A; /* títulos oscuros */
  --text-body:          #4B5563; /* texto de párrafo (estimado, confirmar) */
  --tab-inactive-bg:    #F1F2F3;
  --tab-inactive-text:  #4B5563;
  --border-light:       #E4E4E1;
  --whatsapp-green:     #25D366;

  /* Tipografía: placeholder razonado, PENDIENTE confirmar familia exacta */
  --font-heading: 'Poppins', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  /* Layout */
  --container-max: 1320px;
  --container-pad: 24px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --header-h: 132px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul { 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; }
input, select, textarea { font: inherit; }

html, body { overflow-x: hidden; } /* red de seguridad: ningún elemento debe generar scroll horizontal */

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--bg-cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--text-heading); }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding: 64px 0; }
.section--white { background: var(--bg-white); }
.section--cream { background: var(--bg-cream); }

.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 28px;
}

.section-title--center { text-align: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 4px;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .4px;
  text-transform: uppercase;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }

.btn--gold {
  background: var(--gold);
  color: #ffffff;
}

.btn--outline {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid #ffffff;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--green-dark);
  display: flex;
  align-items: center;
}

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

/* Logo real: 1280×853px → ratio ancho:alto ≈ 1.5. Se fija solo el alto y
   se deja width:auto para que el ancho se calcule solo — nunca se deforma.
   Tamaño aumentado explícitamente a pedido: debe tener presencia clara. */
.site-header__logo img { height: 104px; width: auto; }

.nav {
  display: flex;
  gap: 26px;
  flex-wrap: nowrap;
}

.nav a {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #EFEFE8;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s ease, border-color .15s ease;
}

.nav a:hover,
.nav a.is-active { color: var(--gold); border-color: var(--gold); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 30px;
}
.nav-toggle span { height: 2px; background: #fff; display: block; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  background-image:
    linear-gradient(90deg, rgba(20,30,20,.78) 0%, rgba(20,30,20,.45) 42%, rgba(20,30,20,.15) 70%),
    url('../images/foto-portada.jpeg');
}

.hero__content { max-width: 480px; color: #fff; padding: 40px 0; }
.hero__title { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; color: #fff; }
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 700;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-top: 6px;
  letter-spacing: .5px;
}
.hero__text { margin-top: 14px; font-size: .92rem; color: #E9E9E2; max-width: 380px; }
.hero__actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }

/* ---------- Qué es / genérico "texto + imagen" ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split__text p { margin-top: 14px; font-size: .95rem; }
.split__img img { border-radius: var(--radius-lg); width: 100%; object-fit: cover; }

.badges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.badge { text-align: left; }
.badge__icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-accent);
  margin-bottom: 10px;
}
.badge__icon svg { width: 30px; height: 30px; }
.badge__label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-heading);
  line-height: 1.3;
}

/* ---------- El Proyecto (stats) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.stat { text-align: center; }
.stat__icon { color: #6b7280; margin-bottom: 10px; }
.stat__icon svg { width: 40px; height: 40px; margin-inline: auto; }
.stat__value { font-weight: 800; font-size: 1.4rem; color: var(--text-heading); }
.stat__label { font-size: .8rem; color: var(--text-body); margin-top: 2px; }

/* ---------- Ubicación ---------- */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.8fr;
  gap: 28px;
  align-items: stretch;
}
.location-grid__map { border-radius: var(--radius-lg); overflow: hidden; min-height: 340px; }
.location-grid__map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; }
.location-grid__map img { width: 100%; height: 100%; min-height: 340px; object-fit: cover; object-position: center; }

.check-list li {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 12px; font-size: .92rem;
}
.check-list li svg { flex: none; width: 20px; height: 20px; color: var(--green-accent); margin-top: 2px; }

.access-box {
  background: var(--green-dark);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
}
.access-box h3 { color: #fff; font-size: 1.1rem; text-transform: uppercase; margin-bottom: 16px; }
.access-box li { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: .9rem; color: #EDEDE6; }
.access-box li svg { width: 18px; height: 18px; color: var(--gold); flex: none; }

/* ---------- Master Plan ---------- */
.masterplan { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.masterplan ul { margin-top: 14px; }
.masterplan li { font-size: .92rem; padding: 5px 0 5px 18px; position: relative; }
.masterplan li::before {
  content: ''; position: absolute; left: 0; top: 12px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-heading);
}
.masterplan__img { position: relative; cursor: pointer; }
.masterplan__img img { border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
.masterplan .btn { margin-top: 22px; }

/* ---------- Tipologías ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.type-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.type-card img { border-radius: var(--radius-md); height: 190px; width: 100%; object-fit: cover; margin-bottom: 14px; }
.type-card__title { font-weight: 800; font-size: 1rem; }
.type-card__title strong { color: var(--green-accent); }
.type-card__specs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-top: 16px; text-align: center;
}
.type-card__specs .spec svg { width: 24px; height: 24px; color: #6b7280; margin-inline: auto 4px; }
.type-card__specs .spec span { display: block; font-size: .72rem; margin-top: 4px; color: var(--text-body); }

/* ---------- Planos (tabs) ---------- */
.planos { display: grid; grid-template-columns: 220px 1fr 220px; gap: 24px; align-items: start; }
.tabs { display: flex; flex-direction: column; gap: 10px; }
.tab-btn {
  background: var(--tab-inactive-bg);
  color: var(--tab-inactive-text);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-align: center;
  transition: background .15s ease, color .15s ease;
}
.tab-btn.is-active { background: var(--green-accent); color: #fff; }

.plano-panel { display: none; }
.plano-panel.is-active { display: contents; }
.plano-panel__imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plano-panel__imgs img { border-radius: var(--radius-md); }

.room-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: .88rem; border-bottom: 1px dashed var(--border-light);
}
.room-list li svg { width: 18px; height: 18px; color: var(--green-accent); flex: none; }

/* ---------- Sistema constructivo ---------- */
.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.system-grid img { border-radius: var(--radius-md); width: 100%; }

/* ---------- Galería (slider) ---------- */
.gallery { position: relative; }
.gallery__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track img {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 260px; height: 190px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.gallery__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  z-index: 2;
}
.gallery__arrow--prev { left: -18px; }
.gallery__arrow--next { right: -18px; }
.gallery__dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.gallery__dots button { width: 8px; height: 8px; border-radius: 50%; background: var(--border-light); }
.gallery__dots button.is-active { background: var(--green-accent); width: 22px; border-radius: 5px; transition: width .2s; }

/* ---------- Por qué invertir ---------- */
.why { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.why-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.why-card { text-align: left; }
.why-card__icon { color: #4B5563; margin-bottom: 10px; }
.why-card__icon svg { width: 30px; height: 30px; }
.why-card__title { font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.why-card__text { font-size: .78rem; color: var(--text-body); }
.why__img img { border-radius: var(--radius-lg); height: 100%; object-fit: cover; }

/* ---------- Contacto / Form ---------- */
.contact { display: grid; grid-template-columns: 0.85fr 2fr; gap: 24px; align-items: start; }
.contact-box {
  background: var(--green-dark); color: #fff;
  border-radius: var(--radius-lg); padding: 30px;
}
.contact-box h3 { color: var(--gold); font-size: 1rem; text-transform: uppercase; margin-bottom: 10px; }
.contact-box p { font-size: .88rem; color: #E9E9E2; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start; /* evita que el <select> se estire a la altura del textarea vecino */
}
.form-grid .field--full { grid-column: 1 / -1; }
/* El mensaje ocupa las columnas 2-3 (Teléfono/Email), NO las 3 — así lo muestra la captura 12 */
.form-grid .field--span23 { grid-column: 2 / 4; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  font-size: .88rem;
  color: var(--text-heading);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder,
.field textarea::placeholder { color: #9CA3AF; }
.form-submit { margin-top: 16px; } /* sin grid-column explícito: cae solo en la columna 1, como en la captura */
.form-submit .btn { width: 100%; justify-content: center; }
.form-note { font-size: .78rem; margin-top: 10px; color: var(--text-body); }
.form-status { font-size: .85rem; margin-top: 10px; font-weight: 600; }
.form-status[data-state="ok"] { color: var(--green-accent); }
.form-status[data-state="error"] { color: #b91c1c; }
/* honeypot anti-spam field, oculto visualmente y para lectores de pantalla */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.footer { background: var(--green-dark); color: #EDEDE6; padding: 40px 0 20px; }
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 24px; padding-bottom: 24px;
}
.footer-brand img { height: 150px; width: auto; margin-bottom: 12px; }
.footer-brand p { color: var(--gold-soft); font-size: .85rem; }
.footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; margin-bottom: 10px; }
.footer address, .footer .contact-list { font-style: normal; font-size: .88rem; }
.footer a { color: var(--gold-soft); }
.footer .contact-list li { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.footer .contact-list svg { width: 16px; height: 16px; flex: none; }
.footer .contact-list .wa svg { color: var(--whatsapp-green); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 16px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: .78rem; color: var(--gold-soft);
}

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900; /* por debajo del lightbox (1000) para que no lo tape */
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--whatsapp-green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.whatsapp-float svg { width: 30px; height: 30px; fill: #fff; }
.whatsapp-float:hover {
  transform: scale(1.07);
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.whatsapp-float:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .whatsapp-float { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .whatsapp-float svg { width: 26px; height: 26px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .92);
  display: none;
  align-items: center; justify-content: center;
  padding: 40px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 6px; }
.lightbox__close {
  position: absolute; top: 22px; right: 26px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

/* ---------- Utilidades de accesibilidad ---------- */
.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;
}

/* ---------- Skip link (accesibilidad) ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #fff; color: #000; padding: 10px 16px; z-index: 2000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* =========================================================
   RESPONSIVE — breakpoints estimados (a confirmar con
   los "additional_custom_breakpoints" reales de Elementor)
   ========================================================= */
@media (max-width: 1024px) {
  .split, .masterplan, .why { grid-template-columns: 1fr; }
  .location-grid { grid-template-columns: 1fr; }
  .planos { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .why-cards { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  /* El menú de 9 links no entra en el header a partir de ~1024px sin
     desbordarse o apretarse ilegiblemente; Elementor 4.2.2 usa 1024px
     como breakpoint de "tablet" por defecto (el sitio declara
     additional_custom_breakpoints en el generator, así que puede variar
     — ajustar este valor si el sitio real usa otro punto de corte). */
  .nav { display: none; }
  .nav-toggle { display: flex; }

  /* Logo un poco más chico en tablet, misma proporción (width:auto) */
  :root { --header-h: 112px; }
  .site-header__logo img { height: 86px; }
}

@media (max-width: 768px) {
  :root { --header-h: 92px; }
  .site-header__logo img { height: 70px; }
  .footer-brand img { height: 116px; }

  .nav.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--green-dark); padding: 18px 24px; gap: 14px;
  }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
  .why-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--span23,
  .form-grid .field--full { grid-column: 1 / -1; } /* evita referenciar columnas 2-4 inexistentes → causaba overflow horizontal en mobile */
  .form-submit { grid-column: 1 / -1; }
  .form-submit .btn { width: 100%; } /* en mobile sí ocupa el ancho completo, como el resto de los campos apilados */
  .footer-grid { grid-template-columns: 1fr; text-align: left; }
  .contact { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .hero { min-height: 560px; }
}

@media (max-width: 480px) {
  .badges { grid-template-columns: 1fr 1fr; }
  .why-cards { grid-template-columns: 1fr 1fr; }
  .gallery__track img { width: 200px; height: 150px; }
  /* En pantallas angostas las flechas (posicionadas en -18px) podían quedar
     parcialmente fuera del viewport y generar scroll horizontal.
     El swipe táctil sobre .gallery__track y los dots ya cubren la navegación. */
  .gallery__arrow { display: none; }
}
