/* ==========================================================
   LAYOUT — header, menú, footer
   ========================================================== */

/* ---------- Loader y progreso ---------- */
.loader {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  background: var(--c-mint-50); transition: opacity .5s var(--ease), visibility .5s;
}
.is-loaded .loader { opacity: 0; visibility: hidden; }
html:not(.js) .loader { display: none; }
.loader__mol { position: relative; width: 74px; height: 74px; color: var(--c-teal); }
.loader__hex { width: 100%; height: 100%; animation: spin 2.4s linear infinite; }
.loader__mol span { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--c-orange); top: 50%; left: 50%; margin: -5px; animation: orbit 1.4s linear infinite; }
.loader__mol span:nth-child(3) { background: var(--c-olive); animation-delay: -.47s; }
.loader__mol span:nth-child(4) { background: var(--c-sage); animation-delay: -.94s; }

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 1200;
  background: linear-gradient(90deg, var(--c-orange), var(--c-olive), var(--c-teal));
  transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
}

/* ---------- Header ---------- */
.site-header { position: sticky; top: calc(var(--topbar-h) * -1); z-index: 1000; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center;
  background: var(--c-teal-900); color: #CFE7E1; font-size: var(--fs-xs);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar__info { display: flex; gap: 1.25rem; align-items: center; min-width: 0; }
.topbar__chip { display: inline-flex; align-items: center; gap: .4rem; color: inherit; white-space: nowrap; font-weight: 500; }
.topbar__chip .icon { color: var(--c-orange); }
a.topbar__chip:hover { color: #fff; }

.navbar {
  position: relative; height: var(--header-h);
  border-bottom: 1px solid rgba(4,140,140,.12);
  transition: height var(--t-med) var(--ease), box-shadow var(--t-med);
}
/* El desenfoque va en un pseudo-elemento: si estuviera en .navbar,
   el menú móvil (position: fixed) quedaría atrapado dentro del header. */
.navbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.is-scrolled .navbar { --header-h: 66px; box-shadow: var(--sh-md); }
.navbar__inner { height: 100%; display: flex; align-items: center; gap: clamp(.6rem, 1vw, 1.2rem); }

.brand { display: block; height: calc(var(--header-h) - 18px); flex-shrink: 0; transition: height var(--t-med) var(--ease); }
.brand .logo-svg { height: 100%; width: auto; }
.brand__sep { width: 1px; height: 46%; background: linear-gradient(transparent, var(--c-sage), transparent); flex-shrink: 0; }
.brand__uni { display: flex; align-items: center; height: calc(var(--header-h) - 30px); flex-shrink: 0; color: var(--c-teal-900); }
.uni-logo { height: 100%; width: auto; }
.uni-logo--text { display: flex; flex-direction: column; justify-content: center; line-height: 1; font-family: var(--f-display); text-transform: uppercase; height: auto; }
.uni-logo--text small { font-size: .62rem; letter-spacing: .12em; color: var(--c-ink-soft); font-family: var(--f-body); font-weight: 700; }
.uni-logo--text strong { font-size: 1.15rem; color: var(--c-olive-700); letter-spacing: .06em; }
.uni-logo--text.is-light small { color: rgba(255,255,255,.75); }
.uni-logo--text.is-light strong { color: #fff; }

/* ---------- Navegación (escritorio) ---------- */
.nav { margin-left: auto; }
.nav__head, .nav__footer { display: none; }
.nav__list { position: relative; display: flex; align-items: center; gap: .15rem; }
.nav__link {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .7rem; border-radius: var(--r-pill);
  font-size: .86rem; font-weight: 700; color: var(--c-teal-900); white-space: nowrap;
  transition: color var(--t-fast);
}
.nav__link .icon { width: 1.05em; height: 1.05em; color: var(--c-teal); transition: transform var(--t-med) var(--ease-bounce), color var(--t-fast); }
.nav__link:hover .icon { transform: translateY(-2px) rotate(-12deg) scale(1.15); color: var(--c-orange); }
.nav__link.is-active, .nav__link.is-active .icon { color: #fff; }
.nav__label--full { display: none; }
.nav__link::after { /* subrayado animado */
  content: ""; position: absolute; left: 1rem; right: 1rem; bottom: .3rem; height: 2px; border-radius: 2px;
  background: var(--c-orange); transform: scaleX(0); transform-origin: right; transition: transform var(--t-med) var(--ease);
}
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__link.is-active::after { display: none; }
.nav__indicator { /* píldora que se desliza al elemento activo/hover (JS) */
  position: absolute; z-index: 0; top: 50%; left: 0; height: 2.35rem; width: 0;
  transform: translate(var(--ix, 0), -50%); width: var(--iw, 0);
  background: var(--g-brand); border-radius: var(--r-pill); box-shadow: 0 6px 18px -6px rgba(4,140,140,.6);
  transition: transform .45s var(--ease), width .45s var(--ease), opacity .3s;
  opacity: var(--io, 0); pointer-events: none;
}
.navbar__cta { flex-shrink: 0; }

@media (min-width: 1200px) and (max-width: 1440px) {
  .nav__link { padding: .5rem .5rem; font-size: .8rem; gap: .3rem; }
  .nav__link .icon { display: none; }
}
@media (min-width: 1200px) and (max-width: 1320px) {
  .brand__sep, .brand__uni { display: none; }
}

/* ---------- Hamburguesa ---------- */
.burger {
  display: none; margin-left: .25rem; width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--c-mint); position: relative; flex-shrink: 0;
  transition: background var(--t-fast), transform var(--t-fast);
}
.burger:hover { background: var(--c-sage); }
.burger:active { transform: scale(.92); }
.burger span {
  position: absolute; left: 13px; right: 13px; height: 2.5px; border-radius: 2px; background: var(--c-teal-900);
  transition: transform .4s var(--ease-bounce), opacity .2s, top .3s var(--ease);
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 22px; right: 18px; }
.burger span:nth-child(3) { top: 28px; }
.nav-open .burger span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.nav-open .burger span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* ---------- Menú móvil / tablet (panel lateral) ---------- */
@media (max-width: 1199px) {
  .burger { display: block; }
  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1100;
    width: min(380px, 88vw); margin: 0; padding: 1.25rem;
    display: flex; flex-direction: column; gap: 1rem;
    background: var(--g-deep); color: #fff;
    transform: translateX(105%); visibility: hidden;
    transition: transform .55s var(--ease), visibility .55s;
    box-shadow: -20px 0 60px rgba(0,0,0,.25); overflow-y: auto;
  }
  .nav::before { /* moléculas decorativas */
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'%3E%3Cpath d='M30 2l26 15v30L30 62 4 47V17zM90 42l26 15v30L90 102 64 87V57z' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E");
  }
  .nav-open .nav { transform: none; visibility: visible; }
  .nav-open .site-header { z-index: 1101; }
  .nav__head { display: flex; justify-content: space-between; align-items: center; position: relative; }
  .nav__title { font-family: var(--f-display); font-size: 1.4rem; letter-spacing: .08em; text-transform: uppercase; }
  .nav__close { width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; transition: transform .4s var(--ease-bounce), background .2s; }
  .nav__close:hover { transform: rotate(90deg); background: var(--c-orange); }
  .nav__list { flex-direction: column; align-items: stretch; gap: .35rem; position: relative; }
  .nav__item { opacity: 0; transform: translateX(40px); transition: opacity .45s var(--ease), transform .45s var(--ease); transition-delay: calc(var(--i) * 55ms + .12s); }
  .nav-open .nav__item { opacity: 1; transform: none; }
  .nav__link { width: 100%; padding: .85rem 1rem; border-radius: var(--r-md); color: #fff; font-size: 1rem; background: rgba(255,255,255,.04); white-space: normal; line-height: 1.3; }
  .nav__link .icon { display: inline-block; color: var(--c-sage); width: 1.25em; height: 1.25em; }
  .nav__link:hover { background: rgba(255,255,255,.1); color: #fff; }
  .nav__link.is-active { background: var(--c-orange); }
  .nav__link::after { display: none; }
  .nav__label--full { display: inline; }
  .nav__label--short { display: none; }
  .nav__indicator { display: none; }
  .nav__footer { display: grid; gap: 1rem; margin-top: auto; position: relative; }
  .navbar__cta { margin-left: auto; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(3,40,42,.55); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
  .nav-open .nav-backdrop { opacity: 1; visibility: visible; }
}
@media (max-width: 640px) {
  .topbar .social--top { display: none; }
  .navbar__cta { display: none; }
  .burger { margin-left: auto; }
  .brand__sep, .brand__uni { display: none; }
}

/* ---------- Redes sociales ---------- */
.social { display: flex; gap: .35rem; flex-wrap: wrap; }
.social-btn {
  position: relative; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  color: inherit; background: rgba(255,255,255,.08); overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease-bounce), color .2s;
}
.social-btn .icon { width: 15px; height: 15px; }
.social-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--c-orange); transform: scale(0); transition: transform .35s var(--ease); }
.social-btn:hover { color: #fff; transform: translateY(-3px) rotate(-8deg); }
.social-btn:hover::before { transform: scale(1); }
.social-btn--facebook:hover::before { background: #1877F2; }
.social-btn--instagram:hover::before { background: linear-gradient(45deg,#F58529,#DD2A7B,#8134AF); }
.social-btn--youtube:hover::before { background: #FF0000; }
.social-btn--x:hover::before { background: #111; }
.social-btn--linkedin:hover::before { background: #0A66C2; }
.social-btn--whatsapp:hover::before { background: #25D366; }
.social--top .social-btn { width: 26px; height: 26px; }
.social--top .social-btn .icon { width: 13px; height: 13px; }
.social--drawer .social-btn, .social--footer .social-btn { width: 40px; height: 40px; background: rgba(255,255,255,.1); color: #fff; }
.social--drawer .social-btn .icon, .social--footer .social-btn .icon { width: 18px; height: 18px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; margin-top: 4rem; color: #D7ECE6; }
.footer-wave { position: absolute; left: 0; bottom: calc(100% - 2px); width: 100%; height: clamp(50px, 7vw, 110px); }
.footer-wave .wave--1 { fill: var(--c-sage); opacity: .55; animation: wave 12s ease-in-out infinite alternate; transform-origin: center; }
.footer-wave .wave--2 { fill: var(--c-teal-900); }
.footer-main { background: var(--c-teal-900); padding: 2rem 0 3rem; position: relative; overflow: hidden; }
.footer-main::after { /* hexágonos animados de fondo */
  content: ""; position: absolute; right: -60px; top: 30%; width: 420px; height: 420px; pointer-events: none; opacity: .06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 5l39 22.5v45L50 95 11 72.5v-45z' fill='none' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M50 25l21.6 12.5v25L50 75 28.4 62.5v-25z' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: spin 60s linear infinite;
}
.footer-title { display: flex; align-items: center; gap: .55rem; font-family: var(--f-display); font-size: 1.15rem; letter-spacing: .06em; text-transform: uppercase; color: #fff; margin-bottom: 1.1rem; }
.footer-title .icon { color: var(--c-orange); }
.footer-title--center { justify-content: center; }

.footer-allies { padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.allies { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.ally__box {
  display: grid; place-items: center; height: 96px; padding: .9rem 1.2rem; border-radius: var(--r-md);
  background: #fff; transition: transform .4s var(--ease-bounce), box-shadow .4s;
}
.ally__box:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 16px 30px -12px rgba(0,0,0,.45); }
.ally__img { max-height: 64px; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(.35); transition: filter .3s; }
.ally__box:hover .ally__img { filter: none; }
.ally__box .img-pendiente { min-height: 0; height: 100%; font-size: .62rem; border-width: 1.5px; padding: .3rem; }
.ally__box .img-pendiente .icon { width: 20px; height: 20px; }

.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr .9fr 1.1fr; gap: clamp(1.5rem, 3vw, 3rem); position: relative; z-index: 1; }
.footer-logo { display: block; max-width: 300px; margin-bottom: 1rem; }
.footer-logo .logo-svg { width: 100%; height: auto; }
.footer-lema { font-weight: 600; color: #fff; }
.footer-events { margin-bottom: 1.25rem; font-size: var(--fs-xs); display: grid; gap: .35rem; }
.footer-events li { padding-left: 1rem; position: relative; }
.footer-events li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-olive); }

.timeline-mini { position: relative; display: grid; gap: 1rem; padding-left: 1.4rem; }
.timeline-mini::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--c-orange), var(--c-olive)); border-radius: 2px; }
.timeline-mini li { position: relative; display: grid; font-size: var(--fs-sm); line-height: 1.4; }
.timeline-mini strong { color: #fff; }
.timeline-mini__dot { position: absolute; left: -1.4rem; top: .3em; width: 12px; height: 12px; border-radius: 50%; background: var(--c-orange); box-shadow: 0 0 0 4px rgba(242,142,19,.25); animation: pulse 2.4s infinite; }
.timeline-mini li.is-pending strong { color: var(--c-orange); }
.timeline-mini li.is-pending .timeline-mini__dot { background: transparent; border: 2px dashed var(--c-orange); animation: none; }

.footer-links { display: grid; gap: .4rem; font-size: var(--fs-sm); }
.footer-links a { color: #D7ECE6; display: inline-flex; align-items: center; gap: .3rem; transition: color .2s, transform .3s var(--ease); }
.footer-links a .icon { width: .9em; color: var(--c-olive); transition: transform .3s var(--ease); }
.footer-links a:hover { color: #fff; transform: translateX(4px); }
.footer-links a:hover .icon { transform: translateX(3px); color: var(--c-orange); }

.footer-address { font-size: var(--fs-sm); }
.footer-address a:not(.btn) { color: #fff; display: inline-flex; gap: .4rem; align-items: center; }
.footer-address .btn { margin-top: .25rem; }
.footer-address strong { color: #fff; }

.footer-bottom { background: #022C2E; padding: 1rem 0; font-size: var(--fs-xs); color: #9FC4BB; }
.footer-bottom__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #CFE7E1; }

@media (max-width: 1100px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px)  { .allies { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  {
  .footer-grid { grid-template-columns: 1fr; }
  .allies { grid-template-columns: repeat(2, 1fr); }
  .allies li:last-child { grid-column: 1 / -1; }
  .ally__box { height: 84px; }
}

/* ---------- Botón volver arriba ---------- */
.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900; width: 52px; height: 52px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--c-teal); color: #fff; box-shadow: var(--sh-md);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: opacity .3s, transform .4s var(--ease-bounce), background .2s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--c-orange); }
.to-top:hover > .icon { animation: bounceUp .6s var(--ease); }
.to-top__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top__ring circle { fill: none; stroke: var(--c-olive); stroke-width: 3; stroke-dasharray: 132; stroke-dashoffset: calc(132 - 132 * var(--progress, 0)); stroke-linecap: round; }
