/* ======================================================
   AVINTEL JV — CSS PRO (Oxford + azules) · FIXED 2026-03
   ✅ Gestiones boxes más grandes y adaptativas al texto
   - Altura aumentada + padding interno generoso
   - grid-auto-rows: auto + height: auto (se adapta perfectamente)
   - Flip interior también más alto
====================================================== */

/* ============ Tokens ============ */
:root {
  /* Colores base */
  --ink: #0b1f3d;
  --ink-700: #132a4e;
  --ink-600: #243a5a;
  --ink-400: #5a6a80;
  --ink-300: #8a97a8;
  --accent: #2f6fde;
  --accent-700: #2251b6;
  --accent-800: #1b3f93;
  --accent-50: rgba(47, 111, 222, .12);
  --gold: #BDA06A;
  /* UI */
  --bg: #fff;
  --surface: #fff;
  --surface-2: #f5f7fb;
  --line: #e6edf7;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-xs: 0 2px 10px rgba(13, 37, 71, .06);
  --shadow: 0 8px 24px rgba(13, 37, 71, .08);
  --shadow-md: 0 14px 36px rgba(13, 37, 71, .12);
  --shadow-lg: 0 20px 50px rgba(13, 37, 71, .15);
  --ring: 0 0 0 2px rgba(47, 111, 222, .22);
  /* Tipografía + spacing */
  --font: 'Inter', system-ui, Segoe UI, Roboto, Arial, sans-serif;
  --font-heading: "Helvetica Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-1: clamp(2rem, 4.5vw, 3rem);
  --fs-2: clamp(1.45rem, 3vw, 2.1rem);
  --fs-3: clamp(1.05rem, 1.8vw, 1.22rem);
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 42px;
  --space-8: 56px;
  --section-py: clamp(84px, 12.5vw, 132px);
  --container: 1200px;
  /* Botones */
  --btn-fg: #fff;
  --btn-bg: var(--accent);
  /* Layout */
  --topbar-h: 80px;
  --z-nav: 1000;
  --z-modal: 2000;
  /* Flip-cards (altura global) */
  --flip-h: clamp(420px, 56svh, 560px);
  /* Scrollbar fino para áreas internas */
  --sb-track: #0f2240;
  --sb-thumb: rgba(140, 180, 255, .45);
  /* GESTIONES: altura uniforme — AHORA MÁS GRANDE Y ADAPTATIVA */
  --g-card-h: clamp(300px, 40svh, 410px);
  /* Viewport dinámico */
  --vh: 100dvh;
  --svh: 100svh;
}
@supports not (height: 100dvh) {
  :root { --vh: 100vh; --svh: 100vh; }
}
/* Ajuste fino móvil del header */
@media (max-width: 860px) {
  :root { --topbar-h: 68px; }
}

/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: #fff;
  overflow-x: hidden;
}
@supports (overflow-x: clip) {
  html { overflow-x: clip; }
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-700);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}
p { margin: 0 0 var(--space-4); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-700); text-decoration: none; }
a:hover { color: var(--accent-800); }
.container {
  width: min(var(--container), 92vw);
  inline-size: min(100%, var(--container));
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lead { font-size: var(--fs-3); color: #243a5a; }

/* ============ Secciones & grid ============ */
.section {
  padding-block: var(--section-py);
  background: #fff;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.grid { display: grid; gap: var(--space-5); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ============ Tarjetas ============ */
.card {
  background: #fff;
  padding: var(--space-6);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  will-change: transform;
}
.card h3 { margin: 0 0 var(--space-3); }
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); transition: .18s; }
}

