/* ============================================================
   APG · Agro Proyectos del Guadiana — styles.css
   Manual de Identidad Visual APG · 2026
   HTML5 + CSS moderno + JS nativo · Mobile first
   v2 — Paleta azul + degradado verde-azul del logo protagonista.
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
  /* Paleta oficial del manual */
  --apg-green-dark: #002e00;    /* Verde Guadiana profundo */
  --apg-green-primary: #007149; /* Verde esmeralda */
  --apg-green-leaf: #479348;    /* Verde hoja */
  --apg-blue: #00748e;          /* Azul Guadiana */
  --apg-black: #000000;
  --apg-white: #ffffff;

  /* Azules derivados (para dar protagonismo al azul del logo) */
  --apg-blue-deep: #003a49;     /* azul profundo para fondos */
  --apg-blue-ink: #06485a;      /* azul texto sobre claro */
  --apg-blue-bright: #1591ae;   /* azul luminoso, acentos */

  /* Degradado de marca (verde esmeralda -> azul Guadiana) */
  --grad-brand: linear-gradient(115deg, #007149 0%, #00748e 100%);
  --grad-brand-soft: linear-gradient(115deg, #0a8158 0%, #128aa6 100%);
  /* Fondo oscuro: verde profundo -> teal -> azul (introduce el azul) */
  --grad-dark: linear-gradient(150deg, #002400 0%, #01342f 52%, #013a49 100%);
  --grad-dark-panel: linear-gradient(155deg, #013222 0%, #023a44 100%);

  /* Funcionales — superficies frías (menos verde plano) */
  --c-ink: #14261f;             /* texto principal sobre claro */
  --c-ink-soft: #40564e;        /* texto secundario */
  --c-surface: #f1f6f7;         /* superficie clara azulada */
  --c-surface-2: #e6eff1;       /* superficie alterna */
  --c-line: #d5e2e2;            /* líneas y bordes suaves */
  --c-blue-tint: #e2eef2;       /* tinta clara del azul */
  --c-green-tint: #e6f0e9;      /* tinta clara del verde */
  --c-text-on-dark: #cfe0e2;    /* texto secundario sobre oscuro */
  --c-link-on-dark: #7fd3e8;    /* enlaces sobre oscuro (AA) */
  --c-leaf-on-dark: #74c58c;    /* acento verde claro sobre oscuro */
  --c-error: #b3261e;
  --c-error-bg: #fceceb;
  --c-success: #0c5a30;
  --c-success-bg: #e7f4ec;

  /* Tipografía */
  --font-head: "Montserrat", Arial, system-ui, sans-serif;
  --font-body: "Inter", Arial, system-ui, sans-serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9rem;
  --fs-base: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.45vw, 1.25rem);
  --fs-h4: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
  --fs-h3: clamp(1.2rem, 1.05rem + 0.8vw, 1.55rem);
  --fs-h2: clamp(1.55rem, 1.25rem + 1.6vw, 2.35rem);
  --fs-h1: clamp(2rem, 1.45rem + 2.7vw, 3.25rem);
  --fs-display: clamp(2.2rem, 1.5rem + 3.4vw, 3.8rem);

  /* Espaciado */
  --sp-2xs: 0.375rem;
  --sp-xs: 0.625rem;
  --sp-sm: 1rem;
  --sp-md: 1.5rem;
  --sp-lg: 2.25rem;
  --sp-xl: clamp(2.5rem, 2rem + 2.5vw, 4.5rem);
  --sp-section: clamp(3.5rem, 2.5rem + 5vw, 7rem);

  /* Layout */
  --w-container: 1200px;
  --w-narrow: 820px;
  --w-reading: 68ch;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* Radios y sombras */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(1, 40, 46, 0.08);
  --shadow-md: 0 14px 34px -16px rgba(1, 40, 46, 0.28);
  --shadow-lg: 0 30px 60px -28px rgba(1, 40, 46, 0.42);

  --header-h: clamp(88px, 9.5vw + 20px, 122px);
  --t-fast: 160ms ease;
  --t-med: 320ms ease;
}

/* ------------------------------------------------------------
   2. RESET Y BASE
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--apg-white);
  overflow-x: clip;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.16;
  color: var(--apg-green-dark);
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: var(--fs-h4); font-weight: 700; }

p, ul, ol { margin: 0 0 1em; }
p, li { max-width: var(--w-reading); }

a {
  color: var(--apg-blue-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}
a:hover { color: var(--apg-blue-bright); }

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

::selection { background: var(--apg-blue); color: var(--apg-white); }

/* Utilidades */
.container {
  width: min(var(--w-container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.container--narrow {
  width: min(var(--w-narrow), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: var(--sp-sm);
  z-index: 300;
  padding: 0.7em 1.2em;
  background: var(--apg-green-dark);
  color: var(--apg-white);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--fs-sm);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none;
  transition: top var(--t-fast);
}
.skip-link:focus-visible { top: 0; color: var(--apg-white); }

/* ------------------------------------------------------------
   3. BOTONES
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 50px;
  padding: 0.75em 1.6em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast),
    border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}
.btn svg { width: 1.15em; height: 1.15em; }

.btn--primary {
  background: var(--grad-brand);
  color: var(--apg-white);
  box-shadow: 0 10px 24px -12px rgba(0, 116, 142, 0.7);
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); color: var(--apg-white); }

.btn--ghost {
  background: transparent;
  color: var(--apg-blue-ink);
  border-color: var(--c-line);
}
.btn--ghost:hover { border-color: var(--apg-blue); color: var(--apg-blue); background: var(--c-blue-tint); }

.btn--on-dark {
  background: var(--apg-white);
  color: var(--apg-blue-ink);
}
.btn--on-dark:hover { background: #eef7f9; color: var(--apg-blue-ink); transform: translateY(-1px); }

.btn--outline-on-dark {
  background: rgba(255, 255, 255, 0.06);
  color: var(--apg-white);
  border-color: rgba(255, 255, 255, 0.55);
}
.btn--outline-on-dark:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--apg-white);
  color: var(--apg-white);
}

.btn--block { width: 100%; }

/* ------------------------------------------------------------
   4. ETIQUETAS TÉCNICAS (kickers, tags de fase)
   ------------------------------------------------------------ */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  margin: 0 0 0.7em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--apg-blue);
}
.kicker::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
}
.kicker--on-dark { color: var(--c-link-on-dark); }
.kicker--on-dark::before { background: linear-gradient(90deg, var(--c-leaf-on-dark), var(--c-link-on-dark)); }

.phase-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3em 0.85em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--apg-blue-ink);
  background: var(--c-blue-tint);
  border-radius: 999px;
}

/* ------------------------------------------------------------
   5. CABECERA Y NAVEGACIÓN
   ------------------------------------------------------------ */
.site-header {
  position: relative;
  z-index: 100;
  background: var(--apg-white);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  min-height: var(--header-h);
  padding-block: 10px;
}
.site-header__brand { display: inline-flex; align-items: center; flex: none; }
.site-header__brand img {
  width: auto;
  height: clamp(68px, 9.5vw, 102px); /* logo más grande (v2.2) */
}

