/* ================================================
   Premium Mobile Drawer — Pegasi Defense
   Right-side slide-in, 85 vw / max 420 px
   ================================================ */

/* ── Design tokens ────────────────────────────── */
:root {
  --mm-bg:           #0d1117;
  --mm-surface:      rgba(255, 255, 255, .03);
  --mm-border:       rgba(255, 255, 255, .08);
  --mm-text:         rgba(255, 255, 255, .78);
  --mm-text-hover:   #ffffff;
  --mm-accent:       #b8860b;    /* keep in sync with --gold-color  */
  --mm-accent-hover: #9a7209;    /* keep in sync with --gold-hover  */
  --mm-close-bg:     rgba(255, 255, 255, .06);
  --mm-close-hover:  rgba(255, 255, 255, .12);
  --mm-row:          52px;       /* tap-target row height            */
  --mm-px:           1.5rem;     /* horizontal padding               */
  --mm-width:        min(85vw, 420px);
  --mm-speed:        0.38s;
  --mm-ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --mm-backdrop-bg:  rgba(0, 0, 0, .65);
}

/* ── Backdrop ─────────────────────────────────── */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: var(--mm-backdrop-bg);
  backdrop-filter: blur(4px) saturate(120%);
  -webkit-backdrop-filter: blur(4px) saturate(120%);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition:
    opacity    var(--mm-speed) var(--mm-ease),
    visibility 0s linear var(--mm-speed);
}

.menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity    var(--mm-speed) var(--mm-ease),
    visibility 0s linear 0s;
}

/* ── Drawer shell ─────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--mm-width);
  height: 100%;
  height: 100dvh;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--mm-bg);
  border-left: 1px solid var(--mm-border);
  box-shadow: -12px 0 48px rgba(0, 0, 0, .55), -1px 0 0 rgba(255, 255, 255, .04);
  transform: translateX(100%);
  visibility: hidden;
  will-change: transform;
  transition:
    transform   var(--mm-speed) var(--mm-ease),
    visibility  0s linear var(--mm-speed);
}

.mobile-menu.is-open {
  transform: translateX(0);
  visibility: visible;
  transition:
    transform  var(--mm-speed) var(--mm-ease),
    visibility 0s linear 0s;
}

/* ── Inner flex column ───────────────────────── */
.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Top bar ──────────────────────────────────── */
.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  height: 72px;
  padding: 0 var(--mm-px);
  border-bottom: 1px solid var(--mm-border);
}

/* ── Close button ─────────────────────────────── */
.mobile-menu__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--mm-close-bg);
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background .2s ease,
    color      .2s ease,
    transform  .25s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu__close:hover {
  background: var(--mm-close-hover);
  color: #fff;
  transform: rotate(90deg);
}

.mobile-menu__close:focus-visible {
  outline: 2px solid var(--mm-accent);
  outline-offset: 2px;
}

/* ── Scrollable nav area ──────────────────────── */
.mobile-menu__nav {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .5rem 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .1) transparent;
}

.mobile-menu__nav::-webkit-scrollbar        { width: 3px; }
.mobile-menu__nav::-webkit-scrollbar-track  { background: transparent; }
.mobile-menu__nav::-webkit-scrollbar-thumb  { background: rgba(255, 255, 255, .1); border-radius: 2px; }

/* ── Nav list ─────────────────────────────────── */
.mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Row separator between top-level items */
.mobile-menu__list > li + li {
  border-top: 1px solid var(--mm-border);
}

/* ── Primary nav link ─────────────────────────── */
.mobile-menu__link {
  display: flex;
  align-items: center;
  min-height: var(--mm-row);
  padding: 0 var(--mm-px);
  text-decoration: none;
  color: var(--mm-text);
  font-size: clamp(.9375rem, 2vw, 1rem);
  font-weight: 500;
  letter-spacing: .015em;
  line-height: 1.4;
  position: relative;
  transition:
    color        .2s ease,
    background   .2s ease,
    padding-left .2s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Gold left accent bar */
.mobile-menu__link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 55%;
  background: var(--mm-accent);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}

.mobile-menu__link:hover {
  color: var(--mm-text-hover);
  background: rgba(255, 255, 255, .04);
  padding-left: calc(var(--mm-px) + 6px);
}

.mobile-menu__link:hover::before,
.mobile-menu__link.is-active::before {
  transform: translateY(-50%) scaleY(1);
  opacity: 1;
}

.mobile-menu__link.is-active {
  color: var(--mm-accent);
}

.mobile-menu__link:focus-visible {
  outline: 2px solid var(--mm-accent);
  outline-offset: -2px;
  border-radius: 4px;
  color: var(--mm-text-hover);
  background: rgba(255, 255, 255, .04);
}

/* ── Sub-list (About Us → The Latest) ────────── */
.mobile-menu__sub {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--mm-surface);
  border-top: 1px solid var(--mm-border);
}

.mobile-menu__sublink {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--mm-px) 0 calc(var(--mm-px) + 1.125rem);
  text-decoration: none;
  color: rgba(255, 255, 255, .52);
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: .01em;
  position: relative;
  transition: color .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Chevron indicator */
.mobile-menu__sublink::before {
  content: '';
  position: absolute;
  left: calc(var(--mm-px) + .05rem);
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid rgba(255, 255, 255, .22);
  border-bottom: 1.5px solid rgba(255, 255, 255, .22);
  transform: translateY(-65%) rotate(-45deg);
}

.mobile-menu__sublink:hover {
  color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .04);
}

.mobile-menu__sublink:focus-visible {
  outline: 2px solid var(--mm-accent);
  outline-offset: -2px;
  border-radius: 4px;
  color: rgba(255, 255, 255, .85);
}

/* ── Divider line (optional between groups) ───── */
.mobile-menu__divider {
  height: 1px;
  background: var(--mm-border);
  margin: .25rem 0;
}

.mobile-menu__divider + li {
  border-top: none !important;
}

/* ── Sticky CTA footer ────────────────────────── */
.mobile-menu__footer {
  flex-shrink: 0;
  padding: 1.25rem var(--mm-px);
  padding-bottom: max(1.25rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
  border-top: 1px solid var(--mm-border);
  background: var(--mm-bg);
}

.mobile-menu__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 1.5rem;
  background: var(--mm-accent);
  color: #fff;
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 8px;
  transition:
    background  .25s ease,
    transform   .2s ease,
    box-shadow  .25s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu__cta:hover {
  background: var(--mm-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(184, 134, 11, .35);
}

.mobile-menu__cta:active {
  transform: translateY(0);
  box-shadow: none;
}

.mobile-menu__cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .8);
  outline-offset: 2px;
}

/* ── Suppress old inline dropdown on mobile ───── */
@media (max-width: 768px) {
  .nav { display: none !important; }
}

/* ── Drawer hidden on desktop ─────────────────── */
@media (min-width: 769px) {
  .mobile-menu,
  .menu-backdrop { display: none !important; }
}

/* ── Reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .mobile-menu.is-open,
  .menu-backdrop,
  .menu-backdrop.is-open       { transition: none !important; }
  .mobile-menu__close:hover    { transform: none; }
  .mobile-menu__link:hover     { padding-left: var(--mm-px); transition: none; }
  .mobile-menu__link::before,
  .mobile-menu__link:hover::before { transition: none; }
  .mobile-menu__cta:hover      { transform: none; transition: none; }
}
