/* ==========================================================================
   Agropix — sistema visual compartido para las páginas estáticas
   Tokens extraídos del sitio WordPress actual (Astra + Elementor kit 117)
   y del manual de marca (Montserrat, #52AA5E, #388659, #1E1E1E, #FF8811).
   ========================================================================== */

:root {
  /* Marca */
  --ax-orange: #ff8811;
  --ax-orange-dark: #e6730a;
  --ax-green: #52aa5e;
  --ax-green-dark: #388659;
  --ax-blue: #3d9ff9;

  /* Neutros */
  --ax-ink: #1e1e1e;
  --ax-text: #222222;
  --ax-muted: #5c6370;
  --ax-line: #dde3ea;
  --ax-bg-soft: #f4f7fb;
  --ax-white: #ffffff;
  --ax-dark-2: #2a2a2a;

  /* Tipografía */
  --ax-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ax-font-alt: "Maven Pro", var(--ax-font);
  --ax-font-btn: "Public Sans", var(--ax-font);

  /* Layout */
  --ax-container: 1140px;
  --ax-gutter: clamp(20px, 4vw, 30px);
  --ax-section-y: clamp(64px, 9vw, 100px);
  --ax-shadow-card: 10px 15px 28px rgba(92, 91, 103, 0.33);
  --ax-header-h: 90px;
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--ax-font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ax-text);
  background: var(--ax-white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ax-orange); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--ax-blue); }
h1, h2, h3, h4 { margin: 0; color: var(--ax-ink); line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ax-blue); outline-offset: 2px; }
.ax-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Layout ---------- */
.ax-container { width: 100%; max-width: calc(var(--ax-container) + var(--ax-gutter) * 2); margin: 0 auto; padding: 0 var(--ax-gutter); }
.ax-section { padding: var(--ax-section-y) 0; }
.ax-section--soft { background: var(--ax-bg-soft); }
.ax-section--dark {
  position: relative;
  background: var(--ax-ink);
  color: #e9ecef;
  padding-top: calc(var(--ax-section-y) + 40px);
}
/* Franja de pattern de marca (la misma de "Por qué elegirnos" en el home) */
.ax-section--dark::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 60px;
  background: url("../img/pattern.png") center top / auto 60px repeat-x;
}

/* ---------- Encabezados de sección ---------- */
.ax-eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 18px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
  color: var(--ax-green);
}
.ax-title {
  font-size: clamp(32px, 5.4vw, 60px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -1px;
  text-transform: uppercase;
  color: var(--ax-ink);
}
.ax-title strong { font-weight: 700; }
.ax-section--dark .ax-title { color: var(--ax-white); }
.ax-lead { margin-top: 18px; max-width: 680px; font-size: 18px; color: var(--ax-muted); }
.ax-section--dark .ax-lead { color: #b9c0c8; }
.ax-head { margin-bottom: clamp(36px, 5vw, 56px); }
.ax-head--center { text-align: center; }
.ax-head--center .ax-lead { margin-left: auto; margin-right: auto; }

/* ---------- Botones (cuadrados, naranja, Public Sans — igual que WP) ---------- */
.ax-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px;
  padding: 16px 32px;
  font-family: var(--ax-font-btn); font-size: 16px; font-weight: 600; line-height: 1.2;
  color: var(--ax-white); background: var(--ax-orange);
  border: 2px solid var(--ax-orange); border-radius: 0;
  cursor: pointer; text-align: center;
  transition: transform .3s ease-out, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ax-btn:hover { color: var(--ax-white); background: var(--ax-orange-dark); border-color: var(--ax-orange-dark); transform: translateY(-2px); }
.ax-btn:active { transform: translateY(0); }
.ax-btn--ghost { background: rgba(34, 34, 34, .11); border-color: var(--ax-white); }
.ax-btn--ghost:hover { background: var(--ax-white); border-color: var(--ax-white); color: var(--ax-ink); }
.ax-btn--outline { background: transparent; color: var(--ax-ink); border-color: var(--ax-ink); }
.ax-btn--outline:hover { background: var(--ax-ink); border-color: var(--ax-ink); color: var(--ax-white); }
.ax-btn--block { width: 100%; }
.ax-btn svg { flex: none; }

/* ==========================================================================
   HEADER — transparente sobre el hero, igual que el sitio actual
   ========================================================================== */
.ax-header {
  position: absolute; inset: 0 0 auto 0; z-index: 50;
  color: var(--ax-white);
}
.ax-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: var(--ax-header-h); }
.ax-header__logo { flex: none; }
.ax-header__logo img { width: 160px; height: auto; }
.ax-nav { display: flex; align-items: center; gap: 20px; }
.ax-nav__list { display: flex; align-items: center; list-style: none; gap: 2px; }
.ax-nav__list > li { position: relative; }
.ax-nav__list a, .ax-nav__toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  font-family: var(--ax-font); font-size: 14px; font-weight: 600; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .2px; white-space: nowrap;
  color: var(--ax-bg-soft);
}
.ax-nav__toggle { background: none; border: 0; cursor: pointer; }
.ax-nav__chev { transition: transform .2s ease; }
.ax-nav__list a:hover, .ax-nav__toggle:hover,
.ax-nav__list > li > a[aria-current="page"], .ax-nav__toggle[data-current] { color: var(--ax-green); }
.ax-header .ax-btn { min-height: 46px; padding: 12px 22px; font-size: 14px; white-space: nowrap; }

