/* ==========================================================
   CBA de Monterrey · Piso Veneciano
   Mobile-first. Marca: azul #016BAA, blanco, carbón #181919.
   WhatsApp conserva su verde #25D366.
   ========================================================== */

:root {
  --blue: #016BAA;
  --blue-deep: #04486f;
  --ink: #181919;
  --ink-soft: #4a4f52;
  --white: #ffffff;
  --mist: #eef5f9;
  --line: #d9e3ea;
  --wa: #25D366;
  --wa-hover: #1fbd5b;

  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r: 14px;          /* imágenes, paneles */
  --r-btn: 12px;      /* botones y campos */
  --gutter: clamp(20px, 5vw, 40px);
  --section: clamp(56px, 9vw, 104px);
  --header-h: 64px;
  --shadow: 0 1px 2px rgba(24, 25, 25, .06), 0 8px 24px rgba(24, 25, 25, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.center { display: flex; justify-content: center; margin-top: 36px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Tipografía ---------- */
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 7.6vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 5.4vw, 2.6rem); }
h3 { font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.25; }
p { text-wrap: pretty; }
.lead { font-size: clamp(1.05rem, 2.6vw, 1.2rem); color: var(--ink-soft); max-width: 46ch; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--r-btn);
  font-weight: 600; text-decoration: none; text-align: center; line-height: 1.2;
  border: 2px solid transparent; cursor: pointer;
  transition: background-color .2s, transform .2s, box-shadow .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 56px; padding: 0 26px; font-size: 1.02rem; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-wa { background: var(--wa); color: var(--ink); box-shadow: 0 6px 18px rgba(37, 211, 102, .32); }
.btn-wa:hover { background: var(--wa-hover); transform: translateY(-1px); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.ico { width: 22px; height: 22px; flex: none; }
.ico-lg { width: 30px; height: 30px; flex: none; color: var(--blue); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 8px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-logo { display: none; height: 40px; width: auto; max-width: 160px; object-fit: contain; }
.brand.has-logo .brand-logo { display: block; }
.brand.has-logo .brand-text { display: none; }
.brand-text { white-space: nowrap; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; color: var(--blue); line-height: 1; }
.brand-text small { font-size: .62em; font-weight: 600; color: var(--ink); letter-spacing: 0; }

.lbl-long { display: none; }

.burger { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; position: relative; flex: none; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, top .25s; }
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.nav {
  position: absolute; left: 0; right: 0; top: 100%;
  display: none; flex-direction: column;
  padding: 8px var(--gutter) 20px;
  background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 30px rgba(24, 25, 25, .08);
}
.nav.open { display: flex; }
.nav a { padding: 14px 0; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line); }
.nav a:last-child { border-bottom: 0; }

/* ---------- Mosaico (tiles generados por JS) ---------- */
.mosaic { position: absolute; inset: 0; background: #d3e4ee; display: grid; gap: 2px; padding: 2px; overflow: hidden; }
.mosaic i { display: block; border-radius: 2px; }
.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Hero ---------- */
.hero { padding-block: 20px clamp(44px, 6vw, 72px); }
.hero-grid { display: grid; gap: 32px; }
.hero-copy { display: flex; flex-direction: column; gap: 20px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.hero-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 22px; margin-top: 8px; border-top: 1px solid var(--line); }
.hero-facts dt { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--blue); line-height: 1.1; }
.hero-facts dd { font-size: .9rem; color: var(--ink-soft); line-height: 1.35; margin-top: 4px; }

.hero-visual { position: relative; order: -1; aspect-ratio: 16 / 11; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: #d3e4ee; }
.hero-visual .mosaic i { opacity: 0; animation: tile-in .55s ease-out forwards; }
@keyframes tile-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

/* ---------- Secciones ---------- */
.section { padding-block: var(--section); }
.section-tint { background: var(--mist); }
.section-head { max-width: 640px; margin-bottom: 36px; display: grid; gap: 14px; }
.section-head p, .split-head p { color: var(--ink-soft); max-width: 52ch; }

.split { display: grid; gap: 36px; }
.split-head { display: grid; gap: 16px; align-content: start; }

.uses { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.uses li { padding: 7px 14px; border: 1px solid var(--blue); color: var(--blue-deep); border-radius: 999px; font-size: .92rem; font-weight: 500; background: #fff; }

.feature-list { display: grid; }
.feature-list li { display: flex; gap: 18px; padding-block: 20px; border-top: 1px solid var(--line); }
.feature-list li:last-child { border-bottom: 1px solid var(--line); }
.feature-list h3 { margin-bottom: 4px; }
.feature-list p { color: var(--ink-soft); font-size: .98rem; }
.section-tint .feature-list li { border-color: #cfdde6; }

/* ---------- Galería ---------- */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: 74%;
  gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 16px;
  scrollbar-width: thin;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
}
.gallery li { scroll-snap-align: start; }
.tile-btn {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5;
  border: 0; padding: 0; border-radius: var(--r); overflow: hidden; cursor: pointer;
  background: #d3e4ee; box-shadow: var(--shadow);
}
.tile-btn .mosaic, .tile-btn .photo { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.tile-btn:hover .mosaic, .tile-btn:hover .photo { transform: scale(1.05); }
.tile-label {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .94);
  font-weight: 600; font-size: .95rem; text-align: left;
}

/* ---------- Proyectos ---------- */
.projects { display: grid; gap: 14px; }
.project { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: #d3e4ee; box-shadow: var(--shadow); isolation: isolate; }
.project .photo, .project .mosaic { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.project:hover .photo, .project:hover .mosaic { transform: scale(1.04); }
.project::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(24, 25, 25, .86), rgba(24, 25, 25, .4) 42%, rgba(24, 25, 25, 0) 72%); pointer-events: none; }
.project-body { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 20px; display: grid; gap: 12px; justify-items: start; color: #fff; }
.project-body h3 { font-size: 1.4rem; }
.project-cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  background: var(--wa); color: var(--ink); font-weight: 600; font-size: .95rem;
  border-radius: var(--r-btn); text-decoration: none; transition: background-color .2s;
}
.project-cta:hover { background: var(--wa-hover); }
.project-cta .ico { width: 20px; height: 20px; }

/* ---------- CTA intermedio ---------- */
.band { background: var(--blue); color: #fff; padding-block: clamp(44px, 7vw, 72px); }
.band-in { display: grid; gap: 24px; align-items: center; }
.band h2 { margin-bottom: 10px; }
.band p { color: rgba(255, 255, 255, .88); max-width: 48ch; }

/* ---------- Formulario ---------- */
.form { display: grid; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; gap: 18px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid #b9c8d2; border-radius: var(--r-btn); background: #fff;
  font-size: 1rem; /* 16px evita zoom en iOS */
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1, 107, 170, .18); }
.field.invalid input { border-color: #c0392b; }
.err { color: #b3261e; font-size: .88rem; min-height: 0; }
.form-note { font-size: .9rem; color: var(--ink-soft); min-height: 1.4em; }
.form-note a { color: var(--blue); font-weight: 600; }

/* ---------- Confianza ---------- */
.section-dark { background: var(--ink); color: #fff; }
.trust-head { display: grid; gap: 16px; max-width: 720px; margin-bottom: 40px; }
.trust-head p { color: rgba(255, 255, 255, .78); max-width: 56ch; }
.branches { display: grid; gap: 0; }
.branches li { display: grid; gap: 6px; padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, .18); }
.branches li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .18); }
.branches h3 { color: #fff; }
.branches address { font-style: normal; color: rgba(255, 255, 255, .78); font-size: .98rem; max-width: 38ch; }
.branches a { display: inline-flex; align-items: center; min-height: 44px; color: #7cc7ee; font-weight: 600; text-decoration: none; width: fit-content; }
.branches a:hover { text-decoration: underline; }

/* ---------- FAQ ---------- */
.faq { display: grid; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding-block: 14px; cursor: pointer; list-style: none;
  font-family: var(--font-head); font-weight: 600; font-size: 1.08rem; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.chev { width: 22px; height: 22px; flex: none; color: var(--blue); transition: transform .25s; }
.faq details[open] .chev { transform: rotate(180deg); }
.faq details p { padding-bottom: 20px; color: var(--ink-soft); max-width: 60ch; }

/* ---------- CTA final ---------- */
.final { background: var(--blue); color: #fff; padding-block: clamp(56px, 9vw, 96px); text-align: center; }
.final-in { display: grid; gap: 18px; justify-items: center; }
.final h2 { max-width: 20ch; }
.final p { color: rgba(255, 255, 255, .9); max-width: 44ch; }
.final .btn { margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .72); padding-block: 32px calc(32px + 76px); font-size: .92rem; }
.foot-in { display: grid; gap: 6px; }
.foot-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: #fff; }

/* ---------- WhatsApp flotante ---------- */
.fab {
  position: fixed; z-index: 60;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  transition: opacity .25s, transform .25s;
}
.fab.hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
.fab-icon { width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: var(--ink); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(24, 25, 25, .28); transition: transform .2s; }
.fab-icon .ico { width: 30px; height: 30px; }
.fab:hover .fab-icon { transform: scale(1.06); }
.fab-label { display: none; padding: 10px 16px; background: #fff; border-radius: 999px; font-weight: 600; font-size: .95rem; box-shadow: var(--shadow); }

/* ---------- Visor ---------- */
.lightbox { width: min(92vw, 460px); max-height: 92dvh; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; background: #fff; }
.lightbox::backdrop { background: rgba(24, 25, 25, .72); }
.lb-frame { position: relative; aspect-ratio: 4 / 5; max-height: 66dvh; width: 100%; background: #d3e4ee; }
.lb-frame .photo { display: none; }
.lb-frame .photo.on { display: block; }
.lb-close, .lb-nav { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .95); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); z-index: 3; }
.lb-close { top: 10px; right: 10px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.lb-bar p { font-weight: 600; }

/* ---------- Reveal (sutil) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================
   ≥ 480px
   ========================================================== */
@media (min-width: 480px) {
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .gallery { grid-auto-columns: 52%; }
  .field-row { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================
   ≥ 768px (tablet)
   ========================================================== */
@media (min-width: 768px) {
  :root { --header-h: 72px; }
  .brand-text { font-size: 1.35rem; }
  .lbl-short { display: none; }
  .lbl-long { display: inline; }
  .btn-sm { padding: 0 20px; }
  .hero { padding-top: 48px; }
  .hero-visual { aspect-ratio: 16 / 9; }
  .gallery { grid-auto-columns: 34%; }
  .projects { grid-template-columns: 1fr 1fr; }
  .project-lg { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
  .band-in { grid-template-columns: 1fr auto; gap: 40px; }
  .branches { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .branches li { border-bottom: 0 !important; }
  .branches li:last-child { border-bottom: 0 !important; }
  .fab-label { display: inline-block; }
  .form { padding: 32px; }
}

/* ==========================================================
   ≥ 1024px (desktop)
   ========================================================== */
@media (min-width: 1024px) {
  .burger { display: none; }
  .nav { position: static; display: flex; flex-direction: row; gap: 28px; padding: 0; background: none; border: 0; box-shadow: none; margin-right: 12px; }
  .nav a { padding: 8px 0; border: 0; font-size: .96rem; color: var(--ink-soft); position: relative; }
  .nav a:hover { color: var(--ink); }
  .nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
  .nav a:hover::after { transform: scaleX(1); }
  .brand { margin-right: auto; }

  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
  .hero-visual { order: 0; aspect-ratio: 4 / 4.6; }

  .split { grid-template-columns: 5fr 7fr; gap: 72px; }
  .split-form { grid-template-columns: 5fr 7fr; }
  .split-head { position: sticky; top: calc(var(--header-h) + 32px); }

  .gallery { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; margin-inline: 0; padding: 0; gap: 16px; scroll-snap-type: none; }
  .projects { grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 18px; }
  .project-lg { grid-column: 1; grid-row: 1 / span 2; aspect-ratio: auto; min-height: 520px; }
  .project:not(.project-lg) { aspect-ratio: auto; }
  .feature-list-2 { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .feature-list-2 li:nth-last-child(2) { border-bottom: 1px solid #cfdde6; }
}

@media (min-width: 1440px) {
  .wrap { max-width: 1280px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