.site-nav { display: flex; align-items: center; gap: var(--sp-md); }
.site-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0; margin: 0; padding: 0;
}
.site-nav__link {
  display: block;
  padding: 0.85em 0.35em;
  font-family: var(--font-head);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--apg-green-dark);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.site-nav__link:hover,
.site-nav__link[aria-current="page"],
.site-nav__link.is-active {
  color: var(--apg-blue);
  border-bottom-color: var(--apg-blue);
}
.site-nav__cta { margin-top: var(--sp-sm); }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px; height: 48px;
  padding: 12px;
  background: none;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle__bar {
  width: 100%; height: 2px;
  background: var(--apg-green-dark);
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.js .site-nav {
  position: absolute;
  top: 100%; left: 0; right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: var(--sp-sm) var(--gutter) var(--sp-md);
  background: var(--apg-white);
  border-bottom: 1px solid var(--c-line);
  box-shadow: var(--shadow-md);
}
.js .site-nav[hidden] { display: none; }
.js .site-nav__link {
  padding: 0.85em 0.25em;
  border-bottom: 1px solid var(--c-line);
  font-size: 1rem;
}
.no-js .nav-toggle { display: none; }
.no-js .site-header__inner { flex-wrap: wrap; }

@media (min-width: 980px) {
  .nav-toggle { display: none; }
  .site-nav { gap: clamp(1.25rem, 2.8vw, 2.25rem); }
  .js .site-nav, .no-js .site-nav {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .js .site-nav[hidden] { display: flex; }
  /* Cápsula flotante que envuelve los enlaces (v2.3) */
  .js .site-nav__list, .site-nav__list {
    flex-direction: row;
    align-items: center;
    gap: clamp(0.1rem, 0.5vw, 0.35rem);
    padding: 5px;
    background: var(--apg-white);
    border: 1px solid var(--c-line);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
  }
  .js .site-nav__link, .site-nav__link {
    padding: 0.6em 1.05em;
    border-bottom: 0;
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--apg-green-dark);
    transition: color var(--t-fast), background-color var(--t-fast);
  }
  .site-nav__link:hover {
    color: var(--apg-blue-ink);
    background: var(--c-blue-tint);
    border-bottom-color: transparent;
  }
  .site-nav__link[aria-current="page"],
  .site-nav__link.is-active {
    color: var(--apg-white);
    background: var(--grad-brand);
    border-bottom-color: transparent;
    box-shadow: 0 8px 18px -11px rgba(0, 116, 142, 0.8);
  }
  .site-nav__cta {
    margin: 0;
    padding-left: clamp(1.25rem, 2.8vw, 2.25rem);
    border-left: 1px solid var(--c-line);
  }
  .site-header {
    position: sticky;
    top: 0;
    backdrop-filter: saturate(1.1) blur(2px);
    background: rgba(255, 255, 255, 0.92);
  }
}

/* ------------------------------------------------------------
   5b. BARRA SUPERIOR DE CONTACTO (v2.4)
   Iconos en azul Guadiana (color de la onda del logo).
   ------------------------------------------------------------ */
.topbar {
  background: var(--apg-white);
  border-bottom: 1px solid var(--c-line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  min-height: 40px;
  padding-block: 6px;
  flex-wrap: wrap;
}
.topbar__group, .topbar__social { display: flex; align-items: center; }
.topbar__group { gap: clamp(0.9rem, 2.5vw, 1.75rem); }
.topbar__social { gap: clamp(0.7rem, 2vw, 1.05rem); }
.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--apg-blue);
  text-decoration: none;
}
.topbar__link:hover { color: var(--apg-blue-bright); }
.topbar__social a {
  display: inline-flex;
  color: var(--apg-blue);
  transition: color var(--t-fast), transform var(--t-fast);
}
.topbar__social a:hover { color: var(--apg-blue-bright); transform: translateY(-1px); }
.topbar svg { width: 17px; height: 17px; color: var(--apg-blue); }
.topbar__social svg { width: 18px; height: 18px; }
@media (max-width: 520px) {
  .topbar__hide-sm { display: none; }
  .topbar__group { gap: 1rem; }
}

/* ------------------------------------------------------------
   6. HERO PANORÁMICO (banda a todo el ancho, más baja)
   ------------------------------------------------------------ */
.hero-band {
  position: relative;
  min-height: clamp(440px, 62vh, 640px);
  display: grid;
  isolation: isolate;
  overflow: clip;
  background: var(--apg-green-dark);
  color: var(--apg-white);
}
.hero-band__slides { position: absolute; inset: 0; z-index: -2; }
.hero-band__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1000ms ease;
}
.hero-band__slide.is-active { opacity: 1; }
.hero-band__slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

/* --- Transición de BARRIDO (wipe) del slideshow -----------------------------
   En modo barrido (root con [data-wipe]) la imagen entrante se coloca encima y
   una máscara CSS animada (variable --wipe: 0→1) la va revelando. La saliente
   queda visible debajo. Si el navegador no soporta máscaras/@property o hay
   reduced-motion, JS no añade [data-wipe] y se mantiene el fundido cruzado. */
@property --wipe {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}
@keyframes hero-wipe { from { --wipe: 0; } to { --wipe: 1; } }

/* En barrido, la entrante no debe además desvanecerse: la revela la máscara. */
.hero-band[data-wipe] .hero-band__slide { transition: none; }

/* Suavidad por defecto del borde; JS la sobreescribe con CONFIG.wipeSoftness. */
.hero-band[data-wipe] { --soft: 9%; }

