/* ===== UPPING DIGITAL · MOBILE NAV (shared across PT/EN/ES) ===== */

/* Hamburger button — modern animated 3-line */
.mobile-menu-btn {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: rgba(0,102,204,.08); border-color: rgba(0,102,204,.25); }
.mobile-menu-btn .bar {
  position: absolute; left: 50%; top: 50%;
  width: 20px; height: 2px;
  background: #0a1428; border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform .35s cubic-bezier(.6,.05,.3,1.2), opacity .2s, top .35s cubic-bezier(.6,.05,.3,1.2);
}
.mobile-menu-btn .bar.b1 { top: calc(50% - 6px); }
.mobile-menu-btn .bar.b3 { top: calc(50% + 6px); }
.mobile-menu-btn.is-open .bar.b1 { top: 50%; transform: translate(-50%, -50%) rotate(45deg); }
.mobile-menu-btn.is-open .bar.b2 { opacity: 0; transform: translate(-50%, -50%) scaleX(0); }
.mobile-menu-btn.is-open .bar.b3 { top: 50%; transform: translate(-50%, -50%) rotate(-45deg); }

/* Backdrop — covers the page when drawer is open */
.mobile-backdrop {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(5, 9, 18, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.mobile-backdrop.show { opacity: 1; pointer-events: auto; }

/* Drawer — slides in from right */
.mobile-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  z-index: 999;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fc 100%);
  box-shadow: -20px 0 60px rgba(0, 30, 80, .18);
  transform: translateX(100%);
  transition: transform .42s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-drawer.show { transform: translateX(0); }

.mobile-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 2;
}
.mobile-drawer-header .md-brand {
  display: flex; align-items: center; gap: .65rem;
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 800; font-size: 1rem; color: #0a1428;
  text-decoration: none; line-height: 1.1;
}
.mobile-drawer-header .md-brand small {
  display: block; font-size: .58rem; font-weight: 600;
  color: #64748b; letter-spacing: .08em; text-transform: uppercase;
  margin-top: 2px;
}
.mobile-drawer-header .md-brand .md-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: #0a0a0a; padding: 4px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-drawer-header .md-brand .md-mark img { width: 100%; height: 100%; object-fit: contain; }
.md-close {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: rgba(0,0,0,.04); cursor: pointer; color: #475569;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.md-close:hover { background: rgba(0,0,0,.08); color: #0a1428; }

.mobile-drawer-body { flex: 1; padding: 1.5rem 1.4rem; }

.md-eyebrow {
  font-size: .68rem; font-weight: 700;
  color: #94a3b8; letter-spacing: .12em; text-transform: uppercase;
  margin: 1.5rem 0 .75rem; padding: 0 .25rem;
}
.md-eyebrow:first-child { margin-top: 0; }

.md-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: .95rem 1rem;
  border-radius: 12px;
  font-size: 1rem; font-weight: 600;
  color: #1e293b; text-decoration: none;
  transition: background .2s, color .2s, transform .15s;
  position: relative;
}
.md-link:hover, .md-link:active {
  background: rgba(0,102,204,.07);
  color: #0066cc;
  transform: translateX(2px);
}
.md-link .md-arrow {
  opacity: 0; transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
  color: #0066cc;
}
.md-link:hover .md-arrow { opacity: 1; transform: translateX(0); }

.md-link.featured {
  background: linear-gradient(135deg, rgba(0,255,170,.12), rgba(0,212,255,.08));
  border: 1px solid rgba(0,255,170,.25);
  color: #064e3b;
  margin-top: .35rem;
}
.md-link.featured:hover { background: linear-gradient(135deg, rgba(0,255,170,.18), rgba(0,212,255,.12)); }
.md-link .md-badge {
  font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 5px;
  background: linear-gradient(135deg, #00ffaa, #00d4ff);
  color: #001a1a;
}

.md-divider { height: 1px; background: rgba(0,0,0,.06); margin: 1.25rem 0; }

.md-cta-stack { display: flex; flex-direction: column; gap: .65rem; margin-top: .5rem; }
.md-cta-stack a {
  display: flex; align-items: center; justify-content: center;
  padding: .95rem 1.25rem;
  border-radius: 12px;
  font-weight: 700; font-size: .95rem;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.md-cta-stack .md-cta-primary {
  background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
  color: white;
  box-shadow: 0 6px 16px rgba(0,102,204,.3);
}
.md-cta-stack .md-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,102,204,.45); }
.md-cta-stack .md-cta-secondary {
  background: white; color: #0a1428;
  border: 1.5px solid rgba(0,0,0,.1);
}
.md-cta-stack .md-cta-secondary:hover { border-color: #0066cc; color: #0066cc; }

.md-lang {
  display: flex; gap: .25rem;
  padding: .3rem;
  background: rgba(0,0,0,.04);
  border-radius: 10px;
  margin-top: 1.5rem;
}
.md-lang a {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .55rem .5rem;
  font-size: .8rem; font-weight: 700;
  color: #64748b; text-decoration: none;
  border-radius: 7px;
  transition: background .2s, color .2s;
}
.md-lang a:hover { color: #0066cc; }
.md-lang a.active { background: white; color: #0a1428; box-shadow: 0 2px 6px rgba(0,0,0,.06); }

/* Lock body scroll when drawer is open */
body.no-scroll { overflow: hidden; }

/* Show drawer button on mobile, hide desktop drawer (mobile-menu legacy) */
@media (max-width: 900px) {
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  /* Hide legacy inline mobile-menu if present */
  .mobile-menu { display: none !important; }
}

/* === HEADER MOBILE SIZING === */
@media (max-width: 600px) {
  .header { position: fixed; }
  .nav-container { padding: .65rem .9rem !important; gap: .5rem !important; }
  .logo { gap: .55rem !important; font-size: .98rem !important; }
  .logo-mark { width: 36px !important; height: 36px !important; border-radius: 9px !important; padding: 3px !important; }
  .logo-text { font-size: .95rem !important; line-height: 1.05; }
  .logo-text small { font-size: .56rem !important; }
  .nav-content { display: none !important; }
}
@media (max-width: 380px) {
  .nav-container { padding: .55rem .75rem !important; }
  .logo-text { font-size: .88rem !important; }
  .logo-mark { width: 32px !important; height: 32px !important; }
  .mobile-menu-btn { width: 40px; height: 40px; }
}

/* "Academy" desktop nav badge */
.nav-link .nav-badge {
  display: inline-block;
  margin-left: .35rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .55rem; font-weight: 800;
  padding: .15rem .35rem; border-radius: 4px;
  background: linear-gradient(135deg, #00ffaa, #00d4ff);
  color: #001a1a; letter-spacing: .06em;
  vertical-align: middle;
  transform: translateY(-1px);
}