/* Submenú (desktop): panel blanco con línea naranja, como las cards del sitio */
.ax-sub {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 70;
  min-width: 250px; padding: 10px 0;
  list-style: none;
  background: var(--ax-white); box-shadow: var(--ax-shadow-card);
  border-bottom: 4px solid var(--ax-orange);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.ax-sub::before { content: ""; position: absolute; inset: -10px 0 auto 0; height: 10px; } /* puente para el hover */
.ax-sub a {
  padding: 10px 20px;
  font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--ax-ink);
}
.ax-sub a:hover, .ax-sub a[aria-current="page"] { color: var(--ax-green-dark); background: var(--ax-bg-soft); }
.ax-sub__all { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--ax-line); }
.ax-sub__all a { font-weight: 700; color: var(--ax-orange); }

.ax-burger {
  display: none; width: 46px; height: 46px; padding: 0;
  background: transparent; border: 2px solid rgba(255,255,255,.6); color: var(--ax-white); cursor: pointer;
}
.ax-burger svg { margin: auto; }

@media (min-width: 1200px) {
  .ax-nav__item--sub:hover > .ax-sub,
  .ax-nav__item--sub:focus-within > .ax-sub,
  .ax-nav__toggle[aria-expanded="true"] + .ax-sub { opacity: 1; visibility: visible; transform: none; }
  .ax-nav__item--sub:hover .ax-nav__chev,
  .ax-nav__toggle[aria-expanded="true"] .ax-nav__chev { transform: rotate(180deg); }
  .ax-nav__close, .ax-header__actions { display: none; }
}