.hero-band[data-wipe] .hero-band__slide.is-entering {
  z-index: 1;
  --p: calc(var(--wipe) * 100%);
  --r: calc(var(--wipe) * 200%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  animation: hero-wipe var(--wipe-dur, 1100ms) cubic-bezier(0.45, 0, 0.25, 1) forwards;
}

/* Radial: iris circular desde el centro (por defecto) */
.hero-band[data-wipe="radial"] .hero-band__slide.is-entering {
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
          mask-image: radial-gradient(circle at 50% 50%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
}
.hero-band[data-wipe="radial"].is-revert .hero-band__slide.is-entering {
  -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
          mask-image: radial-gradient(circle at 100% 0%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
}

/* Elipse: iris elíptico desde el centro */
.hero-band[data-wipe="ellipse"] .hero-band__slide.is-entering {
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
          mask-image: radial-gradient(ellipse at 50% 50%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
}
.hero-band[data-wipe="ellipse"].is-revert .hero-band__slide.is-entering {
  -webkit-mask-image: radial-gradient(ellipse at 0% 100%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
          mask-image: radial-gradient(ellipse at 0% 100%, #000 calc(var(--r) - var(--soft)), transparent calc(var(--r) + var(--soft)));
}

/* Lineal: barrido de izquierda a derecha */
.hero-band[data-wipe="linear"] .hero-band__slide.is-entering {
  -webkit-mask-image: linear-gradient(to right, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
          mask-image: linear-gradient(to right, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
}
.hero-band[data-wipe="linear"].is-revert .hero-band__slide.is-entering {
  -webkit-mask-image: linear-gradient(to left, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
          mask-image: linear-gradient(to left, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
}

/* Diagonal: barrido en diagonal */
.hero-band[data-wipe="diagonal"] .hero-band__slide.is-entering {
  -webkit-mask-image: linear-gradient(135deg, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
          mask-image: linear-gradient(135deg, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
}
.hero-band[data-wipe="diagonal"].is-revert .hero-band__slide.is-entering {
  -webkit-mask-image: linear-gradient(315deg, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
          mask-image: linear-gradient(315deg, #000 calc(var(--p) - var(--soft)), transparent calc(var(--p) + var(--soft)));
}
/* Velo con el degradado de marca para legibilidad y para "traer" el azul */
.hero-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 36, 0, 0.82) 0%, rgba(1, 52, 47, 0.55) 42%, rgba(1, 58, 73, 0.22) 100%),
    linear-gradient(0deg, rgba(1, 46, 40, 0.7) 0%, rgba(1, 46, 40, 0) 55%);
}
.hero-band__inner {
  align-self: end;
  width: min(var(--w-container), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(2rem, 3vw, 3.25rem);
}
.hero-band__content { max-width: 660px; }

.hero-claim {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1rem;
  padding: 0.4em 1em 0.4em 0.55em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apg-white);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.hero-claim__dot {
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--grad-brand);
  flex: none;
}
.hero-band h1 {
  color: var(--apg-white);
  font-size: var(--fs-display);
  margin-bottom: 0.5em;
}
.hero-band h1 em {
  font-style: normal;
  background: linear-gradient(115deg, #57d6a0 0%, #7fd3e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-band__subtitle {
  font-size: var(--fs-lead);
  color: #eaf4f2;
  max-width: 46ch;
}
.hero-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}
.hero-band__support {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: var(--sp-md) 0 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  color: #d7ece7;
}
.hero-band__support svg { width: 1.2em; height: 1.2em; color: var(--c-leaf-on-dark); }

/* Controles del slideshow */
.hero-controls {
  position: absolute;
  right: max(var(--gutter), calc((100% - var(--w-container)) / 2 + var(--gutter)));
  bottom: clamp(1.25rem, 3vw, 2rem);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hero-controls__btn {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--apg-white);
  background: rgba(0, 30, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.hero-controls__btn:hover { background: rgba(0, 116, 142, 0.75); border-color: var(--apg-white); }
.hero-controls__btn svg { width: 20px; height: 20px; }
.hero-controls__dots { display: flex; gap: 0.4rem; }
.hero-controls__dot {
  width: 10px; height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
.hero-controls__dot[aria-current="true"] { background: var(--apg-white); transform: scale(1.25); }

@media (max-width: 620px) {
  .hero-band::before {
    background:
      linear-gradient(0deg, rgba(0, 32, 0, 0.9) 0%, rgba(1, 52, 55, 0.5) 55%, rgba(1, 58, 73, 0.25) 100%);
  }
  .hero-band__slide img { object-position: center 45%; }
}

/* ------------------------------------------------------------
   7. HERO INTERIOR (páginas secundarias)
   ------------------------------------------------------------ */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  color: var(--apg-white);
  background: var(--grad-dark);
}
.page-hero--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
}
.page-hero__inner {
  width: min(var(--w-container), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(2.75rem, 6vw, 5rem);
  max-width: none;
}
.page-hero__content { max-width: 720px; }
.page-hero h1 { color: var(--apg-white); }
.page-hero p {
  font-size: var(--fs-lead);
  color: #e7f2f0;
  max-width: 60ch;
}
.breadcrumbs {
  margin: 0 0 1.1rem;
  font-size: var(--fs-sm);
  color: var(--c-text-on-dark);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0; padding: 0;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.5em; max-width: none; }
.breadcrumbs li + li::before { content: "›"; color: rgba(255, 255, 255, 0.5); }
.breadcrumbs a { color: var(--c-link-on-dark); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: #eaf4f2; }

/* Migas sobre fondo claro (páginas legales/blog) */
.breadcrumbs--light { color: var(--c-ink-soft); }
.breadcrumbs--light a { color: var(--apg-blue-ink); }
.breadcrumbs--light li + li::before { color: var(--c-line); }
.breadcrumbs--light [aria-current="page"] { color: var(--c-ink); }

/* ------------------------------------------------------------
   8. SECCIONES GENERALES
   ------------------------------------------------------------ */
.section { padding-block: var(--sp-section); }
.section--surface { background: var(--c-surface); }
.section--tint { background: var(--c-blue-tint); }
.section--dark {
  background: var(--grad-dark);
  color: var(--c-text-on-dark);
}
.section--dark h2, .section--dark h3 { color: var(--apg-white); }
.section--dark a { color: var(--c-link-on-dark); }

.section__head { max-width: 62ch; margin-bottom: var(--sp-xl); }
.section__head.is-center { margin-inline: auto; text-align: center; }
.section__head.is-center .kicker { justify-content: center; }
.section__lead { font-size: var(--fs-lead); color: var(--c-ink-soft); margin-bottom: 0; }
.section--dark .section__lead { color: var(--c-text-on-dark); }

/* ------------------------------------------------------------
   9. BLOQUE PROBLEMA-SOLUCIÓN
   ------------------------------------------------------------ */
.problem {
  display: grid;
  gap: var(--sp-xl);
  align-items: stretch;
}
@media (min-width: 900px) { .problem { grid-template-columns: 1.15fr 0.85fr; } }

.problem__intro {
  display: flex;
  flex-direction: column;
}
.problem__subtitle {
  margin: 0 0 var(--sp-md);
  font-size: var(--fs-h4);
  color: var(--apg-green-dark);
}
.problem__note {
  margin: var(--sp-md) 0 var(--sp-lg);
  max-width: 60ch;
  color: var(--c-ink-soft);
}
.problem__cta {
  align-self: flex-start;
  margin-top: auto;
}

.problem__factors {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0; padding: 0;
}
.problem__factors li {
  display: flex;
  align-items: center;
  gap: 0.65em;
  max-width: none;
  padding: 0.85em 1em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--apg-green-dark);
  background: var(--apg-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
}
.problem__factors svg { width: 1.35em; height: 1.35em; color: var(--apg-blue); flex: none; }

.problem__issues {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-lg);
  background: var(--grad-dark-panel);
  color: var(--apg-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.problem__issues ul { width: 100%; }
.problem__issues h3 { color: var(--apg-white); }
.problem__issues ul { list-style: none; margin: 0; padding: 0; }
.problem__issues li {
  position: relative;
  max-width: none;
  padding: 0.5em 0 0.5em 1.6em;
  color: #dceceb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.problem__issues li:last-child { border-bottom: 0; }
.problem__issues li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.95em;
  width: 12px; height: 12px;
  border-radius: 3px;
  background: linear-gradient(115deg, var(--c-leaf-on-dark), var(--c-link-on-dark));
}

/* Animación de entrada del panel "Problemas habituales" (una sola vez) */
@media (prefers-reduced-motion: no-preference) {
  .problem__issues.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .problem__issues.reveal.is-in { opacity: 1; transform: none; }
  .problem__issues.reveal li { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .problem__issues.reveal.is-in li { opacity: 1; transform: none; }
  .problem__issues.reveal li::before { transform: scale(0); }
  .problem__issues.reveal.is-in li::before { transform: scale(1); transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.55, 1); }
  .problem__issues.reveal.is-in li:nth-child(1) { transition-delay: 0.14s; } .problem__issues.reveal.is-in li:nth-child(1)::before { transition-delay: 0.2s; }
  .problem__issues.reveal.is-in li:nth-child(2) { transition-delay: 0.21s; } .problem__issues.reveal.is-in li:nth-child(2)::before { transition-delay: 0.27s; }
  .problem__issues.reveal.is-in li:nth-child(3) { transition-delay: 0.28s; } .problem__issues.reveal.is-in li:nth-child(3)::before { transition-delay: 0.34s; }
  .problem__issues.reveal.is-in li:nth-child(4) { transition-delay: 0.35s; } .problem__issues.reveal.is-in li:nth-child(4)::before { transition-delay: 0.41s; }
  .problem__issues.reveal.is-in li:nth-child(5) { transition-delay: 0.42s; } .problem__issues.reveal.is-in li:nth-child(5)::before { transition-delay: 0.48s; }
  .problem__issues.reveal.is-in li:nth-child(6) { transition-delay: 0.49s; } .problem__issues.reveal.is-in li:nth-child(6)::before { transition-delay: 0.55s; }
}

/* ------------------------------------------------------------
   10. SERVICIOS
   ------------------------------------------------------------ */
.service-feature {
  display: grid;
  gap: var(--sp-lg);
  align-items: center;
  margin-bottom: var(--sp-xl);
}
@media (min-width: 860px) {
  .service-feature { grid-template-columns: 1fr 1fr; gap: var(--sp-xl); }
  .service-feature--reverse .service-feature__media { order: 2; }
}
.service-feature__media {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 10;
}
.service-feature__media img { width: 100%; height: 100%; object-fit: cover; }
.service-feature__meta { margin-bottom: 0.6em; }
.service-feature__list { list-style: none; margin: 1em 0 1.5em; padding: 0; }
.service-feature__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  max-width: none;
  margin-bottom: 0.55em;
}
.service-feature__list svg { width: 1.25em; height: 1.25em; color: var(--apg-green-primary); flex: none; margin-top: 0.2em; }
.service-feature__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-head);
  font-weight: 700;
  text-decoration: none;
  color: var(--apg-blue);
}
.service-feature__link:hover { color: var(--apg-blue-bright); gap: 0.6em; }

.service-grid {
  display: grid;
  gap: var(--sp-md);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
@media (min-width: 820px) {
  .service-grid--3 { grid-template-columns: repeat(3, 1fr); }
}
.service-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-lg);
  background: var(--apg-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--c-blue-tint); }
.service-card__icon {
  width: 46px; height: 46px;
  padding: 10px;
  margin-bottom: var(--sp-sm);
  color: var(--apg-white);
  background: var(--grad-brand);
  border-radius: var(--r-md);
}
.service-card h3 { margin-bottom: 0.4em; }
.service-card p { color: var(--c-ink-soft); flex: 1; }
.service-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}
.service-card__foot a {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--apg-blue);
}
.service-card__foot a:hover { color: var(--apg-blue-bright); }
.service-card--blue { border-top: 3px solid var(--apg-blue); }

/* ------------------------------------------------------------
   11. CULTIVOS
   ------------------------------------------------------------ */
.crops {
  display: grid;
  gap: var(--sp-md);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.crop {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--apg-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.crop:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.crop__media { aspect-ratio: 16 / 10; overflow: hidden; }
.crop__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-med); }
.crop:hover .crop__media img { transform: scale(1.04); }
.crop__body { display: flex; flex-direction: column; flex: 1; padding: var(--sp-lg); }
.crop__body h2,
.crop__body h3 {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.crop__body h2 svg,
.crop__body h3 svg { width: 1.3em; height: 1.3em; flex: none; color: var(--apg-green-primary); }
.crop p { color: var(--c-ink-soft); }
.crop__points { list-style: none; margin: 0.3em 0 1.2em; padding: 0; flex: 1; }
.crop__points li {
  position: relative;
  max-width: none;
  padding: 0.3em 0 0.3em 1.4em;
  font-size: 0.95rem;
}
.crop__points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.75em;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--grad-brand);
}
.crop__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-head);
  font-weight: 700;
  text-decoration: none;
  color: var(--apg-blue);
}
.crop__link:hover { gap: 0.6em; }

/* Tarjeta de cultivo sin fotografía (viñedo, frutales…) */
.crop--service::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--grad-brand);
}
.crop--service .crop__body { padding-top: var(--sp-md); }

/* Aviso "otro cultivo" bajo la rejilla de cultivos */
.crops-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-top: var(--sp-lg);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--apg-white);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--apg-blue);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.crops-more__text h3 { margin-bottom: 0.3em; }
.crops-more__text p { margin: 0; color: var(--c-ink-soft); max-width: 62ch; }
.crops-more .btn { flex: none; }

/* Banner de cultivos en la home (enlaza a la página Cultivos) v2.6 */
.crop-banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(260px, 32vw, 400px);
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.crop-banner__media { position: absolute; inset: 0; z-index: -2; }
.crop-banner__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-med);
}
.crop-banner::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(0,46,0,0.88) 0%, rgba(1,52,60,0.72) 46%, rgba(1,58,73,0.20) 100%);
}
.crop-banner:hover .crop-banner__media img { transform: scale(1.04); }
.crop-banner__content {
  max-width: 620px;
  padding: clamp(1.75rem, 4.5vw, 3.25rem);
  color: var(--apg-white);
}
.crop-banner__content p {
  font-size: var(--fs-lead);
  color: #eaf4f2;
  margin: 0 0 var(--sp-lg);
}
.crop-banner:focus-visible { outline: 3px solid var(--apg-blue-bright); outline-offset: 3px; }