/* ============ Botones ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: var(--shadow-xs);
  transition: .18s;
}
.btn:hover, .btn:focus-visible {
  outline: none;
  box-shadow: var(--ring), var(--shadow-xs);
  transform: translateY(-1px);
}
.btn:active { transform: none; }
.btn-cta { background: #fff; color: var(--accent-700); border: 1px solid #cfe0ff; }
.btn-cta:hover { background: var(--accent); color: #fff; border-color: #fff; }
.btn--ghost { background: var(--accent); color: #fff; }

/* ============ Topbar / NAV ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  transition: transform .28s ease, opacity .28s ease;
  backdrop-filter: saturate(1.05);
  padding-top: env(safe-area-inset-top, 0);
}
.topbar.is-scrolled { box-shadow: 0 8px 24px rgba(13, 37, 71, .10); }
.topbar .container {
  padding-left: clamp(6px, 1vw, 12px);
  padding-right: clamp(8px, 1.2vw, 12px);
}
.nav-wrap {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr max-content;
  align-items: center;
  min-height: var(--topbar-h);
  padding-inline: clamp(6px, 1vw, 12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brand__logo { width: auto; max-height: 32px; object-fit: contain; }
.nav {
  display: flex;
  gap: clamp(10px, 1.4vw, 18px);
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  position: relative;
}
.nav__indicator {
  position: absolute;
  left: 0;
  bottom: 6px;
  height: 3px;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  opacity: 1;
  transition: transform .25s, width .25s, opacity .25s;
}
.nav a:not(.btn-cta),
.nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--ink);
  white-space: nowrap;
}
@media (hover: hover) {
  .nav a:not(.btn-cta):hover,
  .nav__link:hover { color: var(--ink); }
}
.nav a:not(.btn-cta).active,
.nav__link.is-active { color: var(--ink); }
.nav__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: clamp(10px, 2vw, 18px);
}
.lang-form { display: flex; align-items: center; }
.lang-select {
  appearance: none;
  font: inherit;
  color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23243a5a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 42px 12px 14px;
  box-shadow: var(--shadow-xs);
}
.lang-select:focus-visible { outline: none; box-shadow: var(--ring); }

/* ===== Menú móvil overlay ===== */
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn {
    display: block;
    background: transparent;
    border: 0;
    padding: 12px;
    cursor: pointer;
    margin-left: 0;
    position: relative;
    z-index: calc(var(--z-modal) + 1);
  }
  .menu-btn__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    margin: 6px 0;
    transition: .18s;
  }
  .menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] .menu-btn__bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    padding-inline: var(--space-5);
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: 0 26px 40px rgba(13, 37, 71, .18);
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .25s ease, opacity .2s ease, visibility 0s .25s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: var(--z-modal);
  }
  .nav.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform .25s ease, opacity .2s ease, visibility 0s 0s;
  }
  .nav__list { flex-direction: column; align-items: stretch; gap: 6px; }
  .nav a:not(.btn-cta), .nav__link { justify-content: flex-start; padding: 14px 12px; border-radius: 10px; }
  .nav__indicator { display: none; }
  .nav__right { margin: 12px 0 4px; width: 100%; }
  .nav__right .btn { width: 100%; }

  .nav-wrap {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    grid-template-areas: "left center right";
    align-items: center;
    min-height: var(--topbar-h);
  }
  .menu-btn { grid-area: left; justify-self: start; }
  .brand { grid-area: center; justify-self: center; min-width: 0; }
  .nav__right { grid-area: right; justify-self: end; display: flex; align-items: center; gap: 10px; }
  .brand__logo { max-height: 30px; }
  .nav__right .btn-cta {
    padding: 10px 12px;
    font-size: .95rem;
    border-radius: 14px;
    white-space: nowrap;
  }
  .nav__indicator { display: none !important; }

  body:has(.nav.open),
  body.menu-open {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: contain;
  }
}

/* ============ Hero ============ */
.hero-banner { padding: 0; background: #fff; }
.banner {
  position: relative;
  min-height: 76svh;
  border-radius: 0 0 36px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  inline-size: 100%;
}
.banner video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .25) 0%, rgba(0, 0, 0, .55) 100%);
}
.banner__content {
  position: relative;
  min-height: 76svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  gap: var(--space-4);
  padding: clamp(28px, 4vw, 40px);
}
.banner__content h1 { font-size: var(--fs-1); margin: .2em 0; }
.banner__content .lead { color: #eaf2ff; }
.hero__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center; }
@media (orientation: landscape) and (max-width: 860px) {
  .banner, .banner__content { min-height: 62svh; }
}