/* Menú hamburguesa: hasta 1199px (entre 1025 y 1199 el menú completo no entra) */
@media (max-width: 1199px) {
  .ax-burger { display: inline-flex; }
  .ax-nav {
    position: fixed; inset: 0; z-index: 60;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 24px;
    padding: 100px var(--ax-gutter) 40px;
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--ax-ink);
    transform: translateX(100%); visibility: hidden;
    transition: transform .3s ease, visibility .3s;
  }
  .ax-nav::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 50px; background: url("../img/pattern.png") center / auto 50px repeat-x; }
  .ax-nav.is-open { transform: none; visibility: visible; }
  .ax-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .ax-nav__list > li { border-bottom: 1px solid rgba(255,255,255,.1); }
  .ax-nav__list a, .ax-nav__toggle { width: 100%; justify-content: space-between; padding: 16px 0; font-size: 17px; }
  .ax-nav__toggle[aria-expanded="true"] .ax-nav__chev { transform: rotate(180deg); }
  /* Submenú como acordeón */
  .ax-sub {
    position: static; min-width: 0; padding: 0 0 12px 14px;
    background: none; box-shadow: none; border: 0;
    opacity: 1; visibility: visible; transform: none; transition: none;
    display: none;
  }
  .ax-nav__toggle[aria-expanded="true"] + .ax-sub { display: block; }
  .ax-sub::before { display: none; }
  .ax-sub a { padding: 10px 0; font-size: 16px; color: #c9cfd6; }
  .ax-sub a:hover, .ax-sub a[aria-current="page"] { background: none; color: var(--ax-green); }
  .ax-sub__all { border-top: 0; margin-top: 0; padding-top: 0; }
  .ax-nav .ax-btn { width: 100%; min-height: 54px; }
  .ax-nav__close { position: absolute; top: 22px; right: var(--ax-gutter); }
  .ax-header__actions { display: flex; align-items: center; gap: 10px; }
}
@media (max-width: 480px) {
  .ax-header__logo img { width: 130px; }
  .ax-header__actions .ax-btn--compact { padding: 10px 16px; min-height: 46px; }
}

/* ==========================================================================
   FOOTER — réplica del footer de WordPress (#F4F7FB, 4 columnas)
   ========================================================================== */
.ax-footer { background: var(--ax-bg-soft); color: var(--ax-ink); }
.ax-footer__grid {
  display: grid; gap: 40px;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  padding-top: 80px; padding-bottom: 56px;
}
.ax-footer__brand img { width: 180px; margin-bottom: 18px; }
.ax-footer__brand p { font-size: 15px; color: var(--ax-muted); max-width: 300px; }
.ax-footer h4 { margin-bottom: 18px; font-family: var(--ax-font-alt); font-size: 22px; font-weight: 600; }
.ax-footer ul { list-style: none; display: grid; gap: 8px; }
.ax-footer li a, .ax-footer__contact a, .ax-footer__contact span { font-size: 16px; font-weight: 500; color: var(--ax-ink); }
.ax-footer li a:hover, .ax-footer__contact a:hover { color: var(--ax-orange); }
.ax-footer__contact { display: grid; gap: 10px; }
.ax-footer__contact > * { display: inline-flex; align-items: center; gap: 10px; }
.ax-footer__contact svg { color: var(--ax-orange); flex: none; }
.ax-footer__bottom { border-top: 1px solid var(--ax-line); }
.ax-footer__bottom .ax-container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.ax-footer__bottom p { font-size: 14px; color: var(--ax-muted); }
.ax-footer .ax-social, .ax-social { display: flex; gap: 14px; list-style: none; }
.ax-social a { display: inline-flex; color: #2d3183; }
.ax-social a:hover { color: var(--ax-orange); }

/* Barra legal (SSN) — obligatoria en páginas de seguros */
.ax-legal { background: var(--ax-ink); color: #b9c0c8; }
.ax-legal .ax-container { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; padding-top: 28px; padding-bottom: 28px; }
.ax-legal img { width: 120px; flex: none; }
.ax-legal__text { flex: 1 1 420px; display: grid; gap: 6px; font-size: 13px; line-height: 1.6; }
.ax-legal a { color: var(--ax-white); text-decoration: underline; }

@media (max-width: 960px) {
  .ax-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .ax-footer__grid { grid-template-columns: 1fr; padding-top: 56px; gap: 32px; }
}

/* ---------- WhatsApp flotante (igual que MyStickyElements en WP) ---------- */
.ax-wa {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; color: var(--ax-white);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  transition: transform .3s ease-out;
}
.ax-wa:hover { color: var(--ax-white); transform: scale(1.06); }