/* ============================================================
   BLOG · índice con grid dinámico (masonry) v2.7
   ============================================================ */
.blog-grid { columns: 3 300px; column-gap: var(--sp-md); }
@media (max-width: 900px) { .blog-grid { columns: 2 260px; } }
@media (max-width: 560px) { .blog-grid { columns: 1; } }
.blog-card { break-inside: avoid; margin: 0 0 var(--sp-md); }
.blog-card[hidden] { display: none; }
.blog-card__link {
  display: block;
  background: var(--apg-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.blog-card__link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.blog-card__media { position: relative; background: var(--grad-dark); overflow: hidden; min-height: 110px; }
.blog-card__media img { width: 100%; height: auto; display: block; transition: transform var(--t-med); }
.blog-card__link:hover .blog-card__media img { transform: scale(1.05); }
.blog-card__body { padding: var(--sp-md); }
.blog-card__cat {
  display: inline-block; margin-bottom: 0.55em;
  font-family: var(--font-head); font-weight: 700; font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--apg-blue-ink);
  background: var(--c-blue-tint); padding: 0.35em 0.75em; border-radius: 999px;
}
.blog-card__title { font-size: var(--fs-h4); margin: 0 0 0.5em; color: var(--apg-green-dark); }
.blog-card__excerpt { color: var(--c-ink-soft); font-size: 0.94rem; margin: 0 0 1em; }
.blog-card__more { font-family: var(--font-head); font-weight: 700; color: var(--apg-blue); font-size: 0.9rem; }
.blog-card__link:hover .blog-card__more { color: var(--apg-blue-bright); }
.blog-card--soon .blog-card__body { position: relative; }
.blog-card__soon {
  display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: 0.8rem;
  color: var(--c-ink-soft); background: var(--c-surface-2); padding: 0.3em 0.75em; border-radius: 999px;
}

.pagination { display: flex; justify-content: center; align-items: center; gap: 0.4rem; margin-top: var(--sp-xl); }
.pagination button {
  min-width: 44px; height: 44px; padding: 0 0.8em;
  font-family: var(--font-head); font-weight: 700; font-size: 0.95rem;
  border: 1px solid var(--c-line); background: var(--apg-white); color: var(--apg-green-dark);
  border-radius: 999px; cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.pagination button:hover { border-color: var(--apg-blue); color: var(--apg-blue); }
.pagination button[aria-current="true"] { background: var(--grad-brand); color: var(--apg-white); border-color: transparent; }
.pagination button:disabled { opacity: 0.45; cursor: default; }

/* Filtro de etiquetas del blog */
.blog-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 var(--sp-lg); }
.blog-filter__btn {
  font-family: var(--font-head); font-weight: 600; font-size: 0.9rem;
  color: var(--apg-blue-ink); background: var(--apg-white);
  border: 1px solid var(--c-line); padding: 0.5em 1.05em; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 0.45em;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.blog-filter__btn:hover { border-color: var(--apg-blue); color: var(--apg-blue); }
.blog-filter__btn[aria-pressed="true"] { background: var(--grad-brand); color: var(--apg-white); border-color: transparent; }
.blog-filter__btn:focus-visible { outline: 3px solid var(--apg-blue-bright); outline-offset: 2px; }
.blog-filter__count { font-size: 0.78em; font-weight: 700; opacity: 0.75; }
.blog-filter__btn[aria-pressed="true"] .blog-filter__count { opacity: 0.95; }
.blog-empty { text-align: center; color: var(--c-ink-soft); padding: var(--sp-lg) 0; }

/* ============================================================
   ARTÍCULO · maquetación rica (reutilizable en los 10 posts)
   ============================================================ */
.article-hero { position: relative; isolation: isolate; color: var(--apg-white); background: var(--grad-dark); overflow: clip; }
.article-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center; opacity: 0.30; }
.article-hero__inner { width: min(var(--w-container), 100% - 2 * var(--gutter)); margin-inline: auto; padding-block: clamp(2.5rem, 6vw, 5rem); }
.article-hero__cat { display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-link-on-dark); background: rgba(255,255,255,0.12); padding: 0.4em 0.9em; border-radius: 999px; margin-bottom: 1rem; }
.article-hero h1 { color: var(--apg-white); max-width: 22ch; }
.article-hero__meta { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.1rem; font-size: 0.9rem; color: #dcecea; }
.article-hero__meta span { display: inline-flex; align-items: center; gap: 0.4em; }
.article-hero__meta svg { width: 16px; height: 16px; }

.article { width: min(var(--w-reading), 100% - 2 * var(--gutter)); margin-inline: auto; padding-block: var(--sp-xl); }
.article__lead { font-size: var(--fs-lead); color: var(--c-ink); font-weight: 500; }
.article h2 { font-size: var(--fs-h3); margin: 1.8em 0 0.55em; color: var(--apg-green-dark); scroll-margin-top: calc(var(--header-h) + 1rem); }
.article h2 .a-num { color: var(--apg-blue); font-variant-numeric: tabular-nums; }
.article h3 { margin: 1.3em 0 0.4em; font-size: var(--fs-h4); color: var(--apg-green-dark); }
.article p { color: var(--c-ink-soft); }
.article ul.a-bullets { list-style: none; padding: 0; margin: 0.6em 0 1.3em; }
.article ul.a-bullets li { position: relative; padding: 0.25em 0 0.25em 1.5em; color: var(--c-ink-soft); }
.article ul.a-bullets li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 8px; border-radius: 2px; background: var(--grad-brand); }

