/* =========================================================
   EMA · HEADER GLOBAL V8
   Diseñado para las subpáginas HTML generadas por WebSite X5.
   Replica el header aprobado del index.php sin tocar el contenido.
   ========================================================= */

#ema-global-header-root,
#ema-global-header-root *,
#ema-global-header-root *::before,
#ema-global-header-root *::after{box-sizing:border-box;}

#ema-global-header-root{
  --ema-gh-green:#007A3D;
  --ema-gh-green-dark:#005B2E;
  --ema-gh-border:#e5e7eb;
  --ema-gh-shadow:0 14px 38px rgba(16,24,40,.10);
  position:relative;
  z-index:11000;
  width:100%;
  margin:0;
  padding:0;
  font-family:"Segoe UI",Arial,Helvetica,sans-serif;
  color:#172033;
}

/* Oculta restos del encabezado/sticky generado por X5 si alguna página los conserva. */
html.ema-global-header-active #imHeaderBg,
html.ema-global-header-active #imHeader,
html.ema-global-header-active #imStickyBarContainer{
  display:none!important;
}

/* ---------------- GOV.CO ---------------- */
#ema-global-header-root .govco-topbar{
  position:relative;
  z-index:12000;
  width:100%;
  height:56px;
  margin:0;
  padding:0;
  background:#0943B5;
  border:0;
  box-shadow:0 5px 16px rgba(9,67,181,.14);
}

#ema-global-header-root .govco-topbar__inner{
  width:min(1240px,calc(100vw - 28px));
  height:100%;
  margin:0 auto;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
}

#ema-global-header-root .govco-topbar__link{
  display:inline-flex;
  align-items:center;
  height:100%;
  padding:0 2px;
  color:#fff;
  text-decoration:none;
  line-height:0;
}

#ema-global-header-root .govco-topbar__logo{
  display:block;
  width:auto;
  height:28px;
  max-width:150px;
  object-fit:contain;
  object-position:left center;
  transition:opacity .18s ease,transform .18s ease;
}

#ema-global-header-root .govco-topbar__link:hover .govco-topbar__logo{
  opacity:.92;
  transform:translateY(-1px);
}

#ema-global-header-root .govco-topbar__link:focus-visible{
  outline:2px solid #fff;
  outline-offset:4px;
  border-radius:4px;
}

/* ---------------- CONTENEDOR HEADER EMA ---------------- */
#ema-global-header-root .ema-page{
  width:min(1240px,calc(100vw - 28px));
  margin:22px auto 22px;
}

#ema-global-header-root .ema-header{
  position:relative;
  z-index:9999;
  overflow:visible;
  background:#fff;
  border:0;
  border-radius:28px;
  box-shadow:0 18px 46px rgba(16,24,40,.10),0 4px 12px rgba(16,24,40,.045);
}

#ema-global-header-root .ema-header-main{
  --ema-head-gap-top:14px;
  --ema-head-height:96px;
  position:relative;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(330px,365px) minmax(0,1fr);
  column-gap:22px;
  align-items:end;
  height:calc(var(--ema-head-gap-top) + var(--ema-head-height));
  min-height:0;
  padding:var(--ema-head-gap-top) 20px 0;
  background:#fff;
  border:0;
  border-radius:28px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,1),inset 0 -1px 0 rgba(16,24,40,.025);
  overflow:visible;
}

#ema-global-header-root .ema-logo{
  position:relative;
  z-index:4;
  align-self:end;
  justify-self:start;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  min-width:0;
  height:var(--ema-head-height);
  margin:0;
  overflow:visible;
  text-decoration:none;
}

#ema-global-header-root .ema-logo img{
  display:block;
  width:100%;
  height:86px;
  max-width:365px;
  max-height:86px;
  margin:0;
  object-fit:contain;
  object-position:left center;
  filter:drop-shadow(0 8px 13px rgba(15,23,42,.09));
}

/* ---------------- MENÚ PRINCIPAL ---------------- */
#ema-global-header-root .ema-nav{
  position:relative;
  z-index:10000;
  align-self:end;
  justify-self:stretch;
  width:100%;
  min-width:0;
  height:68px;
  margin:0 0 14px;
  padding:0 4px;
  overflow:visible;
  border:0;
  border-radius:18px;
  background:linear-gradient(180deg,#fcfdfd 0%,#f5f7f6 52%,#eef1ef 100%);
  box-shadow:0 15px 28px rgba(16,24,40,.105),0 5px 10px rgba(16,24,40,.04),inset 0 1px 0 rgba(255,255,255,.98),inset 0 -1px 0 rgba(16,24,40,.035);
}

#ema-global-header-root .ema-menu-toggle{display:none;}

