/* ============================================================
   MASTER GROOVERS — SHARED UI
   Glass top bar (all pages) + entrance animation + logo glow
   + "Clase Demo S/50" promo popup.
   Self-contained (no Tailwind dependency).
   ============================================================ */

:root {
  --mg-accent:   #e879f9;
  --mg-accent-2: #c026d3;
  --mg-ink:      #ffffff;
  --mg-muted:    rgba(255, 255, 255, 0.55);
  --mg-ease:     cubic-bezier(0.16, 1, 0.3, 1);
  --mg-bar-h:    68px;
}

/* Hide any legacy per-page nav/header once the shared bar is in.
   Legacy global-player is removed at the HTML level. */
html.mg-ui-on nav.mg-legacy-nav,
html.mg-ui-on header.mg-legacy-nav { display: none !important; }

/* ---------- TOP BAR ---------- */
.mg-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  height: var(--mg-bar-h);
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  /* entrance animation on first paint */
  animation: mgBarIn 0.9s var(--mg-ease) both;
}
@keyframes mgBarIn {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.mg-bar__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* ---------- LOGO + ITINERANT GLOW ---------- */
.mg-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  animation: mgLogoIn 1s var(--mg-ease) 0.15s both;
}
@keyframes mgLogoIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.mg-logo img {
  height: 30px;
  width: auto;
  display: block;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 6px rgba(232, 121, 249, 0.25));
  transition: transform 0.25s var(--mg-ease);
}
.mg-logo:hover img { transform: scale(1.05); }
/* traveling glow orbiting behind the logo */
.mg-logo::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 121, 249, 0.85) 0%, rgba(99, 102, 241, 0.35) 45%, transparent 70%);
  filter: blur(7px);
  opacity: 0.9;
  pointer-events: none;
  animation: mgLogoOrbit 4.5s linear infinite;
}
@keyframes mgLogoOrbit {
  0%   { transform: rotate(0deg)   translateX(26px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(26px) rotate(-360deg); }
}

/* ---------- LINKS ---------- */
.mg-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mg-muted);
}
.mg-nav a {
  position: relative;
  color: inherit;
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s var(--mg-ease);
}
.mg-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--mg-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--mg-ease);
}
.mg-nav a:hover { color: var(--mg-ink); }
.mg-nav a:hover::after { transform: scaleX(1); }
.mg-nav a.is-active {
  color: var(--mg-ink);
}
.mg-nav a.is-active::after { transform: scaleX(1); }

/* ---------- CTA ---------- */
.mg-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #000;
  text-decoration: none;
  background: var(--mg-accent);
  box-shadow: 0 6px 22px rgba(232, 121, 249, 0.3);
  transition: transform 0.15s var(--mg-ease), filter 0.2s;
}
.mg-cta:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.08); }
.mg-cta:active { transform: scale(0.97); }

/* ---------- MOBILE ---------- */
.mg-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.mg-burger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.3s var(--mg-ease), opacity 0.2s;
}
.mg-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mg-burger.is-open span:nth-child(2) { opacity: 0; }
.mg-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mg-drawer {
  position: fixed;
  inset: 0;
  z-index: 9989;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 40px;
  background: rgba(8, 8, 10, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateX(100%);
  transition: transform 0.4s var(--mg-ease);
}
.mg-drawer.is-open { transform: translateX(0); }
.mg-drawer a {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--mg-muted);
  text-decoration: none;
  padding: 10px 0;
  transition: color 0.2s;
}
.mg-drawer a:hover,
.mg-drawer a.is-active { color: #fff; }
.mg-drawer a.mg-drawer__cta { color: var(--mg-accent); }

@media (max-width: 820px) {
  .mg-nav { display: none; }
  .mg-cta { display: none; }
  .mg-burger { display: flex; }
}

/* ---------- PROMO POPUP (Clase Demo S/50) ---------- */
.mg-promo {
  position: fixed;
  z-index: 9992;
  right: clamp(12px, 3vw, 26px);
  bottom: clamp(12px, 3vw, 26px);
  width: min(340px, calc(100vw - 24px));
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: rgba(14, 14, 16, 0.82);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(232, 121, 249, 0.28);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(232, 121, 249, 0.12);
  color: #fff;
  font-family: 'Outfit', -apple-system, sans-serif;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.5s var(--mg-ease), transform 0.5s var(--mg-ease);
}
.mg-promo.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.mg-promo__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mg-accent);
  margin-bottom: 10px;
}
.mg-promo__badge::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mg-accent);
  box-shadow: 0 0 10px var(--mg-accent);
  animation: mgBlink 1.5s ease-in-out infinite;
}
@keyframes mgBlink { 0%,100%{opacity:1} 50%{opacity:.35} }
.mg-promo__title {
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.mg-promo__title b {
  color: var(--mg-accent);
  font-weight: 900;
}
.mg-promo__list {
  list-style: none;
  margin: 10px 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mg-promo__list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.25;
}
.mg-promo__list li svg {
  width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px;
  color: var(--mg-accent);
}
.mg-promo__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #000;
  text-decoration: none;
  background: var(--mg-accent);
  box-shadow: 0 8px 24px rgba(232, 121, 249, 0.3);
  transition: transform 0.15s var(--mg-ease), filter 0.2s;
}
.mg-promo__btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.mg-promo__btn:active { transform: scale(0.98); }
.mg-promo__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.mg-promo__close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.mg-promo__close svg { width: 13px; height: 13px; }

@media (prefers-reduced-motion: reduce) {
  .mg-bar, .mg-logo, .mg-logo::before, .mg-promo { animation: none !important; transition: none !important; }
  .mg-promo.is-open { transform: none; }
}
