/*
 * Barra de menús de la versión 2 (body.pc27-body). Se carga después de css/index2.css desde inclusion/head.php.
 * Escritorio: franja superior delgada + cápsula de vidrio oscuro (se vuelve flotante al hacer scroll).
 * Móvil (meanmenu): barra fija con logo horizontal, botón hamburguesa animado y panel de pantalla completa.
 * El marcado es el de inclusion/barramenus.php (compartido con la versión 1); aquí solo cambia la presentación.
 */

html body.pc27-body {
  --pcm-fondo: #07070d;
  --pcm-vidrio: rgba(12, 12, 22, 0.9);
  --pcm-borde: rgba(255, 255, 255, 0.09);
  --pcm-texto: rgba(245, 245, 250, 0.78);
  --pcm-blanco: #f5f5fa;
  --pcm-c1: #8b5cf6;
  --pcm-c2: #22d3ee;
  --pcm-resorte: cubic-bezier(0.2, 0.9, 0.2, 1.08);
  overflow-x: clip;
}

/* ---------- Franja superior ---------- */
html body.pc27-body .header_top_menu {
  background: #040408 !important;
  border-bottom: 1px solid var(--pcm-borde) !important;
  padding: 0 !important;
  font-size: 12.5px;
}
html body.pc27-body .header_top_menu .container { max-width: 1288px; }
html body.pc27-body .header_top_menu ul { margin: 0; padding: 0; }
html body.pc27-body .header_top_menu a {
  display: inline-flex; align-items: center; min-height: 36px;
  color: rgba(245, 245, 250, 0.62) !important; font-weight: 500; letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
html body.pc27-body .header_top_menu a:hover { color: #fff !important; }
html body.pc27-body .header_top_menu_address_inner ul li a .header-top-icon {
  margin-right: 8px; color: var(--pcm-c2) !important; font-size: 12px;
}
html body.pc27-body .header_top_menu .col-lg-6:first-child .header-top-icon { color: #4ade80 !important; }

/* ---------- Barra principal (escritorio) ---------- */
html body.pc27-body #sticky-header.techno_nav_manu {
  margin-bottom: 0 !important;
  padding: 12px 0;
  background: var(--pcm-fondo) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 990;
}
html body.pc27-body #sticky-header .container { max-width: 1288px; padding-inline: 24px; }
html body.pc27-body #sticky-header .row.tchn-bg {
  margin: 0; padding: 6px 6px 6px 18px !important;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid var(--pcm-borde);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
html body.pc27-body #sticky-header .menu { display: flex; align-items: center; gap: 18px; }

/* Logo: versión horizontal clara solo en la versión 2 */
html body.pc27-body #sticky-header .menu a.logo { padding: 0 !important; flex: none; }
html body.pc27-body #sticky-header .menu a.logo img.menu-logo-img { display: none !important; }
html body.pc27-body #sticky-header .menu a.logo img.menu-logo-v2 {
  display: block !important; width: auto; height: 34px; max-width: none;
  transition: transform 0.4s var(--pcm-resorte), filter 0.3s ease;
}
html body.pc27-body #sticky-header .menu a.logo:hover img.menu-logo-v2 { transform: scale(1.03); filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.35)); }
img.menu-logo-v2 { display: none; }

/* Enlaces */
html body.pc27-body #sticky-header .menu > ul {
  margin: 0 0 0 auto; padding: 0; gap: 2px; text-align: left;
}
html body.pc27-body #sticky-header .menu > ul > li { position: relative; }
html body.pc27-body #sticky-header .menu > ul > li > a {
  position: relative;
  display: inline-flex !important; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px !important; border-radius: 12px;
  color: var(--pcm-texto) !important; font-size: 14px !important; font-weight: 600 !important; letter-spacing: -0.005em;
  background: transparent;
  transition: color 0.2s ease, background 0.25s ease;
}
html body.pc27-body #sticky-header .menu > ul > li > a > .menu-item-icon { display: none !important; }
html body.pc27-body #sticky-header .menu > ul > li > a:hover,
html body.pc27-body #sticky-header .menu > ul > li:hover > a,
html body.pc27-body #sticky-header .menu > ul > li:focus-within > a {
  color: #fff !important; background: rgba(255, 255, 255, 0.07);
}
html body.pc27-body #sticky-header .menu > ul > li > a:focus-visible { outline: 2px solid var(--pcm-c2); outline-offset: 2px; }
/* Subrayado de luz al pasar el mouse */
html body.pc27-body #sticky-header .menu > ul > li:not(.acceder_menu):not(.techno-icon-menu) > a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 7px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pcm-c1), var(--pcm-c2));
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--pcm-resorte);
}
html body.pc27-body #sticky-header .menu > ul > li:hover > a::after,
html body.pc27-body #sticky-header .menu > ul > li:focus-within > a::after { transform: scaleX(1); }