#ema-global-header-root .ema-nav-list{
  position:relative;
  display:grid;
  grid-template-columns:
    minmax(74px,.80fr)
    minmax(108px,1.12fr)
    minmax(154px,1.52fr)
    minmax(103px,1.05fr)
    minmax(76px,.78fr)
    minmax(90px,.90fr)
    minmax(78px,.80fr)
    minmax(76px,.78fr);
  align-items:stretch;
  gap:0;
  width:100%;
  min-width:0;
  height:100%;
  margin:0;
  padding:0;
  overflow:visible;
  list-style:none;
  background:transparent;
  border:0;
  border-radius:inherit;
}

#ema-global-header-root .ema-nav-list > .ema-nav-item{
  position:relative;
  display:flex;
  align-items:stretch;
  min-width:0;
  width:auto;
  height:100%;
  margin:0;
  padding:0;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:13px 0 18px -18px rgba(16,24,40,.72),5px 0 9px -10px rgba(16,24,40,.18);
}

#ema-global-header-root .ema-nav-list > .ema-nav-item:last-child{box-shadow:none;}

#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-link,
#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-label{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  height:68px;
  min-height:68px;
  margin:0;
  padding:10px 10px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:#06743d;
  box-shadow:none;
  font:850 13.5px/1.16 "Segoe UI",Arial,Helvetica,sans-serif;
  letter-spacing:-.012em;
  text-align:center;
  text-decoration:none;
  white-space:normal;
  cursor:pointer;
  transition:background .18s ease,color .18s ease,box-shadow .18s ease;
}

#ema-global-header-root .ema-nav-list > .ema-nav-item:nth-child(3) > .ema-nav-link{
  padding-left:12px;
  padding-right:12px;
}

#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-link::before,
#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-label::before,
#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-link::after,
#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-label::after{
  content:none!important;
  display:none!important;
}

#ema-global-header-root .ema-nav-list > .ema-nav-item:hover > .ema-nav-link,
#ema-global-header-root .ema-nav-list > .ema-nav-item:hover > .ema-nav-label,
#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-link:focus-visible,
#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-label:focus-visible,
#ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-link.is-current{
  background:rgba(255,255,255,.64);
  color:#005b2e;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95),0 8px 18px rgba(16,24,40,.065);
  outline:none;
}

/* ---------------- SUBMENÚS ---------------- */
#ema-global-header-root .ema-submenu{
  position:absolute;
  top:calc(100% + 9px);
  left:0;
  min-width:238px;
  margin:0;
  padding:8px;
  list-style:none;
  background:rgba(255,255,255,.98);
  border:1px solid rgba(16,24,40,.07);
  border-radius:16px;
  box-shadow:0 20px 48px rgba(16,24,40,.16),inset 0 1px 0 rgba(255,255,255,.96);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(7px);
  transition:opacity .18s ease,transform .18s ease,visibility .18s ease;
  z-index:10050;
}

#ema-global-header-root .ema-nav-item:hover > .ema-submenu,
#ema-global-header-root .ema-nav-item:focus-within > .ema-submenu{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0);
}

#ema-global-header-root .ema-submenu .ema-nav-item{
  position:relative;
  display:block;
  width:100%;
}

#ema-global-header-root .ema-submenu .ema-nav-link,
#ema-global-header-root .ema-submenu .ema-nav-label{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  min-height:40px;
  margin:0;
  padding:10px 13px;
  border:0;
  border-radius:11px;
  background:#fff;
  color:#1f2937;
  box-shadow:none;
  font:750 13.5px/1.22 "Segoe UI",Arial,Helvetica,sans-serif;
  text-align:left;
  text-decoration:none;
  white-space:normal;
  cursor:pointer;
}

#ema-global-header-root .ema-submenu .ema-nav-link:hover,
#ema-global-header-root .ema-submenu .ema-nav-label:hover,
#ema-global-header-root .ema-submenu .ema-nav-link:focus-visible,
#ema-global-header-root .ema-submenu .ema-nav-label:focus-visible{
  background:#f2f6f4;
  color:#005b2e;
  outline:none;
}

#ema-global-header-root .ema-submenu .ema-submenu{
  top:0;
  left:calc(100% + 8px);
}

#ema-global-header-root .ema-nav-list > .ema-nav-item:nth-last-child(-n+3) > .ema-submenu{
  left:auto;
  right:0;
}

#ema-global-header-root .ema-nav-list > .ema-nav-item:nth-last-child(-n+3) > .ema-submenu .ema-submenu{
  left:auto;
  right:calc(100% + 8px);
}

