/* SUBFISCON — hoja de estilos principal. Mobile-first, sin frameworks. */

@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/exo2-variable.woff2") format("woff2-variations"),
       url("/assets/fonts/exo2-variable.woff2") format("woff2");
}

:root {
  /* Color — tomado de la identidad visual actual (logo, cabeceras) */
  --color-navy: #001f5e;
  --color-navy-dark: #001542;
  --color-navy-light: #12428f;
  --color-bg: #f9f9f9;
  --color-surface: #ffffff;
  --color-text: #333333;
  --color-text-muted: #5a5a5a;
  --color-border: #e2e5eb;
  --color-whatsapp: #25d366;
  --color-success: #1e7e34;
  --color-error: #b3261e;

  /* Tipografía */
  --font-base: "Exo 2", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --fs-sm: 0.9rem;
  --fs-base: 1rem;
  --fs-lg: 1.15rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;
  --lh-base: 1.6;

  /* Espaciado */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;

  /* Otros */
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 10px rgba(0, 31, 94, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 31, 94, 0.14);
  --max-width: 1180px;
  --header-h: 108px;
  --mobile-bar-h: 56px;
  --transition: 180ms ease;
}

/* Reset mínimo */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-navy); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.25em; }
main { display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-base);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.25;
  margin: 0 0 var(--space-2);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
p { margin: 0 0 var(--space-2); }

/* Foco visible accesible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-navy-light);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Saltar al contenido */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-navy);
  color: #fff;
  padding: var(--space-1) var(--space-2);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

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

/* ===== Cabecera de contacto superior ===== */
.top-bar {
  background: var(--color-navy);
  color: #fff;
  font-size: var(--fs-sm);
}
.top-bar .container {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: 6px;
  padding-bottom: 6px;
  flex-wrap: wrap;
}
.top-bar a { color: #fff; }
.top-bar a:hover { text-decoration: underline; }

/* ===== Cabecera principal ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  gap: var(--space-2);
}
.logo-link { display: flex; align-items: center; }
.logo-link img { height: 52px; width: auto; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }

.main-nav {
  display: none;
}
.main-nav.is-open { display: block; }
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
  display: flex;
  flex-direction: column;
}
.main-nav a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-text);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.main-nav a[aria-current="page"] { color: var(--color-navy); }

.has-submenu > button.submenu-toggle {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--color-text);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.has-submenu .submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-2);
  display: none;
}
.has-submenu.is-open .submenu { display: block; }
.has-submenu .submenu a { border-bottom: none; font-weight: 400; padding: 6px 0; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .main-nav { display: block; }
  .main-nav ul { flex-direction: row; padding: 0; gap: var(--space-3); align-items: center; }
  .main-nav a { border-bottom: none; padding: var(--space-1) 2px; }
  .has-submenu { position: relative; }
  .has-submenu > button.submenu-toggle { border-bottom: none; padding: var(--space-1) 2px; }
  .has-submenu .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    padding: var(--space-1);
    min-width: 220px;
    border-radius: var(--radius-sm);
  }
  .has-submenu .submenu a { padding: 8px 10px; border-radius: var(--radius-sm); }
  .has-submenu .submenu a:hover { background: var(--color-bg); text-decoration: none; }
}

/* ===== Botones ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: var(--fs-base);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
  min-height: 44px;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--color-navy); color: #fff; }
.btn-primary:hover { background: var(--color-navy-dark); color: #fff; }
.btn-whatsapp { background: var(--color-whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #1fb955; color: #fff; }
.btn-outline { background: transparent; border-color: var(--color-navy); color: var(--color-navy); }
.btn-outline:hover { background: var(--color-navy); color: #fff; }
.btn-block { width: 100%; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.service-cta {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.service-cta .cta-row {
  justify-content: center;
}

.service-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: var(--space-3);
  max-width: 220px;
}
.service-photo img { width: 100%; display: block; }

.office-gallery {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
  .office-gallery { grid-template-columns: repeat(3, 1fr); }
}
.office-gallery figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.office-gallery img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3;
  transition: transform 400ms ease;
}
.office-gallery figure:hover img { transform: scale(1.08); }

/* Revelado escalonado: cada tarjeta/foto entra un poco después que la anterior */
.js-reveal .grid > .reveal:nth-child(2) { transition-delay: 80ms; }
.js-reveal .grid > .reveal:nth-child(3) { transition-delay: 160ms; }
.js-reveal .grid > .reveal:nth-child(4) { transition-delay: 240ms; }
.js-reveal .grid > .reveal:nth-child(5) { transition-delay: 320ms; }
.js-reveal .grid > .reveal:nth-child(6) { transition-delay: 400ms; }
.js-reveal .office-gallery > .reveal:nth-child(2) { transition-delay: 60ms; }
.js-reveal .office-gallery > .reveal:nth-child(3) { transition-delay: 120ms; }
.js-reveal .office-gallery > .reveal:nth-child(4) { transition-delay: 180ms; }
.js-reveal .office-gallery > .reveal:nth-child(5) { transition-delay: 240ms; }
.js-reveal .office-gallery > .reveal:nth-child(6) { transition-delay: 300ms; }

.contact-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 260px;
}
.contact-photo img { width: 100%; display: block; }

