:root{ 
  --nav-h: 78px;
  --bg: #fff;
  --text: #111;
  --muted: rgba(0,0,0,.55);
  
  --accent: #aaff78; /* solo para partículas (canvas) */

  /* ✅ TAMAÑO LOGO como referencia */
  --logo-h-desktop: 140px;
  --logo-h-mobile: 78px;
  --logo-pop: 10px;       /* cuánto sobresale hacia abajo */
}

*{ box-sizing:border-box; }
body{ margin:0; font-family: system-ui, "Segoe UI", Arial, sans-serif; }

.site-header{ position: sticky; top:0; z-index: 9999; }

.nav{
  position: relative;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: visible; /* dropdown visible */
}

/* Canvas partículas (sin fondo) */
.nav-particles{
  position:absolute;
  left:0; top:0;
  width:100%;
  height:220px;     /* JS recalcula */
  pointer-events:none;
  z-index: 4;
}

/* Contenedor */
.nav-inner{
  height: var(--nav-h); 
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 18px;
  position: relative;
  z-index: 3;
}

/* =========================================================
   LOGO: efecto espejo (mirror shine) con forma del logo
========================================================= */
.brand{
  height: var(--nav-h);
  display:flex;
  margin-top: 30px;
  align-items:center;
  padding-right: 14px;
  position: relative;

  /* ruta del logo (para mask) */
  --logo-mask: url("../img/Logo/logo1.png");
}

.brand img{
  display:block;
  width:auto;
  height: var(--logo-h-desktop);
  transform: translateY(var(--logo-pop));
  filter: none;
}

/* Shine tipo espejo REAL (2 capas + blur suave) */
.brand::after{
  content:"";
  position:absolute;
  left: 0;

  top: 50%;
  height: var(--logo-h-desktop);
  transform: translateY(calc(-50% + var(--logo-pop)));

  width: 260px; /* ajusta si tu logo es más ancho */
  pointer-events:none;

  /* ✅ espejo: banda ancha + línea fina */
  background:
    linear-gradient(120deg,
      transparent 0%,
      rgba(255,255,255,0) 34%,
      rgba(255,255,255,.18) 44%,
      rgba(255,255,255,.95) 50%,
      rgba(255,255,255,.18) 56%,
      rgba(255,255,255,0) 66%,
      transparent 100%
    ),
    linear-gradient(120deg,
      transparent 0%,
      rgba(255,255,255,0) 47%,
      rgba(255,255,255,1) 50%,
      rgba(255,255,255,0) 53%,
      transparent 100%
    );

  /* ✅ importante: 2 valores (una por capa) */
  background-size: 260% 100%, 260% 100%;
  background-position: 220% 0, 220% 0;

  animation: logoShine 6s ease-in-out infinite;

  -webkit-mask-image: var(--logo-mask);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: left center;
  -webkit-mask-size: contain;

  mask-image: var(--logo-mask);
  mask-repeat: no-repeat;
  mask-position: left center;
  mask-size: contain;

  opacity: .95;
  mix-blend-mode: screen;

  /* ✅ suaviza el brillo como vidrio */
  filter: blur(.35px) saturate(1.05);
}

@keyframes logoShine{
  0%   { background-position: 220% 0, 220% 0; opacity: 0; }
  12%  { opacity: .95; }
  55%  { opacity: .95; }
  80%  { opacity: .20; }
  100% { background-position: -40% 0, -40% 0; opacity: 0; }
}

/* HAMBURGUESA */
.hamburger{
  display:none;
  width: 44px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px;
}
.hamburger span{
  display:block;
  height:2px;
  width: 100%;
  background: #111;
  border-radius: 99px;
  margin: 6px 0;
}

/* MENU */
.nav-menu{ display:block; }

.nav-list{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 18px;
  margin:0;
  padding:0;
}

.nav-item{
   position: relative; 
   background: #fff;
  }

/* LINKS SIN RECUADRO */
.nav-link{
  position: relative;
  display:inline-flex;
  align-items:center;
  gap: 10px;

  padding: 10px 4px;
  border: 0;
  background: transparent;
  border-radius: 12px;

  font-weight: 900;
  letter-spacing: .6px;
  font-size: 15px;
  color: var(--text);
  text-decoration:none;

  cursor: pointer;
  user-select:none;

  --tx: 0px;
  --ty: 0px;
}

.nav-link-btn{ appearance:none; border:0; background:transparent; }

.chev{ font-size: 13px; opacity:.75; }

/* underline limpio */
.nav-link::after{
  content:"";
  position:absolute;
  left:0; right:0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: rgba(0,0,0,.22);
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform .14s ease;
  pointer-events:none;
  opacity: .9;
}
.nav-link:hover::after{ transform: scaleX(1); }

