/* =========================================================
   VARIABLES
========================================================= */
:root {

  --wrap: 1240px;
  --topH: 48px;
  --barH: 76px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 6px 16px rgba(0,0,0,.12);
  --shadow-md: 0 12px 28px rgba(0,0,0,.18);
  --shadow-lg: 0 18px 40px rgba(0,0,0,.22);

  --grad-main: linear-gradient(270deg, var(--prussian-blue), var(--deep-navy));
}

/* =========================================================
   RESET
========================================================= */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding-top: calc(var(--topH) + var(--barH));
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--white);
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================
   CONTAINER
========================================================= */
.wrap {
  width: min(var(--wrap), 100% - 64px);
  margin: 0 auto;
}

/* =========================================================
   HEADER
========================================================= */
.siteHeader {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9999;
  color: var(--white);
}

/* =========================================================
   TOP BAR
========================================================= */
.topBar {
  height: var(--topH);
  background: var(--grad-main);
}

.topBar__inner {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topBar__left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topBar a,
.topBar span {
  font-size: 14px;
  opacity: .9;
}

/* =========================================================
   SOCIAL ICONS
========================================================= */
.topBar__right {
  display: flex;
  gap: 6px;
}

.socialIcon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}

.socialIcon img {
  width: 17px;
  height: 17px;
}

/* =========================================================
   MAIN BAR
========================================================= */
.mainBar {
  position: relative;
  height: var(--barH);
}

.mainBar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-main);
  clip-path: polygon(36% 0,100% 0,100% 100%,39% 100%);
  z-index: 0;
}

.mainBar__inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================================================
   LOGO
========================================================= */
.brandBlock img {
  height: 56px;
}

/* =========================================================
   NAV
========================================================= */
.navList {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 19px;
  margin: 0;
  padding: 0;
}

.navList > li {
  position: relative;
}

.navList > li > a,
.servicesTrigger {
  font-size: 14px;
  padding: 8px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* underline hover */
.navList > li:not(.cta) > a::after,
.navList > li:not(.cta) > .servicesTrigger::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.95),
    rgba(255,255,255,.25)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

.navList > li:not(.cta):hover > a::after,
.navList > li:not(.cta):hover > .servicesTrigger::after {
  transform: scaleX(1);
}

.caret {
  font-size: 12px;
  opacity: .7;
}

/* =========================================================
   CTA
========================================================= */
.cta a {
  background: var(--white);
  color: var(--prussian-blue);
  padding: 6px 9px;
  border-radius: var(--radius-lg);
  font-weight: 800;
}

/* =========================================================
   MEGA MENU – DESKTOP
========================================================= */
.hasMega {
  position: relative;
}

/* zona segura */
.hasMega::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 20px;
}

/* abrir menu */
.hasMega:hover > .megaMenu,
.hasMega:focus-within > .megaMenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* CONTENEDOR */
.megaMenu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: min(760px, 90vw);

  background: var(--grad-main);
  color: var(--white);

  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);

  display: grid;
  grid-template-columns: 220px 1fr;

  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;

  transition: opacity .25s ease, transform .25s ease;
  overflow: hidden;
  z-index: 1000;
}

/* =========================================================
   PANEL IZQUIERDO
========================================================= */
.megaLeft {
  padding: 28px 22px;
  border-right: 1px solid rgba(255,255,255,.15);
}

.megaLeft h4 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 22px;
  opacity: .9;
}

.megaLeft ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.megaLeft li {
  padding: 12px 2px;
  font-size: 17px;
  cursor: pointer;
  opacity: .7;
  position: relative;
}

.megaLeft li::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.95),
    rgba(255,255,255,.25)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.megaLeft li:hover,
.megaLeft li.isActive {
  opacity: 1;
}

.megaLeft li:hover::after,
.megaLeft li.isActive::after {
  transform: scaleX(1);
}

/* =========================================================
   PANEL DERECHO
========================================================= */
.megaRight {
  padding: 32px 36px;
}

.megaRight .panel {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.megaRight .panel.isActive {
  display: block;
}

.megaRight .panel li a {
  display: inline-block;
  padding: 10px 0;
  font-size: 17px;
  opacity: .85;
  position: relative;
}

.megaRight .panel li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.95),
    rgba(255,255,255,.25)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.megaRight .panel li a:hover {
  opacity: 1;
}

.megaRight .panel li a:hover::after {
  transform: scaleX(1);
}

/* =========================================================
   SCROLL STATE
========================================================= */
.siteHeader.isScrolled {
  background: var(--white);
  color: var(--deep-navy);
  box-shadow: var(--shadow-sm);
}