.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.7em 0 1.4em; padding: 0; list-style: none; }
.chip-list li { font-family: var(--font-head); font-weight: 600; font-size: 0.86rem; color: var(--apg-blue-ink); background: var(--c-blue-tint); border: 1px solid var(--c-line); padding: 0.4em 0.85em; border-radius: 999px; max-width: none; }

.a-callout { display: flex; gap: 0.9rem; padding: var(--sp-md) var(--sp-lg); margin: 1.6em 0; background: var(--c-green-tint); border-left: 4px solid var(--apg-green-primary); border-radius: var(--r-md); }
.a-callout svg { flex: none; width: 26px; height: 26px; color: var(--apg-green-primary); margin-top: 0.1em; }
.a-callout p { margin: 0; color: var(--apg-blue-ink); }

.a-quote { margin: 1.9em 0; padding: var(--sp-md) var(--sp-lg); font-family: var(--font-head); font-weight: 600; font-size: var(--fs-h4); line-height: 1.42; color: var(--apg-green-dark); border-left: 4px solid var(--apg-blue); background: var(--c-surface); border-radius: var(--r-md); }

.a-cards { display: grid; gap: var(--sp-md); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 1.4em 0; }
.a-card { padding: var(--sp-md); background: var(--apg-white); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.a-card h3 { margin: 0 0 0.3em; display: flex; align-items: center; gap: 0.5em; }
.a-card__n { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; color: var(--apg-white); background: var(--grad-brand); border-radius: 999px; }
.a-card p { margin: 0; font-size: 0.92rem; }

.a-split { display: grid; gap: var(--sp-md); margin: 1.4em 0; }
@media (min-width: 720px) { .a-split { grid-template-columns: 1fr 1fr; } }
.a-split__box { padding: var(--sp-md) var(--sp-lg); border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--apg-white); }
.a-split__box h3 { margin: 0 0 0.4em; }