/* ============ Nosotros ============ */
#nosotros .grid.two { align-items: center; gap: var(--space-7); }
.nosotros__media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.nosotros__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .45) 100%);
  pointer-events: none;
}
.photo-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: grid;
  gap: 6px;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 37, 71, .55);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: var(--shadow);
}
.photo-caption strong { font-size: clamp(1.02rem, 1.6vw, 1.25rem); }
#nosotros h2 { text-wrap: balance; }
#nosotros p,
#nosotros li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
#nosotros .nosotros-text,
#nosotros .about-text,
#nosotros .copy { max-width: 68ch; }
@media (max-width: 980px) {
  #nosotros .grid.two { grid-template-columns: 1fr; align-items: start; }
}

/* ============ Servicios (header + flip) ============ */
#servicios { position: relative; }
.section--has-bg {
  position: relative;
  background: var(--section-bg-img) center / cover no-repeat;
  background-color: #f5f7fb;
}
/* CABECERA deluxe */
.section__head--media {
  position: relative;
  --head-h: clamp(300px, 42svh, 560px);
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 14px 50px rgba(5, 38, 109, .28);
  border: 0 !important;
  isolation: isolate;
}
.head-media {
  position: relative;
  inline-size: 100%;
  block-size: var(--head-h);
  will-change: transform;
}
.head-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 40%;
  filter: saturate(1.05) contrast(1.05);
  transform: translate3d(0, 0, 0) scale(1.04);
}
.head-media::before {
  content: "";
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(34% 46% at 12% 18%, rgba(120, 180, 255, .28), transparent 60%),
    radial-gradient(42% 54% at 88% 8%, rgba(40, 90, 200, .30), transparent 60%),
    radial-gradient(60% 60% at 50% 110%, rgba(10, 20, 44, .65), transparent 70%);
  mix-blend-mode: screen;
  animation: sv-aurora 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes sv-aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -2%, 0) scale(1.05); }
}
.head-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, .42) 55%, rgba(0, 0, 0, .68) 100%);
}
.section__head--media .head-content {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: grid;
  gap: .45rem;
  padding: clamp(12px, 1.4vw, 18px) clamp(16px, 2.2vw, 26px);
  color: #fff;
  background: linear-gradient(180deg, rgba(12, 24, 52, .35) 0%, rgba(12, 24, 52, .58) 100%);
  backdrop-filter: blur(6px) saturate(1.04);
  -webkit-backdrop-filter: blur(6px) saturate(1.04);
  border-top: 1px solid rgba(255, 255, 255, .10);
  border-left: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 -14px 42px rgba(0, 0, 0, .26);
}
.section__head--media h2 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw + .3rem, 3.2rem);
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  letter-spacing: -.02em;
  line-height: 1.08;
  display: inline-block;
  position: relative;
}
.section__head--media h2::after {
  content: "";
  display: block;
  height: 3px;
  width: clamp(140px, 22vw, 340px);
  margin-top: .5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #6FA3FF, #2F6FDE, #1B3F93);
  box-shadow: 0 10px 26px rgba(47, 111, 222, .40);
  transform-origin: left;
  animation: sv-underline 1.2s cubic-bezier(.22, .8, .2, 1) both;
}
@keyframes sv-underline {
  from { transform: scaleX(.3); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}
.section__head--media .muted {
  color: #eaf2ff !important;
  opacity: .95;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
@media (prefers-reduced-motion: reduce) {
  .head-media::before { animation: none; }
  .section__head--media h2::after { animation: none; }
}
/* Tarjetas flip (Servicios) */
#servicios .flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(14px, 1.8vw, 22px);
  margin-top: clamp(22px, 3.2vw, 40px);
  max-inline-size: 100%;
}
#servicios .flip-card {
  perspective: 1200px;
  -webkit-tap-highlight-color: transparent;
}
#servicios .flip-inner {
  position: relative;
  width: 100%;
  height: var(--flip-h);
  transform-style: preserve-3d;
  transition: transform .7s;
  border-radius: 20px;
  will-change: transform;
}
.can-hover #servicios .flip-card:hover .flip-inner,
.can-hover #servicios .flip-card:focus-within .flip-inner { transform: rotateY(180deg); }
#servicios .flip-front,
#servicios .flip-back {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(5, 16, 30, .22);
  border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