.hero-photo {
  position: relative;
}
.hero.hero-photo,
.page-hero.hero-photo {
  background: none;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(120deg, rgba(0,21,66,.72) 0%, rgba(0,31,94,.55) 55%, rgba(18,66,143,.4) 100%);
}
.hero-photo .container { position: relative; z-index: 3; }

/* Varias fotos apiladas con crossfade (home) en vez de una sola estática */
.hero-photo .slide {
  opacity: 0;
  transition: opacity 1200ms ease;
}
.hero-photo .slide.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero-photo .slide { transition: none; }
}

/* ===== Carrusel compacto (galería de oficina) ===== */
.carousel {
  max-width: 420px;
  margin: 0 auto;
}
.carousel-viewport {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16/9;
  background: var(--color-navy-dark);
}
.carousel-viewport img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
}
.carousel-viewport img.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .carousel-viewport img { transition: none; }
}
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.carousel-arrow {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-navy);
  flex-shrink: 0;
}
.carousel-arrow:hover { background: var(--color-bg); }
.carousel-arrow svg { width: 18px; height: 18px; }
.carousel-dots {
  display: flex;
  gap: 8px;
}
.carousel-dots button {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
}
.carousel-dots button.is-active { background: var(--color-navy); }
.carousel-caption {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  margin-top: var(--space-1);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: #fff;
  padding: var(--space-5) 0;
  position: relative;
  overflow: hidden;
}
.hero h1 { color: #fff; }
.hero p { color: #dbe3f5; font-size: var(--fs-lg); max-width: 640px; }
.hero .cta-row { margin-top: var(--space-3); }

.page-hero {
  background: var(--color-navy);
  color: #fff;
  padding: var(--space-4) 0;
  position: relative;
  overflow: hidden;
}
.page-hero h1 { color: #fff; margin-bottom: 0; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  font-size: var(--fs-sm);
  padding: var(--space-1) 0;
  color: var(--color-text-muted);
}
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 4px; color: var(--color-border); }
.breadcrumbs a { color: var(--color-text-muted); }

/* ===== Secciones / tarjetas ===== */
.section { padding: var(--space-5) 0; }
.section-tight { padding: var(--space-4) 0; }
.section-alt { background: var(--color-surface); }

.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  /* Si el último elemento queda solo en su fila (p.ej. 7 tarjetas en 3 columnas), centrarlo */
  .grid-3 > *:last-child:nth-child(3n+1) { grid-column: 2; }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card h3 { margin-bottom: var(--space-1); }
.card a.card-link {
  position: absolute;
  inset: 0;
}
.card { position: relative; }
.card p:last-child { margin-bottom: 0; }

.card-photo { padding: 0; overflow: hidden; }
.card-photo .card-img {
  aspect-ratio: 16/11;
  overflow: hidden;
}
.card-photo .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.card-photo:hover .card-img img { transform: scale(1.06); }
.card-photo h3,
.card-photo p { padding-left: var(--space-3); padding-right: var(--space-3); }
.card-photo h3 { margin-top: var(--space-2); }
.card-photo p:last-of-type { padding-bottom: var(--space-3); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #a9c0e8;
  margin-bottom: var(--space-1);
}

.btn-lg { padding: 14px 26px; font-size: var(--fs-lg); }

.form-layout {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  align-items: start;
}
.form-lateral {
  display: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--header-h) + var(--space-2));
}
.form-lateral img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 900px) {
  .form-layout { grid-template-columns: 1fr 220px; }
  .form-lateral { display: block; }
}