.article-cta { margin: var(--sp-xl) auto 0; width: min(var(--w-container), 100% - 2 * var(--gutter)); padding: var(--sp-lg); background: var(--grad-dark-panel); color: var(--apg-white); border-radius: var(--r-xl); text-align: center; }
.article-cta h2 { color: var(--apg-white); margin: 0 0 0.4em; }
.article-cta p { color: #dceceb; margin: 0 0 1.2em; max-width: 60ch; margin-inline: auto; }

.article-more { width: min(var(--w-container), 100% - 2 * var(--gutter)); margin: var(--sp-xl) auto 0; }
.article-more h2 { font-size: var(--fs-h3); margin-bottom: var(--sp-md); }

.article-figure { width: min(var(--w-container), 100% - 2 * var(--gutter)); margin: calc(-1 * clamp(1.5rem, 4vw, 3rem)) auto 0; position: relative; z-index: 1; }
.article-figure img { width: 100%; height: auto; display: block; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------
   12. PROCESO DE TRABAJO — FLUJO ANIMADO (pflow)
   Línea de progreso ligada al scroll, nodos que se encienden e
   iconos que se dibujan al activarse cada fase. Sin librerías:
   geometría calculada en main.js (initProcessFlow). Funciona
   sin JavaScript y respeta prefers-reduced-motion.
   ------------------------------------------------------------ */
.pflow { position: relative; --pflow-p: 0; }
.pflow__steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
}

/* Raíl de progreso (posición y altura calculadas por JS) */
.pflow__rail {
  display: none;
  position: absolute;
  z-index: 0;
  width: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(-50%);
}
.pflow.is-ready .pflow__rail { display: block; }
.pflow__rail-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--c-leaf-on-dark) 0%, var(--c-link-on-dark) 100%);
  box-shadow: 0 0 16px rgba(127, 211, 232, 0.35);
  transform: scaleY(var(--pflow-p));
  transform-origin: top center;
  transition: transform 120ms linear;
}
.pflow__rail-dot {
  position: absolute;
  left: 50%;
  top: calc(var(--pflow-p) * 100%);
  width: 15px; height: 15px;
  border-radius: 999px;
  background: var(--apg-white);
  box-shadow: 0 0 0 4px rgba(21, 145, 174, 0.45), 0 0 22px 6px rgba(127, 211, 232, 0.5);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--t-fast), top 120ms linear;
}
.pflow.is-started .pflow__rail-dot { opacity: 1; }

/* Paso: nodo + tarjeta */
.pflow__step {
  position: relative;
  z-index: 1;
  max-width: none;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: clamp(1rem, 3vw, 1.6rem);
  align-items: start;
}
.pflow__node {
  position: relative;
  width: 64px; height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.82);
  background: var(--grad-dark-panel);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color var(--t-med), color var(--t-med), box-shadow var(--t-med);
}
/* Capa con el degradado de marca que se funde al activarse */
.pflow__node::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--t-med);
}
/* Onda de activación (se ejecuta una sola vez por fase) */
.pflow__node::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  opacity: 0;
}
.pflow__icon { position: relative; z-index: 1; width: 28px; height: 28px; }
.pflow__icon :is(path, circle) {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 800ms ease 250ms;
}
.pflow__num {
  position: absolute;
  z-index: 1;
  top: -7px; right: -7px;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--apg-white);
  background: var(--apg-green-dark);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}
.pflow__card {
  position: relative;
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-lg);
  opacity: 1;
  transform: none;
  transition: opacity 600ms ease 100ms, transform 600ms ease 100ms,
    border-color var(--t-med), background-color var(--t-med), box-shadow var(--t-med);
}
.pflow__phase {
  margin: 0 0 0.5em;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-link-on-dark);
}
.pflow__card h2, .pflow__card h3 {
  color: var(--apg-white);
  font-size: var(--fs-h4);
  margin: 0 0 0.4em;
}
.pflow--detail .pflow__card h2 { font-size: var(--fs-h3); }
.pflow__card p { color: var(--c-text-on-dark); margin: 0; }
.pflow__card p + .pflow__points { margin-top: 0.9em; }
.pflow__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45em; }
.pflow__points li {
  position: relative;
  max-width: none;
  padding-left: 1.5em;
  color: #dceceb;
  font-size: 0.95rem;
}
.pflow__points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5em;
  width: 10px; height: 10px;
  border-radius: 3px;
  background: linear-gradient(115deg, var(--c-leaf-on-dark), var(--c-link-on-dark));
}

/* Estado inicial oculto: solo cuando el JS ha preparado el flujo */
.pflow.is-ready .pflow__step:not(.is-active) .pflow__card {
  opacity: 0;
  transform: translateY(22px);
}
.pflow.is-ready .pflow__step:not(.is-active) .pflow__icon :is(path, circle) {
  stroke-dashoffset: 1;
}

/* Fase activa */
.pflow__step.is-active .pflow__node {
  color: var(--apg-white);
  border-color: transparent;
  transform: scale(1.06);
  box-shadow: 0 12px 30px -10px rgba(0, 116, 142, 0.65);
}
.pflow__step.is-active .pflow__node::before { opacity: 1; }
.pflow__step.is-active .pflow__node::after {
  animation: pflow-ripple 900ms ease-out forwards;
}
.pflow__step.is-active .pflow__card {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(127, 211, 232, 0.32);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.5);
}
@keyframes pflow-ripple {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(127, 211, 232, 0.5); }
  100% { opacity: 0; box-shadow: 0 0 0 26px rgba(127, 211, 232, 0); }
}

/* Escritorio: raíl central y tarjetas alternadas a ambos lados */
@media (min-width: 920px) {
  .pflow__step {
    grid-template-columns: 1fr 96px 1fr;
    gap: clamp(1rem, 2.5vw, 2rem);
  }
  .pflow__node { grid-column: 2; justify-self: center; }
  .pflow__card { grid-column: 3; grid-row: 1; max-width: 520px; }
  .pflow__step:nth-child(even) .pflow__card { grid-column: 1; justify-self: end; }
  /* Conector nodo → tarjeta */
  .pflow__card::before {
    content: "";
    position: absolute;
    top: 31px;
    left: -28px;
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, rgba(127, 211, 232, 0.55), rgba(127, 211, 232, 0));
    opacity: 0;
    transition: opacity var(--t-med) 200ms;
  }
  .pflow__step:nth-child(even) .pflow__card::before {
    left: auto;
    right: -28px;
    background: linear-gradient(270deg, rgba(127, 211, 232, 0.55), rgba(127, 211, 232, 0));
  }
  .pflow__step.is-active .pflow__card::before { opacity: 1; }
}

/* Movimiento reducido: sin ocultaciones ni onda */
@media (prefers-reduced-motion: reduce) {
  .pflow.is-ready .pflow__step:not(.is-active) .pflow__card { opacity: 1; transform: none; }
  .pflow.is-ready .pflow__step:not(.is-active) .pflow__icon :is(path, circle) { stroke-dashoffset: 0; }
  .pflow__step.is-active .pflow__node::after { animation: none; }
  /* Seguridad: sin barrido con reduced-motion (JS ya evita [data-wipe]). */
  .hero-band[data-wipe] .hero-band__slide.is-entering {
    animation: none;
    -webkit-mask-image: none; mask-image: none;
  }
}

