/* ==========================================================================
   Grupo Aserpaz — Base / reset / tipografía / layout
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--az-header-h) + 16px);
}

body {
  margin: 0;
  background: var(--az-bg);
  color: var(--az-text);
  font-family: var(--az-font-body);
  font-size: var(--az-fs-body);
  line-height: var(--az-lh-body);
  font-weight: var(--az-fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.az-nav-open { overflow: hidden; }

img, svg, video { max-width: 100%; height: auto; display: block; }

/* ---------- Titulares ---------- */
h1, h2, h3, h4, h5, h6,
.az-h1, .az-h2, .az-h3 {
  font-family: var(--az-font-head);
  font-weight: var(--az-fw-bold);
  color: var(--az-navy-900);
  letter-spacing: var(--az-ls-tight);
  line-height: var(--az-lh-tight);
  margin: 0 0 var(--az-space-4);
  text-wrap: balance;
}

h1, .az-h1 { font-size: var(--az-fs-h1); }
h2, .az-h2 { font-size: var(--az-fs-h2); }
h3, .az-h3 { font-size: var(--az-fs-h3); line-height: var(--az-lh-snug); }
h4 { font-size: var(--az-fs-h4); font-weight: var(--az-fw-semibold); }
h5, h6 { font-size: var(--az-fs-body); font-weight: var(--az-fw-semibold); }

p { margin: 0 0 var(--az-space-4); max-width: 68ch; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: var(--az-fw-semibold); color: var(--az-navy-800); }

a {
  color: var(--az-link);
  text-decoration-color: color-mix(in srgb, var(--az-link) 35%, transparent);
  text-underline-offset: 3px;
  transition: color var(--az-dur-fast) var(--az-ease);
}
a:hover { color: var(--az-link-hover); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--az-accent-500);
  outline-offset: 3px;
  border-radius: var(--az-radius-xs);
}

ul, ol { margin: 0 0 var(--az-space-4); padding-left: 1.25rem; }
li { margin-bottom: var(--az-space-2); }

blockquote {
  margin: var(--az-space-6) 0;
  padding: var(--az-space-5) var(--az-space-6);
  border-left: 4px solid var(--az-accent-500);
  background: var(--az-blue-050);
  border-radius: 0 var(--az-radius-md) var(--az-radius-md) 0;
  font-size: var(--az-fs-lead);
  color: var(--az-navy-800);
}

hr { border: 0; border-top: 1px solid var(--az-border); margin: var(--az-space-8) 0; }

::selection { background: var(--az-blue-200); color: var(--az-navy-900); }

/* ---------- Utilidades de layout ---------- */
.az-container {
  width: 100%;
  max-width: var(--az-container);
  margin-inline: auto;
  padding-inline: var(--az-gutter);
}
.az-container--wide { max-width: var(--az-container-wide); }
.az-container--narrow { max-width: var(--az-container-narrow); }

.az-section { padding-block: var(--az-section-y); position: relative; }
.az-section--soft { background: var(--az-bg-soft); }
.az-section--gradient { background: var(--az-grad-soft); }
.az-section--dark { background: var(--az-bg-dark); color: rgba(255,255,255,.82); }
.az-section--dark :is(h1,h2,h3,h4,h5,h6) { color: var(--az-white); }
.az-section--dark strong { color: var(--az-white); }
.az-section--tight { padding-block: calc(var(--az-section-y) * 0.55); }

.az-grid { display: grid; gap: var(--az-space-6); }
.az-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.az-grid--3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.az-grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.az-stack > * + * { margin-top: var(--az-space-4); }
.az-center { text-align: center; }
.az-center p { margin-inline: auto; }

.az-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--az-z-modal);
  background: var(--az-navy-900); color: #fff;
  padding: var(--az-space-3) var(--az-space-5);
  border-radius: 0 0 var(--az-radius-sm) 0;
}
.az-skip-link:focus { left: 0; color: #fff; }

.az-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;
}

/* ---------- Encabezado de sección ---------- */
.az-eyebrow {
  display: inline-flex; align-items: center; gap: var(--az-space-2);
  font-family: var(--az-font-head);
  font-size: var(--az-fs-xs);
  font-weight: var(--az-fw-semibold);
  letter-spacing: var(--az-ls-wide);
  text-transform: uppercase;
  color: var(--az-blue-600);
  margin-bottom: var(--az-space-3);
}
.az-eyebrow::before {
  content: ""; width: 28px; height: 2px;
  background: var(--az-accent-500); border-radius: 2px;
}
.az-section--dark .az-eyebrow { color: var(--az-accent-400); }

.az-section-head { max-width: 720px; margin-bottom: var(--az-space-8); }
.az-section-head.az-center { margin-inline: auto; }
.az-section-head p {
  font-size: var(--az-fs-lead);
  color: var(--az-text-muted);
  line-height: 1.6;
}
.az-section--dark .az-section-head p { color: rgba(255,255,255,.75); }

/* ---------- Animación de entrada al hacer scroll ---------- */
.az-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--az-dur-slow) var(--az-ease-out),
              transform var(--az-dur-slow) var(--az-ease-out);
  will-change: opacity, transform;
}
.az-reveal.is-visible { opacity: 1; transform: none; }
.az-reveal[data-delay="1"] { transition-delay: 90ms; }
.az-reveal[data-delay="2"] { transition-delay: 180ms; }
.az-reveal[data-delay="3"] { transition-delay: 270ms; }
.az-reveal[data-delay="4"] { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .az-reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Impresión ---------- */
@media print {
  .az-topbar, .az-header, .az-footer, .az-float-cta, .az-cookie { display: none !important; }
  body { color: #000; font-size: 11pt; }
}