/* Flecha de submenú */
html body.pc27-body #sticky-header .menu-caret {
  margin-left: 0; font-size: 0 !important; width: 8px; height: 8px; display: inline-block;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg); opacity: 0.6;
  transition: transform 0.3s var(--pcm-resorte), opacity 0.2s ease;
}
html body.pc27-body #sticky-header .menu > ul > li:hover .menu-caret,
html body.pc27-body #sticky-header .menu > ul > li:focus-within .menu-caret { transform: translateY(2px) rotate(-135deg); opacity: 1; }

/* Botón Entrar / Salir */
html body.pc27-body #sticky-header .menu > ul > li.acceder_menu { margin-left: 8px; }
html body.pc27-body #sticky-header .menu > ul > li.acceder_menu > a {
  min-height: 44px; padding: 0 22px !important; border-radius: 14px !important;
  background: #fff !important; color: #0a0a12 !important; font-weight: 700 !important;
  box-shadow: 0 10px 30px -12px rgba(139, 92, 246, 0.8) !important;
  overflow: hidden; isolation: isolate;
  transition: color 0.3s ease, transform 0.3s var(--pcm-resorte), box-shadow 0.3s ease;
}
html body.pc27-body #sticky-header .menu > ul > li.acceder_menu > a > .menu-item-icon { display: inline-flex !important; margin-right: 0; color: inherit !important; min-width: 0; }
html body.pc27-body #sticky-header .menu > ul > li.acceder_menu > a::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, var(--pcm-c1), var(--pcm-c2));
  transform: translateX(-101%); transition: transform 0.45s cubic-bezier(0.77, 0, 0.18, 1);
}
html body.pc27-body #sticky-header .menu > ul > li.acceder_menu > a:hover { color: #fff !important; transform: translateY(-1px); box-shadow: 0 16px 36px -12px rgba(34, 211, 238, 0.7) !important; }
html body.pc27-body #sticky-header .menu > ul > li.acceder_menu > a:hover::before { transform: translateX(0); }

/* Buscar */
html body.pc27-body #sticky-header .techno-icon-menu { margin-left: 6px; padding: 0 !important; }
html body.pc27-body #sticky-header .techno-icon-menu a.search-box-outer {
  display: grid !important; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0 !important;
  border-radius: 14px; border: 1px solid var(--pcm-borde); background: rgba(255, 255, 255, 0.04) !important;
  color: var(--pcm-blanco) !important; font-size: 15px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.3s var(--pcm-resorte);
}
html body.pc27-body #sticky-header .techno-icon-menu a.search-box-outer:hover { background: rgba(255, 255, 255, 0.1) !important; border-color: rgba(255, 255, 255, 0.2); transform: rotate(-8deg) scale(1.05); }

/* ---------- Submenús ---------- */
html body.pc27-body #sticky-header .menu > ul > li > ul {
  display: block !important;
  position: absolute; top: calc(100% + 12px); left: 50%; right: auto;
  width: max-content; min-width: 250px; max-width: 560px;
  margin: 0; padding: 8px !important;
  border-radius: 18px;
  background: rgba(14, 14, 24, 0.94) !important;
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.3) !important;
  opacity: 0 !important; visibility: hidden;
  transform: translate(-50%, 10px) scale(0.97); transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.35s var(--pcm-resorte), visibility 0s linear 0.35s;
  z-index: 1000;
}
/* Puente invisible para no perder el hover entre el enlace y el submenú */
html body.pc27-body #sticky-header .menu > ul > li > ul::before {
  content: ""; display: block; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
}
html body.pc27-body #sticky-header .menu > ul > li:hover > ul,
html body.pc27-body #sticky-header .menu > ul > li:focus-within > ul {
  opacity: 1 !important; visibility: visible; transform: translate(-50%, 0) scale(1); pointer-events: auto;
  transition: opacity 0.22s ease, transform 0.35s var(--pcm-resorte), visibility 0s;
}
html body.pc27-body #sticky-header .menu > ul > li > ul > li { width: 100% !important; float: none; padding: 0; }
html body.pc27-body #sticky-header .menu > ul > li > ul a {
  display: flex !important; align-items: center; gap: 12px;
  padding: 10px 12px !important; border-radius: 12px;
  color: rgba(245, 245, 250, 0.82) !important; font-size: 14px !important; font-weight: 500 !important;
  text-transform: none; white-space: nowrap; background: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s var(--pcm-resorte);
}
html body.pc27-body #sticky-header .menu > ul > li > ul a::before { display: none !important; }
html body.pc27-body #sticky-header .menu > ul > li > ul a:hover {
  background: rgba(255, 255, 255, 0.07); color: #fff !important; transform: translateX(3px);
}
html body.pc27-body #sticky-header .menu > ul > li > ul a .menu-item-icon {
  display: grid !important; place-items: center; flex: none;
  width: 34px; height: 34px; min-width: 34px; margin: 0 !important; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--pcm-c2) !important; font-size: 14px;
  transition: background 0.25s ease, color 0.25s ease;
}
html body.pc27-body #sticky-header .menu > ul > li > ul a:hover .menu-item-icon {
  background: linear-gradient(135deg, var(--pcm-c1), var(--pcm-c2)); color: #fff !important; border-color: transparent;
}
/* Mega menú de administración en dos columnas */
html body.pc27-body #sticky-header .menu > ul > li > ul:not(.normal-sub) { display: grid !important; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 4px; }
html body.pc27-body #sticky-header .menu > ul > li > ul > li > ul { margin: 0; padding: 0; display: grid !important; gap: 2px; }
html body.pc27-body #sticky-header .menu > ul > li > ul > li > ul > li { float: none; width: 100%; padding: 0; }
html body.pc27-body #sticky-header .menu > ul > li > ul > li > ul > li a { color: rgba(245, 245, 250, 0.82) !important; }