/* ------------------------------------------------------------
   13. ECOSISTEMA EMPRESARIAL
   ------------------------------------------------------------ */
.ecosystem {
  display: grid;
  gap: var(--sp-md);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.eco-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-lg);
  background: var(--apg-white);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--apg-green-primary);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.eco-card--blue { border-left-color: var(--apg-blue); }
.eco-card--dark { border-left-color: var(--apg-green-dark); }
.eco-card h3 { margin-bottom: 0.35em; }
.eco-card p { color: var(--c-ink-soft); flex: 1; }
.eco-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-top: var(--sp-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--apg-blue);
}
.eco-card__link:hover { gap: 0.6em; }

/* ------------------------------------------------------------
   14. CONTACTO (estilo dos columnas)
   ------------------------------------------------------------ */
.contact-block {
  display: grid;
  gap: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--apg-white);
}
@media (min-width: 940px) { .contact-block { grid-template-columns: 0.9fr 1.1fr; } }

.contact-aside {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.75rem, 4vw, 3rem);
  color: var(--apg-white);
  background: var(--grad-dark-panel);
}
.contact-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  opacity: 0.16;
}
.contact-aside h2 { color: var(--apg-white); }
.contact-aside > p { color: #d8ebe8; }
.contact-channels { list-style: none; margin: var(--sp-md) 0 0; padding: 0; }
.contact-channels li {
  display: flex;
  align-items: flex-start;
  gap: 0.9em;
  max-width: none;
  padding: 0.9em 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.contact-channels li:first-child { border-top: 0; }
.contact-channels__icon {
  flex: none;
  width: 42px; height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--apg-white);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.contact-channels__icon svg { width: 20px; height: 20px; }
.contact-channels__label {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-link-on-dark);
}
.contact-channels__value {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--apg-white);
  text-decoration: none;
  font-size: 1.02rem;
}
a.contact-channels__value:hover { color: var(--c-link-on-dark); }
.contact-channels__note { display: block; font-size: 0.86rem; color: #bcd6d3; }

.contact-form { padding: clamp(1.75rem, 4vw, 3rem); }
.contact-form__intro { color: var(--c-ink-soft); margin-bottom: var(--sp-md); }

a.contact-channels__note--link {
  color: var(--c-link-on-dark);
  text-decoration: none;
  font-weight: 600;
}
a.contact-channels__note--link:hover { text-decoration: underline; }

/* Mapa de ubicación (v2.3) */
.map-block {
  display: grid;
  gap: var(--sp-lg);
  align-items: center;
}
@media (min-width: 900px) { .map-block { grid-template-columns: 0.85fr 1.15fr; } }
.map-block__head h2 { margin: 0.15em 0 0.4em; }
.map-block__head p { color: var(--c-ink-soft); margin-bottom: var(--sp-md); }
.map-block__frame {
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-md);
  line-height: 0;
}
.map-block__frame iframe {
  display: block;
  width: 100%;
  height: clamp(300px, 45vw, 460px);
  border: 0;
}

/* ------------------------------------------------------------
   15. FORMULARIO
   ------------------------------------------------------------ */
.form__grid {
  display: grid;
  gap: var(--sp-md);
  grid-template-columns: repeat(2, 1fr);
}
.form__field { display: flex; flex-direction: column; }
.form__field--full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form__grid { grid-template-columns: 1fr; } .form__field { grid-column: 1 / -1; } }

.form__label {
  margin-bottom: 0.4em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--apg-green-dark);
}
.form__label .optional { font-weight: 400; color: var(--c-ink-soft); }
.form__input, .form__select, .form__textarea {
  width: 100%;
  padding: 0.75em 0.9em;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--c-ink);
  background: var(--apg-white);
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form__textarea { min-height: 130px; resize: vertical; }
.form__input:focus, .form__select:focus, .form__textarea:focus {
  outline: none;
  border-color: var(--apg-blue);
  box-shadow: 0 0 0 3px rgba(0, 116, 142, 0.18);
}
.form__hint { margin: 0.4em 0 0; font-size: var(--fs-xs); color: var(--c-ink-soft); }
.form__error { margin: 0.35em 0 0; min-height: 0; font-size: var(--fs-xs); color: var(--c-error); font-weight: 600; }
.has-error .form__input, .has-error .form__select, .has-error .form__textarea { border-color: var(--c-error); }

.form__input--captcha { max-width: 12rem; letter-spacing: 0.04em; }

.form__check {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6em;
}
.form__check input { margin-top: 0.25em; width: 20px; height: 20px; flex: none; accent-color: var(--apg-blue); }
.form__check label { font-size: 0.92rem; color: var(--c-ink-soft); max-width: none; }

.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__status { margin: 0; font-size: 0.95rem; }
.form__status:empty { display: none; }
.form__status.is-info { padding: 0.9em 1.1em; background: var(--c-blue-tint); border-radius: var(--r-sm); color: var(--apg-blue-ink); }
.form__status.is-error { padding: 0.9em 1.1em; background: var(--c-error-bg); border-radius: var(--r-sm); color: var(--c-error); }
.form__status.is-success { padding: 0.9em 1.1em; background: var(--c-success-bg); border-radius: var(--r-sm); color: var(--c-success); }

/* ------------------------------------------------------------
   16. FAQ (acordeón nativo)
   ------------------------------------------------------------ */
.faq-list { display: grid; gap: 0.75rem; max-width: var(--w-narrow); }
@media (min-width: 820px) {
  .faq-list { max-width: none; grid-template-columns: 1fr 1fr; align-items: start; column-gap: 1.25rem; }
}
.faq {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--apg-white);
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  padding: 1.05em 1.2em;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--apg-green-dark);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  border-right: 2px solid var(--apg-blue);
  border-bottom: 2px solid var(--apg-blue);
  transform: rotate(45deg);
  transition: transform var(--t-fast);
}
.faq[open] summary::after { transform: rotate(-135deg); }
.faq[open] summary { color: var(--apg-blue-ink); }
.faq__body { padding: 0 1.2em 1.2em; }
.faq__body p { margin: 0; color: var(--c-ink-soft); }

/* ------------------------------------------------------------
   17. BANDA CTA FINAL
   ------------------------------------------------------------ */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--apg-white);
  background: var(--grad-brand);
  border-radius: var(--r-xl);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.cta-band h2 { color: var(--apg-white); }
.cta-band p { margin-inline: auto; color: #eafaf4; font-size: var(--fs-lead); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--sp-sm); justify-content: center; margin-top: var(--sp-md); }

/* ------------------------------------------------------------
   18. FOOTER
   ------------------------------------------------------------ */
.site-footer {
  background: var(--grad-dark);
  color: var(--c-text-on-dark);
  padding-block: var(--sp-xl) var(--sp-lg);
}
.site-footer a { color: var(--c-text-on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--apg-white); text-decoration: underline; }

.site-footer__grid {
  display: grid;
  gap: var(--sp-lg);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 1fr 1fr 1.5fr; align-items: center; } }