.photo-band {
  max-width: 640px;
  margin: var(--space-4) auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.photo-band img { width: 100%; display: block; }

.blog-card-img {
  margin: calc(var(--space-3) * -1) calc(var(--space-3) * -1) var(--space-2);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-photo {
  max-width: 480px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.post-photo img { width: 100%; display: block; }

.service-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-1);
  color: var(--color-navy);
}

/* ===== Formularios ===== */
.form-field { margin-bottom: var(--space-2); }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--color-text);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field .hint { font-size: var(--fs-sm); color: var(--color-text-muted); }
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--color-error);
}
.form-field .error-msg {
  display: none;
  color: var(--color-error);
  font-size: var(--fs-sm);
  margin-top: 4px;
}
.form-field.has-error .error-msg { display: block; }
.form-consent { display: flex; gap: 10px; align-items: flex-start; }
.form-consent input { width: auto; margin-top: 4px; }

.form-status {
  display: none;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}
.form-status.is-success { display: block; background: #e7f5ec; color: var(--color-success); border: 1px solid #bfe3cc; }
.form-status.is-error { display: block; background: #fdecea; color: var(--color-error); border: 1px solid #f3c2bd; }

.honeypot-field { position: absolute; left: -9999px; top: -9999px; }

/* ===== Confianza / franjas ===== */
.trust-strip {
  background: var(--color-navy);
  color: #fff;
  padding: var(--space-3) 0;
}
.trust-strip .grid { text-align: center; }
.trust-strip strong { display: block; font-size: var(--fs-xl); color: #fff; }

/* ===== Footer ===== */
.site-footer {
  background: var(--color-navy-dark);
  color: #cdd6ea;
  padding: var(--space-5) 0 var(--space-4);
  margin-bottom: var(--mobile-bar-h);
}
.site-footer a { color: #e8edf8; }
.site-footer h2 { color: #fff; font-size: var(--fs-base); }
.footer-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  font-size: var(--fs-sm);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
}
@media (min-width: 720px) {
  .site-footer { margin-bottom: 0; }
}

/* ===== Barra fija móvil ===== */
.mobile-contact-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-bar-h);
  display: flex;
  z-index: 90;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}
.mobile-contact-bar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  color: #fff;
  font-size: var(--fs-sm);
}
.mobile-contact-bar a:hover { text-decoration: none; }
.mobile-contact-bar .bar-call { background: var(--color-navy); }
.mobile-contact-bar .bar-whatsapp { background: var(--color-whatsapp); }
.mobile-contact-bar svg { width: 20px; height: 20px; }
@media (min-width: 720px) {
  .mobile-contact-bar { display: none; }
}

/* ===== Botón flotante de WhatsApp ===== */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: calc(var(--mobile-bar-h) + 16px);
  width: 56px;
  height: 56px;
  min-width: 44px;
  min-height: 44px;
  background: var(--color-whatsapp);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  transition: transform var(--transition), background var(--transition);
}
.whatsapp-float:hover { background: #1fb955; transform: scale(1.06); text-decoration: none; }
.whatsapp-float:active { transform: scale(0.96); }
.whatsapp-float svg { width: 30px; height: 30px; }
@media (min-width: 720px) {
  .whatsapp-float { bottom: 20px; }
}

/* ===== Banner de cookies ===== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--color-navy-dark);
  color: #fff;
  padding: var(--space-2);
  z-index: 200;
  display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-banner .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: var(--fs-sm); max-width: 640px; }
.cookie-actions { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.cookie-actions button { min-height: 40px; padding: 8px 16px; }

/* ===== FAQ ===== */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: var(--space-2) 0;
  color: var(--color-navy);
}
.faq-item p { padding-bottom: var(--space-2); }

/* ===== Utilidades ===== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.list-check { list-style: none; padding: 0; }
.list-check li { position: relative; padding-left: 1.6em; margin-bottom: 8px; }
.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-navy);
  font-weight: 700;
}
.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;
}

/* ===== Revelado suave al hacer scroll =====
   Solo se oculta si JS confirma soporte (clase en <html>) y el usuario no pide
   movimiento reducido; sin JS o con reduced-motion, el contenido es visible desde el inicio. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== 404 ===== */
.error-page { padding: var(--space-6) 0; text-align: center; }
.error-page .code { font-size: 5rem; color: var(--color-navy); font-weight: 700; margin: 0; }