/* ---------------- RESPONSIVE ---------------- */
@media(max-width:1120px){
  #ema-global-header-root .ema-page{
    width:min(860px,calc(100vw - 24px));
    margin-top:16px;
  }

  #ema-global-header-root .ema-header-main{
    display:grid;
    grid-template-columns:1fr;
    height:auto;
    min-height:0;
    padding:16px 18px 18px;
    gap:12px;
    align-items:center;
  }

  #ema-global-header-root .ema-logo{
    justify-self:center;
    width:min(390px,92%);
    height:76px;
  }

  #ema-global-header-root .ema-logo img{
    height:70px;
    max-width:390px;
    max-height:70px;
    object-position:center;
  }

  #ema-global-header-root .ema-nav{
    width:100%;
    height:auto;
    min-height:0;
    margin:0;
    padding:0;
    border-radius:16px;
    background:transparent;
    box-shadow:none;
  }

  #ema-global-header-root .ema-menu-toggle{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    width:100%;
    min-height:48px;
    margin:0;
    padding:11px 16px;
    border:0;
    border-radius:14px;
    background:linear-gradient(180deg,#f8faf9,#eef2ef);
    color:#06743d;
    box-shadow:0 10px 24px rgba(16,24,40,.09),inset 0 1px 0 rgba(255,255,255,.96);
    font:850 14px/1 "Segoe UI",Arial,Helvetica,sans-serif;
    cursor:pointer;
  }

  #ema-global-header-root .ema-menu-toggle-icon{
    width:20px;
    display:grid;
    gap:4px;
  }

  #ema-global-header-root .ema-menu-toggle-icon i{
    display:block;
    width:20px;
    height:2px;
    border-radius:999px;
    background:#06743d;
    transition:transform .2s ease,opacity .2s ease;
  }

  #ema-global-header-root .ema-nav.open .ema-menu-toggle-icon i:nth-child(1){transform:translateY(6px) rotate(45deg);}
  #ema-global-header-root .ema-nav.open .ema-menu-toggle-icon i:nth-child(2){opacity:0;}
  #ema-global-header-root .ema-nav.open .ema-menu-toggle-icon i:nth-child(3){transform:translateY(-6px) rotate(-45deg);}

  #ema-global-header-root .ema-nav-list{
    display:none;
    grid-template-columns:1fr;
    width:100%;
    height:auto;
    margin:10px 0 0;
    padding:8px;
    gap:6px;
    border-radius:16px;
    background:linear-gradient(180deg,#fafcfb,#eef2ef);
    box-shadow:0 14px 30px rgba(16,24,40,.10),inset 0 1px 0 #fff;
  }

  #ema-global-header-root .ema-nav.open .ema-nav-list{display:grid;}

  #ema-global-header-root .ema-nav-list > .ema-nav-item{
    display:block;
    width:100%;
    height:auto;
    box-shadow:none;
  }

  #ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-link,
  #ema-global-header-root .ema-nav-list > .ema-nav-item > .ema-nav-label{
    justify-content:space-between;
    width:100%;
    height:auto;
    min-height:46px;
    padding:11px 14px;
    border-radius:12px;
    background:#fff;
    box-shadow:0 6px 14px rgba(16,24,40,.055);
    text-align:left;
  }

  #ema-global-header-root .ema-nav-list > .ema-nav-item.has-submenu > .ema-nav-label::after,
  #ema-global-header-root .ema-submenu .ema-nav-item.has-submenu > .ema-nav-label::after{
    content:"+"!important;
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    width:24px!important;
    height:24px!important;
    margin-left:12px;
    flex:0 0 24px;
    border-radius:50%;
    background:#eef6f1;
    color:#06743d;
    font-size:18px;
    line-height:1;
  }

  #ema-global-header-root .ema-nav-list > .ema-nav-item.has-submenu.open > .ema-nav-label::after,
  #ema-global-header-root .ema-submenu .ema-nav-item.has-submenu.open > .ema-nav-label::after{
    content:"−"!important;
  }

  #ema-global-header-root .ema-submenu,
  #ema-global-header-root .ema-submenu .ema-submenu{
    position:static;
    display:none;
    width:100%;
    min-width:0;
    margin:6px 0 0;
    padding:7px;
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:none;
    background:#f8faf9;
    border:1px solid rgba(16,24,40,.06);
    border-radius:13px;
    box-shadow:none;
  }

  #ema-global-header-root .ema-nav-item.open > .ema-submenu{display:grid;gap:5px;}

  #ema-global-header-root .ema-submenu .ema-nav-link,
  #ema-global-header-root .ema-submenu .ema-nav-label{
    min-height:42px;
    padding:10px 12px;
    border-radius:10px;
  }
}

@media(max-width:640px){
  #ema-global-header-root .govco-topbar{height:48px;}
  #ema-global-header-root .govco-topbar__inner{width:calc(100vw - 18px);}
  #ema-global-header-root .govco-topbar__logo{height:24px;max-width:128px;}

  #ema-global-header-root .ema-page{
    width:calc(100vw - 18px);
    margin:10px auto 16px;
  }

  #ema-global-header-root .ema-header,
  #ema-global-header-root .ema-header-main{border-radius:22px;}

  #ema-global-header-root .ema-header-main{padding:13px 12px 14px;}

  #ema-global-header-root .ema-logo{
    width:min(330px,94%);
    height:66px;
  }

  #ema-global-header-root .ema-logo img{
    height:60px;
    max-width:330px;
    max-height:60px;
  }
}