.site-footer__brand img { height: clamp(104px, 13vw, 148px); width: auto; max-width: 100%; margin-bottom: var(--sp-md); }
.site-footer__brand p { color: var(--c-text-on-dark); max-width: 34ch; }
.site-footer h3 {
  color: var(--apg-white);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.9em;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { max-width: none; margin-bottom: 0.5em; }

/* Columna 1: logo centrado en la línea */
.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.site-footer__brand img { margin-bottom: 0; }

/* Columna 3: declaración enmarcada + contacto/redes (todo en blanco) */
.site-footer__statement { display: flex; flex-direction: column; gap: var(--sp-md); }
.footer-frame {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: clamp(0.9rem, 2.4vw, 1.25rem) clamp(1rem, 2.6vw, 1.4rem);
  background: rgba(255, 255, 255, 0.045);
}
.footer-quote {
  margin: 0;
  color: var(--apg-white);
  max-width: 46ch;
  border-left: 3px solid rgba(255, 255, 255, 0.35);
  padding-left: clamp(0.9rem, 2vw, 1.15rem);
  font-style: italic;
}
.footer-social { display: inline-flex; flex-wrap: wrap; align-self: flex-start; gap: 0.7rem; }
.footer-social__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28); color: var(--apg-white);
  transition: background-color var(--t-fast), transform var(--t-fast);
}
.footer-social__icon:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-2px); text-decoration: none; }
.footer-social__icon svg { width: 20px; height: 20px; flex: none; }

/* Empresas del grupo */
.group-brands { border-top: 1px solid rgba(255, 255, 255, 0.14); margin-top: var(--sp-xl); padding-top: var(--sp-lg); }
.group-brands__title {
  text-align: center;
  color: var(--apg-white);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: var(--sp-md);
}
.group-brands__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  margin: 0; padding: 0;
}
.group-brands__list li { margin: 0; max-width: none; }
.group-brands__list a {
  display: inline-flex;
  opacity: 0.82;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.group-brands__list a:hover { opacity: 1; transform: translateY(-2px); }
.group-brands__list img { height: clamp(46px, 7vw, 62px); width: auto; }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  margin-top: var(--sp-lg);
  padding-top: var(--sp-md);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: var(--fs-sm);
}
.site-footer__legal p { margin: 0; max-width: none; }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 0.4em 1em; }
.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.4em 1em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--apg-white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  text-decoration: none;
  transition: background var(--t-fast);
}
.credit-pill:hover { background: rgba(0, 116, 142, 0.55); color: var(--apg-white); text-decoration: none; }
.credit-pill__spark { color: var(--c-leaf-on-dark); }

/* ------------------------------------------------------------
   19. PÁGINAS INTERIORES (contenido de texto, blog, legales)
   ------------------------------------------------------------ */
.prose { max-width: var(--w-reading); }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }

.article-list { display: grid; gap: var(--sp-md); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.article-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-lg);
  background: var(--apg-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.article-card h3 { margin-bottom: 0.3em; }
.article-card p { color: var(--c-ink-soft); flex: 1; }
.article-card__meta { font-size: var(--fs-sm); color: var(--c-ink-soft); margin-bottom: 0.6em; }

.note {
  padding: var(--sp-md) var(--sp-lg);
  background: var(--c-blue-tint);
  border-left: 4px solid var(--apg-blue);
  border-radius: var(--r-sm);
  color: var(--apg-blue-ink);
}
.note p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------
   20. ACCESIBILIDAD: MOVIMIENTO REDUCIDO
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-band__slide { transition: none; }
}

/* ------------------------------------------------------------
   21. IMPRESIÓN BÁSICA
   ------------------------------------------------------------ */
@media print {
  .site-header, .site-footer, .hero-controls, .nav-toggle, .cta-band, .edge-tab { display: none !important; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* ------------------------------------------------------------
   22. PESTAÑAS LATERALES FLOTANTES (WhatsApp · volver arriba)
   Botones de borde no circulares: pestañas rectangulares con
   etiqueta vertical, ancladas al lateral derecho. La de WhatsApp
   es fija; la de «Subir» aparece tras una pantalla de scroll
   (initToTop en main.js) y sin JavaScript permanece oculta.
   ------------------------------------------------------------ */
.edge-tab {
  position: fixed;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 0.62rem;
  min-width: 46px;
  min-height: 44px;
  border: 0;
  border-radius: 14px 0 0 14px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-decoration: none;
}
.edge-tab__icon { width: 20px; height: 20px; flex: none; }
.edge-tab__label {
  writing-mode: vertical-rl;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

/* Pestaña de contacto: WhatsApp, centrada en el lateral */
.edge-tab--wa {
  top: 50%;
  transform: translateY(-50%);
  background: var(--grad-brand);
  color: var(--apg-white);
  transition: padding-right 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.edge-tab--wa:hover,
.edge-tab--wa:focus-visible {
  color: var(--apg-white);
  padding-right: 0.95rem;
  filter: brightness(1.09);
  box-shadow: var(--shadow-lg);
}

/* Pestaña utilitaria: volver arriba — solo flecha (sin texto), destacada y con leve rebote */
.edge-tab--top {
  bottom: clamp(1rem, 3vw, 1.75rem);
  padding: 0.72rem 0.7rem;
  min-width: 50px;
  min-height: 50px;
  gap: 0;
  background: var(--grad-brand);
  color: var(--apg-white);
  border: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s,
    filter 0.2s ease, box-shadow 0.2s ease;
}
/* La etiqueta "Subir" se oculta a la vista pero se mantiene para lectores de pantalla */
.edge-tab--top .edge-tab__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Flecha completa (astil + punta), más evidente que el chevron original.
   Se oculta el trazo del SVG y se pinta la flecha con una máscara CSS. */
.edge-tab--top .edge-tab__icon > * { display: none; }
.edge-tab--top .edge-tab__icon {
  width: 24px;
  height: 30px;
  background: currentColor;
  -webkit-mask: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 20 11 15 11 15 21 9 21 9 11 4 11Z'/%3E%3C/svg%3E");
  mask: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 20 11 15 11 15 21 9 21 9 11 4 11Z'/%3E%3C/svg%3E");
}
.edge-tab--top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
/* Rebote sutil pero perceptible mientras se navega */
.edge-tab--top.is-visible .edge-tab__icon {
  animation: edge-top-bob 1.8s ease-in-out infinite;
}
.edge-tab--top:hover,
.edge-tab--top:focus-visible {
  color: var(--apg-white);
  filter: brightness(1.09);
  box-shadow: var(--shadow-lg);
}
.edge-tab--top:hover .edge-tab__icon,
.edge-tab--top:focus-visible .edge-tab__icon {
  animation: none;
  transform: translateY(-3px);
  transition: transform 0.2s ease;
}
@keyframes edge-top-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .edge-tab--top.is-visible .edge-tab__icon { animation: none; }
}