/* ===== TEXTO MAGNÉTICO ===== */
.nav-text{
  display:inline-block;
  transform: translate(var(--tx), var(--ty));
  transition: transform .18s ease;
  will-change: transform;
}
.nav-link:hover .nav-text{ transition: transform .06s linear; }

/* ICONO (tema) */
.nav-icon{ margin-left: 8px; }
.icon-btn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  cursor:pointer;
  font-size: 18px;
  display:grid;
  place-items:center;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.03);
}

/* SUBMENÚ (solo click) */
.has-sub{ position: relative; }

/* Puente invisible para mantener hover al mover el mouse al submenu */
.has-sub::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
}

.submenu{
  position:absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);

  list-style:none;
  margin:0;

  background: rgba(255,255,255,.98);
  /*border: 1px solid rgba(0,0,0,.10);*/
  border-radius: 8px;
  box-shadow: 0 16px 50px rgba(0,0,0,.18);

  opacity:0;
  pointer-events:none;
  translate: 0 -8px;
  transition: opacity .16s ease, translate .16s ease;
  z-index: 6;

  /* ✅ ancho por contenido */
  min-width: fit-content !important;
  width: fit-content;
  max-width: 92vw;
  padding: 8px;
}

.has-sub.is-open > .submenu{
  opacity:1;
  pointer-events:auto;
  translate: 0 0;
}

.submenu-link{
  position: relative;
  display:flex;
  padding: 12px 12px;
  border-radius: 12px;

  white-space: nowrap;

  font-weight: 900;
  color: #111;
  text-decoration:none;
  letter-spacing: .4px;

  --tx: 0px;
  --ty: 0px;
}

.submenu-link::after{
  content:"";
  position:absolute;
  left: 12px; right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: rgba(0,0,0,.18);
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform .14s ease;
  pointer-events:none;
  opacity: .9;
}
.submenu-link:hover::after{ transform: scaleX(1); }

.submenu-link:hover .nav-text{ transition: transform .06s linear; }

/* RESPONSIVE */
@media (max-width: 980px){
  .hamburger{ display:block; }

  .nav-menu{
    position: absolute;
    top: var(--nav-h);
    left:0; right:0;

    background: rgba(255,255,255,.98);
    border-bottom: 1px solid rgba(0,0,0,.10);
    box-shadow: 0 18px 50px rgba(0,0,0,.14);

    max-height: 0;
    overflow: hidden;
    transition: max-height .22s ease;
    z-index: 7;
  }
  .nav-menu.is-open{ max-height: 75vh; }

  .nav-list{
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px 14px 16px;
  }

  .nav-link{
    width:100%;
    justify-content: space-between;
    padding: 12px 10px;
  }

  /* Submenu dentro del flujo */
  .submenu{
    position: static;
    transform: none;
    box-shadow: none;
    margin-top: 8px;
    border-radius: 12px;

    opacity: 1;
    pointer-events:auto;

    max-height: 0;
    overflow:hidden;
    padding: 0;
    translate: none;
    transition: max-height .22s ease, padding .22s ease;

    width: auto;
    max-width: 100%;
  }

  .has-sub.is-open > .submenu{
    max-height: 340px;
    padding: 10px 14px;
  }

  /* En movil no se necesita puente de hover */
  .has-sub::after{
    display: none;
  }

  /* Logo móvil */
  .brand img{
    height: var(--logo-h-mobile);
    transform: translateY(calc(var(--logo-pop) - 2px));
  }
  .brand::after{
    height: var(--logo-h-mobile);
    width: 230px;
  }
}

/* Margen solo desktop */
@media (min-width: 1024px){
  .nav-inner{
    padding-left: 48px;
    margin-top: 10px;
  }
}
@media (min-width: 768px){
  .nav-inner{
    padding-left: 48px;
  }
}

/* =========================================================
   MENU MOVIL UNIFICADO
   Usa en todas las paginas el panel compacto de Quienes Somos.
========================================================= */
@media (max-width: 900px){
  .topbar{
    display: none;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }

  .nav-menu,
  .nav-menu.is-open{
    left: auto !important;
    right: 12px !important;
    width: min(320px, calc(100vw - 24px)) !important;
    border-radius: 18px !important;
    border-bottom: 0 !important;
    box-shadow: 0 14px 30px rgba(0,0,0,.10) !important;
  }

  .brand{
    position: relative;
    z-index: 10020;
  }

  .brand img{
    position: relative;
    z-index: 10021;
  }

  .site-header,
  .nav{
    border-bottom: 0 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 600px){
  .nav-menu,
  .nav-menu.is-open{
    right: 10px !important;
    width: min(290px, calc(100vw - 20px)) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 26px rgba(0,0,0,.10) !important;
  }
}