#servicios .flip-front { z-index: 2; transform: rotateY(0deg) translateZ(0.01px); }
#servicios .flip-back { z-index: 1; transform: rotateY(180deg) translateZ(0.01px); }
#servicios .flip-front img,
#servicios .flip-back img { width: 100%; height: 100%; object-fit: cover; }
.flip-card--contain .flip-front img,
.flip-card--contain .flip-back img { object-fit: contain !important; background: transparent; }
.flip-card--contain .flip-front::after,
.flip-card--contain .flip-back::after { display: none !important; }
@media (hover: none), (max-width: 860px) {
  #servicios .flip-card .flip-inner { transform: none; }
  #servicios .flip-card.is-flipped .flip-inner { transform: rotateY(180deg); }
  #servicios .flip-card:active .flip-inner { transform: none !important; }
  #servicios .flip-card { touch-action: pan-y; }
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
  border: 1px solid var(--line);
  background: #fff;
  color: #0b1f3d;
}

/* ============ ¿Por qué nosotros? ============ */
.why-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-5); }
.reason-card {
  border-radius: var(--radius);
  padding: var(--space-5);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

/* ============ Video scroll + modal ============ */
.video-section { padding: 0; }
.video-scroller { height: var(--video-scrollvh, 240svh); position: relative; overflow: visible; }
.video-sticky {
  position: sticky;
  top: 0;
  height: min(var(--vh), 100svh);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  will-change: transform;
}
.video-frame {
  position: relative;
  width: 100%;
  height: min(var(--vh), 100svh);
  transform: scale(var(--v-scale, .62));
  transform-origin: center;
  border-radius: calc(28px * (1 - var(--v-progress, 0)));
  box-shadow: 0 22px 60px rgba(13, 37, 71, calc(.22 * (1 - var(--v-progress, 0))));
  overflow: hidden;
  transition: border-radius .06s linear;
  contain: paint;
  will-change: transform;
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.video-play {
  --s: clamp(60px, 8vh, 92px);
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .45);
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: .35s;
}
.video-play::before {
  content: "";
  width: 0;
  height: 0;
  border-left: calc(var(--s) * .34) solid #fff;
  border-top: calc(var(--s) * .22) solid transparent;
  border-bottom: calc(var(--s) * .22) solid transparent;
  margin-left: calc(var(--s) * .06);
}
.video-sticky.show-play .video-play { opacity: 1; pointer-events: auto; }
.video-frame .video-audio {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 5;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  box-shadow: var(--shadow-xs);
}
.video-player-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, .82);
  padding: clamp(12px, 2.5vw, 24px);
}
.video-player-modal[aria-hidden="false"] { display: flex; }
.video-player-modal .vp-inner {
  max-width: min(1100px, 92vw);
  max-height: 82svh;
  position: relative;
}
.video-player-modal video {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.video-player-modal .vp-close {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 1.5rem;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
body:has(.video-sticky.is-full) .topbar,
body:has(.video-player-modal[aria-hidden="false"]) .topbar,
body.video-full .topbar {
  transform: translateY(calc(-100% - env(safe-area-inset-top)));
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 860px), (hover: none) {
  .video-scroller { height: auto; }
  .video-sticky { position: relative; top: auto; height: auto; }
  .video-frame {
    height: clamp(220px, 42svh, 420px);
    transform: none !important;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
  }
}

/* ============ Drones (claro) ============ */
.drones-hero {
  position: relative;
  text-align: center;
  background: radial-gradient(60% 40% at 50% 0, rgba(47, 111, 222, .12), transparent 60%), #fff;
}
.drones-head { max-width: 900px; margin: 0 auto var(--space-5); color: #0d1f38; }
.drones-card {
  position: relative;
  width: min(900px, 92vw);
  margin: var(--space-4) auto var(--space-6);
  background: linear-gradient(180deg, rgba(18, 34, 70, .88), rgba(18, 34, 64, .88));
  color: #eaf1ff !important;
  border: 1px solid rgba(140, 180, 255, .22);
  border-radius: 20px;
  padding: clamp(24px, 3.2vw, 34px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 42px rgba(5, 16, 30, .35), 0 2px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(6px) saturate(1.03);
  -webkit-backdrop-filter: blur(6px) saturate(1.03);
}
.drones-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  background: linear-gradient(90deg, #2f6fde, #1b3f93);
  opacity: .8;
}
.drones-card h3 {
  color: #cfe1ff;
  letter-spacing: .2px;
  margin: 0 0 .4rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .25);
}
.drones-card .intro { color: #c9d8ff; opacity: .95; }
.drones-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 12px; }
.drones-list li {
  position: relative;
  padding-left: 32px;
  line-height: 1.45;
  color: #e8f0ff;
}
.drones-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .25rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .9) 0 2px, transparent 3px),
    linear-gradient(135deg, #6aa3ff, #2f6fde);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9.55 17.05L4.9 12.4l1.4-1.4l3.25 3.25L17.7 6.1l1.4 1.4z'/%3E%3C/svg%3E") center/14px 14px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9.55 17.05L4.9 12.4l1.4-1.4l3.25 3.25L17.7 6.1l1.4 1.4z'/%3E%3C/svg%3E") center/14px 14px no-repeat;
}
@media (min-width: 760px) {
  .drones-list { columns: 2; column-gap: clamp(16px, 3vw, 28px); }
  .drones-list li { break-inside: avoid; }
}
.drones-cta {
  background: linear-gradient(135deg, #2f6fde, #1b3f93);
  border: 0;
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 10px 26px rgba(47, 111, 222, .28);
}
.drones-cta:hover { transform: translateY(-1px); }
.drones-image {
  max-width: min(980px, 94vw);
  margin: clamp(8px, 3vw, 18px) auto 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(140, 180, 255, .16);
  box-shadow: 0 20px 50px rgba(5, 16, 30, .35);
}
.drones-image img { display: block; width: 100%; height: auto; }
.drones-head h2 { font-size: clamp(1.8rem, 2.8vw + .6rem, 3rem); color: #0d1f38; }
.drones-head .muted { color: #425f8f; }

/* ============ GESTIONES — BOXES MÁS GRANDES Y ADAPTATIVAS ============ */
.gestiones {
  position: relative;
  padding-block: var(--section-py);
  color: #eaf2ff;
  background: linear-gradient(180deg, #0a1c30 0%, #0b2036 48%, #0a1d33 100%);
  overflow: hidden;
}
.gestiones::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(120, 170, 255, .12), transparent 60%),
    radial-gradient(80% 65% at 50% 120%, rgba(0, 0, 0, .35), transparent 70%);
  pointer-events: none;
}
.g-head { text-align: center; margin-bottom: clamp(28px, 3.6vw, 40px); }
.g-head h2 { color: #f7fbff; text-shadow: 0 2px 18px rgba(80, 140, 255, .22); }
.g-head .muted { color: #dbe7ff; opacity: .9; }

.g-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 2.8vw, 32px);
  z-index: 1;
  grid-auto-rows: auto;
  align-items: start;
}
.g-grid::before {
  content: "";
  position: absolute;
  inset: -18px -12px;
  border-radius: 24px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(12, 26, 48, .82), rgba(12, 26, 48, .88)), var(--gestiones-bg, none);
  background-size: cover;
  background-position: center;
  box-shadow: 0 30px 70px rgba(5, 16, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  pointer-events: none;
  overflow: hidden;
}

.g-card {
  position: relative;
  border-radius: 18px;
  padding: clamp(26px, 3vw, 36px);
  color: #dfe9ff;
  background:
    radial-gradient(120% 160% at -10% -20%, rgba(110, 160, 255, .10), transparent 35%),
    linear-gradient(180deg, rgba(18, 34, 60, .92), rgba(14, 28, 52, .92));
  border: 1px solid rgba(140, 180, 255, .14);
  box-shadow: 0 12px 28px rgba(5, 16, 30, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: saturate(1.02);
  -webkit-backdrop-filter: saturate(1.02);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  min-height: var(--g-card-h);
  height: auto;
  display: grid;
  grid-template-rows: auto 1fr;
}
.g-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(40% 30% at 15% 0%, rgba(140, 180, 255, .14), transparent 60%);
  mix-blend-mode: screen;
}
.g-card h3 { margin: 0 0 .6rem; color: #8bb5ff; letter-spacing: .2px; font-size: 1.08rem; }
.g-card p { color: #dbe7ff; opacity: .96; line-height: 1.72; }
/* Bullets más cómodos */
.g-card ul { margin-top: 0.4rem !important; padding-left: 1.4rem; }
.g-card li { margin-bottom: 0.7rem; position: relative; }
.g-card li:last-child { margin-bottom: 0; }

/* Flip interior de gestiones (más alto) */
.g-card--flip { perspective: 1200px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.g-card--flip .gcard-flip {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .7s;
  min-height: clamp(340px, 44svh, 480px);
}
.g-card--flip.is-flipped .gcard-flip { transform: rotateY(180deg); }
.g-card--flip .gcard-face {
  position: absolute;
  inset: 0;
  padding: clamp(18px, 2.2vw, 24px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: .35rem;
  border-radius: 16px;
  backface-visibility: hidden;
  background: inherit;
  border: inherit;
  box-shadow: inherit;
  color: inherit;
}
.g-card--flip .gcard-face > h3 { margin: 0 0 .1rem; }
.g-card--flip .gcard-face > :not(h3) {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  padding-right: 10px;
  padding-bottom: 36px;
  overscroll-behavior: contain;
  line-height: 1.68;
  font-size: 0.96rem;
  text-wrap: pretty;
  hyphens: none;
}
.g-card--flip .gcard-face ul { margin-top: 0.35rem !important; }
.g-card--flip .gcard-face li { margin-bottom: 0.55rem; }
.g-card--flip .gcard-face > :not(h3)::-webkit-scrollbar { width: 8px; }
.g-card--flip .gcard-face > :not(h3)::-webkit-scrollbar-track { background: var(--sb-track); border-radius: 10px; }
.g-card--flip .gcard-face > :not(h3)::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 10px; }
.g-card--flip .gcard-face > :not(h3) { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) var(--sb-track); }
.g-card--flip .gcard-back { transform: rotateY(180deg); font-size: .92rem; line-height: 1.45; }
.g-card--flip .gcard-back p,
.g-card--flip .gcard-back li { color: #e6efff; }
.g-card--flip .gcard-back p { white-space: pre-line; margin: 0; }
.g-card--flip .gcard-back ul { margin: .2rem 0 0; padding-left: 1.1rem; display: grid; gap: .2rem; }
.g-card--flip .gcard-back li { margin: 0; }
.g-card--flip .gcard-back::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(14, 28, 52, .95));
  pointer-events: none;
  border-radius: inherit;
}
.g-card--flip .gcard-hit { display: none !important; }

@media (hover: hover) {
  .g-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(5, 16, 30, .45);
    border-color: rgba(140, 180, 255, .40);
  }
}

/* Responsive Gestiones */
@media (max-width: 980px) { .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .g-grid { grid-template-columns: 1fr; }
  .g-card { min-height: 0; height: auto; padding: clamp(24px, 4vw, 32px); }
}
@media (max-width: 820px) {
  .section__head--media { contain: paint; }
  .g-grid::before { inset: -12px 0; }
}

/* ============ FAQ ============ */
.faq-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: var(--space-6); align-items: start; }
.faq-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: #000;
}
.faq-quote {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(13, 37, 71, .75);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .15);
  font-size: .98rem;
}
.accordion { display: grid; gap: var(--space-3); }
.acc-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.acc-btn {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 0;
  padding: 16px 48px 16px 16px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}
