/* =========================================================
   VARIABLES
========================================================= */
:root {
  --prussian-blue: #0a1128;
  --deep-navy: #001f54;
  --yale-blue: #034078;
  --cerulean: #1282a2;
  --white: #fefcfb;

  --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;
  align-items: center;
  justify-content: space-between;
}

.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: 12px;
}

.socialIcon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   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;
  align-items: center;
  justify-content: space-between;
}

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

/* enlaces principales */
.navList > li > a,
.servicesTrigger {
  font-size: 17px;
  font-family: inherit;
  padding: 10px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* raya 3D SOLO para items normales (no CTA) */
.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 (MESA DE PARTES – SIN HOVER)
========================================================= */
.cta a {
  background: var(--white);
  color: var(--prussian-blue);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-weight: 800;
}

/* =========================================================
   MEGA MENU (SERVICIOS)
========================================================= */
.hasMega {
  position: relative;
}

/* permanece abierto mientras el mouse esté en Servicios o el menú */
.hasMega:hover > .megaMenu,
.hasMega:focus-within > .megaMenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.megaMenu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: 760px;
  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(14px);
  pointer-events: none;
  overflow: hidden;
  font-family: inherit; /* MISMA TIPOGRAFÍA DEL HEADER */
}

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

.megaLeft h4 {
  font-size: 17px;            /* MISMO TAMAÑO HEADER */
  font-weight: 600;
  margin: 0 0 22px;
  opacity: .9;
}

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

.megaLeft li {
  padding: 12px 2px;
  cursor: pointer;
  position: relative;
  font-size: 17px;            /* MISMO TAMAÑO HEADER */
  opacity: .7;
}

/* raya 3D lateral */
.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.isActive,
.megaLeft li:hover {
  opacity: 1;
}

.megaLeft li.isActive::after,
.megaLeft li:hover::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;           /* MISMO TAMAÑO HEADER */
  font-family: inherit;
  position: relative;
  opacity: .85;
}

/* raya 3D inferior */
.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);
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 980px) {

  .navList {
    gap: 16px;
    overflow-x: auto;
  }

  .mainBar::before {
    clip-path: none;
  }

  .megaMenu {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    box-shadow: none;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .hasMega.open > .megaMenu {
    display: grid;
  }

  .megaLeft {
    border-right: none;
  }

  .megaRight {
    padding: 18px;
  }

  .megaRight .panel {
    display: block;
  }
}