.siteHeader.isScrolled .topBar,
.siteHeader.isScrolled .mainBar {
  background: transparent !important;
}

.siteHeader.isScrolled .mainBar::before {
  display: none !important;
}

.siteHeader.isScrolled .megaMenu {
  background: var(--white);
  color: var(--deep-navy);
}

.siteHeader.isScrolled .megaLeft {
  border-right-color: rgba(0,0,0,.15);
}

.siteHeader.isScrolled .megaLeft li::after,
.siteHeader.isScrolled .megaRight .panel li a::after {
  background: linear-gradient(
    to bottom,
    var(--deep-navy),
    rgba(0,0,0,.25)
  );
}

.siteHeader.isScrolled .cta a {
  background: var(--prussian-blue);
  color: var(--white);
}

/* =========================================================
   SOCIAL ICONS
========================================================= */
.redes-mobile {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.socialIcon2 {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.socialIcon2 img {
  width: 18px;
  height: 18px;
}


/* =========================================================
   MOBILE MENU – FINAL VERSION
========================================================= */

@media (max-width: 768px) {

  /* ================= HAMBURGER ================= */
  .hamburger {
    display: block;
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    cursor: pointer;
    position: relative;
    z-index: 10001;
  }

  .hamburger span {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: #fff;
    transition: .3s ease;
  }

  .hamburger span:nth-child(1) { top: 14px; }
  .hamburger span:nth-child(2) { top: 22px; }
  .hamburger span:nth-child(3) { top: 30px; }

  .hamburger.isActive span:nth-child(1) {
    transform: rotate(45deg);
    top: 22px;
  }
  .hamburger.isActive span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.isActive span:nth-child(3) {
    transform: rotate(-45deg);
    top: 22px;
  }

  /* ================= MOBILE PANEL ================= */
  .mobileMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 75vw;
    max-width: 420px;
    height: 100vh;
    background: linear-gradient(180deg, #0a1128, #001f54);
    z-index: 10000;

    transform: translateX(-100%);
    transition: transform .45s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
  }

  .mobileMenu.isOpen {
    transform: translateX(0);
  }

  /* ================= LEVELS ================= */
  .menuLevel {
    position: absolute;
    inset: 0;
    padding: 36px 28px;

    display: flex;
    flex-direction: column;
    gap: 26px;

    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;

    transition:
      transform .45s cubic-bezier(.4,0,.2,1),
      opacity .25s ease;
  }

  .menuLevel.isActive {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* ================= HEADER ================= */
  .menuHeader {
    visibility: hidden;
  }

  .menuHeader2-back {
    font-size: 15px;
    font-weight: 500;
    opacity: .7;
    cursor: pointer;
  }

  /* ================= LIST ================= */
  .menuList {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .menuList li,
  .menuList a {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 0;
    font-size: 18px;
    color: #fff;
    opacity: .85;
  }

  /* flecha SOLO a los que tienen hijos */
  .menuList .hasChildren::after {
    content: "›";
    font-size: 22px;
    opacity: .5;
  }

  .menuList a::after {
    content: "";
  }

  .menuList li:hover,
  .menuList a:hover {
    opacity: 1;
  }


  /* ================= CTA ================= */
  .menuCTA {
    margin-top: auto;
    padding: 14px;
    background: var(--cerulean);
    color: #fff;
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
  }

  /* ================= DESKTOP OFF ================= */
  .nav {
    display: none;
  }

  .mainBar::before {
    clip-path: none;          /* 🔥 quitar corte */
    background: var(--grad-main);
  }
}

/* =========================================================
   DESKTOP – MOBILE ELEMENTS OFF
========================================================= */
@media (min-width: 981px) {
  .hamburger,
  .mobileMenu {
    display: none !important;
  }

}

/* =========================================================
   BOTONES TOPBAR – VERSION INSTITUCIONAL MEJORADA
   Mesa de Partes / Registro de Expediente
========================================================= */

.topBar__right{

display:flex;

align-items:center;

gap:10px;

}



/* BOTON BASE */

.topLink{

display:flex;

align-items:center;

justify-content:center;

height:30px;

padding:0 16px;

font-size:13px;

font-weight:600;

letter-spacing:.2px;

line-height:1;

border-radius:999px;

background:white;

color:var(--prussian-blue);

border:1.5px solid white;

box-shadow:

0 2px 6px rgba(0,0,0,.12);

transition:

background .25s ease,

color .25s ease,

border .25s ease,

transform .15s ease,

box-shadow .25s ease;

}



/* CENTRADO VISUAL FINO TEXTO */

.topLink{

padding-top:1px;

}



/* BOTON PRINCIPAL (Mesa de Partes) */

.topLink[data-link="mesa-de-partes"]{

font-weight:700;

}



/* HOVER PRINCIPAL */

.topLink:hover{

background:transparent;

color:white;

border:1.5px solid white;

box-shadow:

0 6px 14px rgba(0,0,0,.25);

transform:translateY(-1px);

}



/* CLICK EFFECT */

.topLink:active{

transform:translateY(0);

box-shadow:

0 2px 6px rgba(0,0,0,.15);

}



/* EFECTO FOCUS ACCESIBILIDAD */

.topLink:focus-visible{

outline:2px solid white;

outline-offset:2px;

}



/* =========================================================
   SCROLL MODE – HEADER BLANCO
========================================================= */

.siteHeader.isScrolled .topLink{

background:white;

color:var(--prussian-blue);

border:1.5px solid var(--prussian-blue);

}



.siteHeader.isScrolled .topLink:hover{

background:var(--prussian-blue);

color:white;

border:1.5px solid var(--prussian-blue);

box-shadow:

0 6px 14px rgba(0,0,0,.18);

}


/* =========================================================
   MOBILE / TABLET HEADER + MENU
   Compatible con el JS actual
   BREAKPOINT = 980px
========================================================= */
@media (max-width: 980px) {

  /* =========================================================
     BASE
  ========================================================= */
  html {
    overflow-x: hidden;
  }

  body {
    margin: 0;
    padding-top: 56px !important;
  }

  .wrap {
    width: min(100% - 24px, 1240px);
    margin: 0 auto;
  }

  /* =========================================================
     HEADER MOBILE
  ========================================================= */
  .siteHeader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    color: var(--white);
    background: transparent;
    box-shadow: none;
    transition:
      background .28s ease,
      box-shadow .28s ease,
      color .28s ease;
  }

  /* neutraliza el translateY inline del JS desktop */
  .siteHeader,
  .siteHeader.isScrolled {
    transform: translateY(0) !important;
  }

  /* =========================================================
     TOP BAR OFF EN MOBILE
  ========================================================= */
  .topBar,
  .topBar__left,
  .topBar__right {
    display: none !important;
  }

  /* =========================================================
     MAIN BAR
  ========================================================= */
  .mainBar {
    position: relative;
    height: 56px;
    background: transparent;
  }

  .mainBar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--grad-main);
    clip-path: none;
    z-index: 0;
    opacity: 1;
    transition: opacity .28s ease, background .28s ease;
  }

  .mainBar__inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* =========================================================
     LOGO
  ========================================================= */
  .brandBlock {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    transition: opacity .22s ease, visibility .22s ease;
  }

  .brandBlock img {
    display: block;
    height: 28px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
  }

  /* cuando el menú abre, ocultar visualmente el logo */
  .siteHeader:has(.mobileMenu.isOpen) .brandBlock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .siteHeader:has(.mobileMenu.isOpen) .mainBar__inner {
    justify-content: flex-end;
  }

  /* =========================================================
     NAV DESKTOP OFF
  ========================================================= */
  .nav {
    display: none !important;
  }

  /* =========================================================
     HAMBURGUESA
  ========================================================= */
  .hamburger {
    display: flex;
    width: 42px;
    height: 42px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    position: relative;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 10001;
  }

  .hamburger span {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2.5px;
    border-radius: 2px;
    background: #fff;
    transition:
      transform .3s ease,
      top .3s ease,
      opacity .25s ease,
      background .28s ease;
  }

  .hamburger span:nth-child(1) { top: 13px; }
  .hamburger span:nth-child(2) { top: 20px; }
  .hamburger span:nth-child(3) { top: 27px; }

  .hamburger.isActive span:nth-child(1) {
    top: 20px;
    transform: rotate(45deg);
  }

  .hamburger.isActive span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.isActive span:nth-child(3) {
    top: 20px;
    transform: rotate(-45deg);
  }

  /* =========================================================
     SCROLL STATE
  ========================================================= */
  .siteHeader.isScrolled {
    background: var(--white);
    color: var(--deep-navy);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
  }

  .siteHeader.isScrolled .mainBar {
    background: transparent !important;
  }

  .siteHeader.isScrolled .mainBar::before {
    opacity: 0;
    pointer-events: none;
  }

  .siteHeader.isScrolled .hamburger span {
    background: var(--deep-navy);
  }

  /* =========================================================
     MOBILE MENU PANEL
  ========================================================= */
  .mobileMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 360px);
    max-width: 360px;
    height: 100vh;
    background: linear-gradient(180deg, #071536 0%, #001f54 100%);
    z-index: 9998;
    transform: translate3d(-100%, 0, 0);
    transition:
      transform .42s cubic-bezier(.4,0,.2,1),
      background .28s ease,
      color .28s ease;
    box-shadow: 18px 0 40px rgba(0,0,0,.22);
    overflow: hidden;
  }

  .mobileMenu.isOpen {
    transform: translate3d(0, 0, 0);
  }

  /* =========================================================
     LEVELS
  ========================================================= */
  .menuLevel {
    position: absolute;
    inset: 0;
    padding: 84px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translate3d(100%, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition:
      transform .42s cubic-bezier(.4,0,.2,1),
      opacity .22s ease,
      background .28s ease,
      color .28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .menuLevel.isActive {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    pointer-events: auto;
  }

  /* =========================================================
     MENU HEADERS
  ========================================================= */
  .menuHeader {
    display: none;
  }

  .menuHeader2-back {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    opacity: .78;
    cursor: pointer;
    transition: color .28s ease, opacity .28s ease;
  }

  /* =========================================================
     LIST
  ========================================================= */
  .menuList {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .menuList li,
  .menuList a {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    font-size: 18px;
    line-height: 1.25;
    color: #fff;
    opacity: .94;
    transition: color .28s ease, opacity .2s ease;
  }

  .menuList li:hover,
  .menuList a:hover {
    opacity: 1;
  }

  .menuList .hasChildren::after {
    content: "›";
    font-size: 24px;
    line-height: 1;
    opacity: .55;
  }

  .menuList a::after {
    content: "";
  }

  /* =========================================================
     ACTION BUTTONS INSIDE MENU
  ========================================================= */
  .mobileActions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 18px;
  }

  .mobileTopLink,
  .mobileActions .topLink {
    width: 100%;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--prussian-blue);
    border: 1.5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.15;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
    transition:
      background .25s ease,
      color .25s ease,
      border-color .25s ease,
      box-shadow .25s ease,
      transform .15s ease;
  }

  .mobileTopLink:hover,
  .mobileActions .topLink:hover {
    background: transparent;
    color: #fff;
    border-color: #fff;
  }

  .mobileTopLink:active,
  .mobileActions .topLink:active {
    transform: translateY(0);
  }

  /* =========================================================
     SOCIALS
  ========================================================= */
  .redes-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    padding-bottom: 2px;
  }

  .socialIcon2 {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
  }

  .socialIcon2 img {
    display: block;
    width: 19px;
    height: 19px;
    object-fit: contain;
  }

  /* =========================================================
     OLD CTA OFF
  ========================================================= */
  .menuCTA {
    display: none !important;
  }

  /* =========================================================
     MOBILE MENU IN SCROLL STATE
  ========================================================= */
  .siteHeader.isScrolled .mobileMenu {
    background: #fff;
    color: var(--deep-navy);
  }

  .siteHeader.isScrolled .menuHeader2-back,
  .siteHeader.isScrolled .menuList li,
  .siteHeader.isScrolled .menuList a {
    color: var(--deep-navy);
  }

  .siteHeader.isScrolled .menuList .hasChildren::after {
    color: var(--deep-navy);
    opacity: .45;
  }

  .siteHeader.isScrolled .mobileTopLink,
  .siteHeader.isScrolled .mobileActions .topLink {
    background: var(--prussian-blue);
    color: #fff;
    border-color: var(--prussian-blue);
  }

  .siteHeader.isScrolled .mobileTopLink:hover,
  .siteHeader.isScrolled .mobileActions .topLink:hover {
    background: #fff;
    color: var(--prussian-blue);
    border-color: var(--prussian-blue);
  }

  /* =========================================================
     CONTENIDO DE LA PAGINA
     no bloquear ni romper el flujo
  ========================================================= */
  main,
  section,
  .hero,
  .hero--slider,
  .swiper,
  .swiper-container,
  .pageHero,
  .bannerHero {
    position: relative;
    z-index: 1;
  }

  /* =========================================================
     SMALL DEVICES
  ========================================================= */
  @supports (height: 100dvh) {
    .mobileMenu {
      height: 100dvh;
    }
  }

  @media (max-width: 420px) {
    .brandBlock img {
      height: 26px;
      max-width: 175px;
    }

    .mobileMenu {
      width: 88vw;
    }

    .menuLevel {
      padding: 82px 20px 22px;
    }

    .menuList li,
    .menuList a {
      font-size: 17px;
    }
  }
}