.acc-btn::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink-600);
  background: var(--surface-2);
  transition: .18s;
}
.acc-btn.is-active { color: var(--accent-700); }
.acc-btn.is-active::after { content: "–"; color: #fff; background: var(--accent); border-color: var(--accent); }
.acc-panel { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.acc-panel[hidden] { display: none; }

/* ============ Formulario / Contacto ============ */
.form {
  background: linear-gradient(180deg, #fff, rgba(47, 111, 222, .06));
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  border: 1px solid #dfe8fb;
  box-shadow: var(--shadow);
  display: grid;
  gap: clamp(16px, 2.4vw, 24px);
  max-width: 860px;
  margin-inline: auto;
  position: relative;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-weight: 700; color: #1b3764; }
.field input,
.field textarea,
.form select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #dfe4f3;
  background: #fff;
  font: inherit;
  color: #0b1f3d;
  transition: border-color .18s, box-shadow .18s, transform .06s;
  min-height: 44px;
  line-height: 1.5;
}
.field textarea { resize: vertical; min-height: 160px; }
.field input::placeholder, .field textarea::placeholder { color: #8a97a8; }
@media (hover: hover) {
  .field input:hover,
  .field textarea:hover,
  .form select:hover { border-color: #c7d4f3; }
}
.field input:focus,
.field textarea:focus,
.form select:focus {
  outline: none;
  border-color: #97b4f2;
  box-shadow: var(--ring), var(--shadow-xs);
  transform: translateY(-1px);
}
.form .alert { border-radius: var(--radius); padding: 12px 14px; margin: 2px 0 6px; border: 1px solid var(--line); }
.form .alert.ok { background: #e8f5ec; border-color: #c9ebd4; color: #1a7f37; }
.form .alert.bad { background: #fde8e6; border-color: #f3c4bf; color: #7a1a1a; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li + li { margin-top: var(--space-3); }
.map-card {
  margin-top: var(--space-6);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 12px;
}
#map { width: 100%; height: 380px; border-radius: var(--radius-lg); overflow: hidden; }
@media (max-width: 560px) { #map { height: 300px; } }

/* ============ Footer grande (rectangular) ============ */
.footer {
  position: relative;
  width: 100%;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 45%, #eef3ff 100%);
  --footer-py: clamp(44px, 6vw, 96px);
  padding-bottom: max(var(--footer-py), env(safe-area-inset-bottom));
}
.footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12px;
  background: linear-gradient(180deg, rgba(13, 37, 71, .10), transparent);
  pointer-events: none;
}
.footer__grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2.8vw, 36px);
  padding-block: var(--footer-py);
  max-inline-size: 100%;
}
.footer--xl { --footer-py: clamp(56px, 7.5vw, 120px); --footer-min-h: clamp(160px, 18svh, 240px); }
.footer--xl .footer__grid { min-height: var(--footer-min-h); }
.footer__brand { display: flex; align-items: center; gap: .9rem; color: var(--ink); text-decoration: none; }
.footer--xl .footer__logo { width: clamp(44px, 4.6vw, 60px); height: auto; object-fit: contain; }
.footer--xl .footer__brand-text { font-weight: 700; font-size: clamp(.98rem, 1.1vw, 1.12rem); color: #1b2f55; }
.footer__nav { display: flex; align-items: center; margin-inline: auto; }
.footer__links {
  list-style: none;
  display: flex;
  gap: clamp(12px, 2vw, 22px);
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  max-inline-size: 100%;
}
.footer__links a {
  color: var(--ink-600);
  padding: 10px 12px;
  border-radius: 10px;
  border-bottom: 1px dashed transparent;
  font-weight: 600;
}
.footer__links a:hover { color: var(--accent-700); border-bottom-color: var(--accent-700); }
.footer__links a:focus-visible { box-shadow: var(--ring); }
.footer__social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 2.6vw, 14px);
  flex-wrap: wrap;
  width: 100%;
  align-self: center;
  max-inline-size: 100%;
}
.social-btn {
  --s: 44px;
  width: var(--s);
  height: var(--s);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  line-height: 0;
}
.social-btn svg { width: 22px; height: 22px; }
.footer--xl .social-btn {
  --s: 46px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: .18s;
}
.footer--xl .social-btn svg { width: 22px; height: 22px; fill: #2b4776; }
.footer--xl .social-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.footer--xl .to-top {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}
.footer--xl .to-top:hover { box-shadow: var(--ring); }
.footer .to-top { margin-inline: auto; }
/* Footer móvil */
@media (max-width: 800px) {
  .footer__grid {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    row-gap: clamp(12px, 3vw, 18px);
  }
  .footer__brand { justify-content: center; }
  .footer__nav { order: 3; width: 100%; justify-content: center; }
  .footer__links { justify-content: center; }
  .footer--xl .footer__logo { max-width: 52px; height: auto; }
  .footer { padding-bottom: max(var(--footer-py), env(safe-area-inset-bottom)); }
}

/* Legal modal */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 25, 50, .72);
  backdrop-filter: blur(4px) saturate(1.02);
  -webkit-backdrop-filter: blur(4px) saturate(1.02);
  padding: clamp(12px, 3vw, 28px);
}
.legal-modal[aria-hidden="false"] { display: flex; }
.legal-modal__panel {
  position: relative;
  width: min(860px, 96vw);
  max-height: 82svh;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.legal-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, rgba(47, 111, 222, .06));
}
.legal-modal__head h3 { margin: 0; font-size: clamp(1.2rem, 1.6vw, 1.5rem); color: #10223f; }
.legal-modal__body { padding: 18px 24px 8px; color: #1b3764; line-height: 1.75; }
.legal-modal__body p { margin: 0 0 .9rem; }
.legal-modal__body p strong { color: #10223f; }
.legal-modal__body a { color: var(--accent-700); text-decoration: underline; }
.legal-modal__body em { color: #5a6a80; }
.legal-modal__foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.legal-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #10223f;
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.legal-modal__close:hover { box-shadow: var(--ring), var(--shadow-xs); }

/* ============ Animaciones & motion ============ */
@keyframes av-fade-up {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: none; }
}
[data-animate] { opacity: 0; transform: translate3d(0, 12px, 0); }
[data-animate].is-inview { opacity: 1; transform: none; }
[data-animate="fade-up"].is-inview { animation: av-fade-up .6s cubic-bezier(.22, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-animate] { opacity: 1; transform: none; animation: none !important; }
  .flip-inner, .gcard-flip { transition: none; }
}

/* ============ Utilidades ============ */
.border-subtle { border: 1px solid var(--line); }
.text-gradient {
  background: linear-gradient(180deg, var(--ink), #223a63);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stack > * + * { margin-top: var(--space-3); }
.center-block { margin-inline: auto; }

/* ============ Responsive master ============ */
@media (max-width: 1080px) { :root { --section-py: clamp(70px, 10.5vw, 104px); } }
@media (max-width: 980px) {
  .grid.two { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .section { padding-block: clamp(66px, 9.5vw, 96px); }
}
@media (max-width: 560px) {
  .section { padding-block: clamp(58px, 8.5vw, 78px); }
  .card, .drones-card { box-shadow: 0 8px 22px rgba(13, 37, 71, .12); }
  .section__head--media { box-shadow: 0 8px 22px rgba(13, 37, 71, .12); }
}

/* ============ Selección & scrollbars globales ============ */
::selection { background: rgba(47, 111, 222, .22); color: #0b1f3d; }
* { scrollbar-width: thin; scrollbar-color: rgba(47, 111, 222, .35) #f1f5ff; }
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-track { background: #f1f5ff; }
::-webkit-scrollbar-thumb { background: rgba(47, 111, 222, .35); border-radius: 10px; border: 2px solid #f1f3ff00; }
/* img/video no desbordan horizontalmente */
img, video, .head-media, .flip-grid, .g-grid { max-inline-size: 100%; }

/* ============ Accesibilidad: foco visible en targets táctiles ============ */
.btn:focus-visible,
.nav a:focus-visible,
.acc-btn:focus-visible,
.g-card--flip:focus-visible,
#servicios .flip-card:focus-visible {
  outline: none;
  box-shadow: var(--ring), var(--shadow-xs);
  border-radius: 12px;
}