/* ---------- Estado flotante al hacer scroll ---------- */
html body.pc27-body #sticky-header.techno_nav_manu.sticky {
  position: fixed !important; top: 10px; left: 0; right: 0; width: 100%;
  padding: 0; background: transparent !important;
  animation: pcmBaja 0.55s var(--pcm-resorte) both;
}
html body.pc27-body #sticky-header.sticky .row.tchn-bg {
  background: var(--pcm-vidrio) !important;
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
html body.pc27-body #sticky-header.sticky .menu a.logo img.menu-logo-v2 { height: 30px; }
html body.pc27-body #sticky-header.sticky .menu > ul > li > a { color: var(--pcm-texto) !important; }
html body.pc27-body #sticky-header.sticky .menu > ul > li.acceder_menu > a { color: #0a0a12 !important; }
html body.pc27-body #sticky-header.sticky .menu > ul > li.acceder_menu > a:hover { color: #fff !important; }
@keyframes pcmBaja { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }

/* Escritorio estrecho: menos relleno para que quepan todos los enlaces */
@media (min-width: 992px) and (max-width: 1199.98px) {
  html body.pc27-body #sticky-header .menu > ul > li > a { padding: 0 10px !important; font-size: 13.5px !important; }
  html body.pc27-body #sticky-header .menu a.logo img.menu-logo-v2 { height: 28px; }
  html body.pc27-body #sticky-header .menu > ul > li.acceder_menu > a { padding: 0 16px !important; }
}

/* ==========================================================
   Móvil y tableta (meanmenu, menos de 992 px)
   ========================================================== */
html body.pc27-body .mobile-menu-area {
  position: sticky; top: 0; z-index: 995;
  background: rgba(7, 7, 13, 0.82) !important;
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--pcm-borde);
}
html body.pc27-body .mobile-menu.mean-container { overflow: visible; }
html body.pc27-body .mean-container .mean-bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; padding: 0 12px 0 16px !important; box-sizing: border-box !important;
  background: transparent !important; float: none;
}
html body.pc27-body .mean-container .mean-bar::before {
  content: "" !important; display: block; position: static !important; inset: auto !important; transform: none !important;
  width: 150px; height: 34px; flex: none; margin: 0 !important;
  background: url("../imagenes/logo/logo-horizontal-claro.png") left center / contain no-repeat !important;
}
html body.pc27-body .mean-container .mean-bar::after { display: none !important; }

/* Botón hamburguesa animado */
html body.pc27-body .mean-container a.meanmenu-reveal {
  position: relative !important; inset: auto !important; float: none; margin-left: auto !important;
  display: grid !important; place-content: center; gap: 5px;
  width: 44px !important; height: 44px !important; padding: 0 !important; box-sizing: border-box !important;
  border-radius: 14px; border: 1px solid var(--pcm-borde); background: rgba(255, 255, 255, 0.05);
  color: transparent !important; font-size: 0 !important; text-indent: 0 !important;
  transition: background 0.25s ease;
}
html body.pc27-body .mean-container a.meanmenu-reveal span {
  display: block; width: 20px !important; height: 2px !important; margin: 0 !important; border-radius: 2px;
  background: #fff !important; transition: transform 0.35s var(--pcm-resorte), opacity 0.2s ease;
}
html body.pc27-body .mean-container a.meanmenu-reveal span:nth-child(2) { width: 14px !important; justify-self: end; }
html body.pc27-body .mean-container a.meanmenu-reveal.meanclose { background: linear-gradient(135deg, var(--pcm-c1), var(--pcm-c2)); border-color: transparent; }
html body.pc27-body .mean-container a.meanmenu-reveal.meanclose::before,
html body.pc27-body .mean-container a.meanmenu-reveal.meanclose::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 2px; margin: -1px 0 0 -10px; border-radius: 2px; background: #fff;
  animation: pcmCruz 0.35s var(--pcm-resorte) both;
}
html body.pc27-body .mean-container a.meanmenu-reveal.meanclose::before { --g: 45deg; }
html body.pc27-body .mean-container a.meanmenu-reveal.meanclose::after { --g: -45deg; }
@keyframes pcmCruz { from { transform: rotate(0deg) scaleX(0.3); } to { transform: rotate(var(--g)) scaleX(1); } }

