/* =========================================================
   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: 28px;
  margin: 0;
  padding: 0;
}

.navList > li {
  position: relative;
}

.navList > li > a,
.servicesTrigger {
  font-size: 17px;
  padding: 8px 10px;
  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: 12px 20px;
  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: 980px) {

  /* ================= 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;
  }

}