/* Panel del menú */
html body.pc27-body .mean-container .mean-nav {
  position: absolute; left: 0; right: 0; top: 100%; float: none;
  max-height: calc(100svh - 64px); overflow-y: auto; overscroll-behavior: contain;
  margin: 0 !important; background: rgba(7, 7, 13, 0.97) !important;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}
html body.pc27-body .mobile-menu.mean-container nav.mean-nav { background: #08080e !important; }
html body.pc27-body .mean-container .mean-nav ul { box-sizing: border-box !important; width: 100% !important; }
html body.pc27-body .mean-container .mean-nav > ul { padding: 10px 14px 22px !important; background: #08080e !important; }
html body.pc27-body .mean-container .mean-nav ul li {
  float: none; width: 100%; background: transparent !important;
  border-top: 0 !important; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
html body.pc27-body .mean-container .mean-nav > ul > li { animation: pcmEntra 0.5s var(--pcm-resorte) both; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(2) { animation-delay: 0.04s; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(3) { animation-delay: 0.08s; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(4) { animation-delay: 0.12s; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(5) { animation-delay: 0.16s; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(6) { animation-delay: 0.2s; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(7) { animation-delay: 0.24s; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(8) { animation-delay: 0.28s; }
html body.pc27-body .mean-container .mean-nav > ul > li:nth-child(n+9) { animation-delay: 0.32s; }
@keyframes pcmEntra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

html body.pc27-body .mean-container .mean-nav ul li a {
  float: none; display: flex !important; align-items: center; gap: 12px;
  width: auto !important; padding: 16px 56px 16px 6px !important;
  background: transparent !important; color: var(--pcm-blanco) !important;
  font-size: 17px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: -0.01em;
  box-sizing: border-box !important;
}
html body.pc27-body .mean-container .mean-nav ul li a .menu-item-icon {
  display: grid !important; place-items: center; width: 36px; height: 36px; min-width: 36px; margin: 0 !important;
  border-radius: 11px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--pcm-c2) !important; font-size: 15px;
}
html body.pc27-body .mean-container .mean-nav ul li li { border-bottom: 0; }
html body.pc27-body .mean-container .mean-nav ul li li a {
  padding: 11px 12px 11px 18px !important; opacity: 1; border-top: 0 !important;
  color: rgba(245, 245, 250, 0.75) !important; font-size: 15px !important; font-weight: 500 !important;
}
html body.pc27-body .mean-container .mean-nav ul li li a .menu-item-icon { width: 30px; height: 30px; min-width: 30px; font-size: 13px; background: transparent; }
html body.pc27-body .mean-container .mean-nav ul li ul { padding: 0 0 10px !important; }
html body.pc27-body .mean-container .mean-nav ul li a:hover { color: #fff !important; }

/* Botón para abrir subniveles (+ / -) */
html body.pc27-body .mean-container .mean-nav ul li a.mean-expand {
  position: absolute; right: 0; top: 12px; display: grid !important; place-items: center;
  width: 44px !important; height: 44px !important; padding: 0 !important; margin: 0 !important;
  border-radius: 12px; background: rgba(255, 255, 255, 0.05) !important; border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #fff !important; font-size: 20px !important; font-weight: 400 !important;
}
html body.pc27-body .mean-container .mean-nav ul li a.mean-expand.mean-clicked { background: linear-gradient(135deg, var(--pcm-c1), var(--pcm-c2)) !important; border-color: transparent !important; }

/* Entrar / Salir como botón grande */
html body.pc27-body .mean-container .mean-nav ul li.acceder_menu { border-bottom: 0; padding-top: 14px; }
html body.pc27-body .mean-container .mean-nav ul li.acceder_menu a {
  justify-content: center; padding: 15px 20px !important; border-radius: 16px;
  background: linear-gradient(110deg, var(--pcm-c1), var(--pcm-c2)) !important; color: #fff !important;
}
html body.pc27-body .mean-container .mean-nav ul li.acceder_menu a .menu-item-icon { background: transparent; border: 0; color: #fff !important; width: auto; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  html body.pc27-body #sticky-header *,
  html body.pc27-body #sticky-header.sticky,
  html body.pc27-body .mean-container * { animation: none !important; transition: none !important; }
}
