/**
 * Prep Saudi — mobile navigation drawer
 * Scoped to marketing pages (.index-page, .prep-site)
 */

/* Prevent nav ul from stretching header before / without drawer open */
@media (max-width: 1199px) {
  body.index-page #navmenu > ul,
  body.prep-site #navmenu > ul {
    position: fixed !important;
    inset: auto !important;
    top: -100vh !important;
    left: 0 !important;
    width: 100% !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  /* Compact single-row mobile header */
  body.index-page .header .container-fluid,
  body.prep-site .header .container-fluid {
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.5rem;
  }

  body.index-page .header .logo,
  body.prep-site .header .logo {
    order: 1 !important;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0 !important;
  }

  body.index-page .header .header-actions,
  body.prep-site .header .header-actions {
    order: 2 !important;
    flex-shrink: 0;
    margin: 0 !important;
  }

  body.index-page .header .navmenu,
  body.prep-site .header .navmenu {
    order: 3 !important;
    flex: 0 0 auto;
    width: auto;
    margin: 0 !important;
  }

  body.index-page .header .btn-getstarted,
  body.prep-site .header .btn-getstarted {
    order: unset !important;
    margin: 0 !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
  }

  body.index-page .mobile-nav-drawer,
  body.prep-site .mobile-nav-drawer {
    display: none;
  }

  body.index-page.mobile-nav-active .navmenu,
  body.prep-site.mobile-nav-active .navmenu {
    background: rgba(10, 22, 40, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10060;
  }

  /* Drawer + overlay must sit above the fixed info bar (email/phone strip) */
  body.index-page.mobile-nav-active .header,
  body.prep-site.mobile-nav-active .header {
    z-index: 10060 !important;
  }

  body.index-page.mobile-nav-active .info-bar,
  body.prep-site.mobile-nav-active .info-bar {
    z-index: 10040 !important;
  }

  body.index-page.mobile-nav-active .mobile-nav-drawer,
  body.prep-site.mobile-nav-active .mobile-nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    margin: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(165deg, #0a1628 0%, #0f2744 45%, #1a3260 100%);
    box-shadow: -24px 0 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 10062;
    animation: prep-drawer-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes prep-drawer-in {
    from {
      transform: translateX(100%);
      opacity: 0.6;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  body.index-page .mobile-nav-drawer ul,
  body.prep-site .mobile-nav-drawer ul {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.35rem 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Drawer header */
  body.index-page .mobile-nav-drawer-head,
  body.prep-site .mobile-nav-drawer-head {
    position: relative;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 3.25rem 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
  }

  body.index-page .mobile-nav-drawer-brand,
  body.prep-site .mobile-nav-drawer-brand {
    display: block;
    font-family: "Plus Jakarta Sans", "Poppins", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
  }

  body.index-page .mobile-nav-drawer-tagline,
  body.prep-site .mobile-nav-drawer-tagline {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.45);
  }

  /* Nav links */
  body.index-page .mobile-nav-drawer ul li,
  body.prep-site .mobile-nav-drawer ul li {
    width: 100%;
  }

  body.index-page .mobile-nav-drawer ul > li > a,
  body.prep-site .mobile-nav-drawer ul > li > a {
    color: rgba(255, 255, 255, 0.82) !important;
    padding: 0.95rem 1.5rem !important;
    font-family: "Plus Jakarta Sans", "Poppins", sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-left: 3px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }

  body.index-page .mobile-nav-drawer ul > li > a:hover,
  body.prep-site .mobile-nav-drawer ul > li > a:hover,
  body.index-page .mobile-nav-drawer ul > li > a.active,
  body.prep-site .mobile-nav-drawer ul > li > a.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-left-color: #06b6d4;
  }

  body.index-page .mobile-nav-drawer ul > li + li > a,
  body.prep-site .mobile-nav-drawer ul > li + li > a {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Client portal CTA in drawer */
  body.index-page .mobile-nav-drawer a.nav-portal-link,
  body.prep-site .mobile-nav-drawer a.nav-portal-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 1.25rem 0.5rem !important;
    padding: 0.85rem 1.25rem !important;
    border-radius: 50px !important;
    border: none !important;
    border-left: none !important;
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%) !important;
    color: #0a1628 !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.35) !important;
  }

  body.index-page .mobile-nav-drawer a.nav-portal-link:hover,
  body.prep-site .mobile-nav-drawer a.nav-portal-link:hover,
  body.index-page .mobile-nav-drawer a.nav-portal-link.active,
  body.prep-site .mobile-nav-drawer a.nav-portal-link.active {
    background: linear-gradient(135deg, #22d3ee 0%, #67e8f9 100%) !important;
    color: #0a1628 !important;
    transform: translateY(-1px);
  }

  /* Drawer footer */
  body.index-page .mobile-nav-drawer-foot,
  body.prep-site .mobile-nav-drawer-foot {
    flex-shrink: 0;
    padding: 1rem 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
  }

  body.index-page .mobile-nav-quote-btn,
  body.prep-site .mobile-nav-quote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1.25rem;
    border-radius: 50px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
  }

  body.index-page .mobile-nav-quote-btn:hover,
  body.prep-site .mobile-nav-quote-btn:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.5);
  }

  body.index-page .mobile-nav-contact,
  body.prep-site .mobile-nav-contact {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.85rem;
  }

  body.index-page .mobile-nav-contact a,
  body.prep-site .mobile-nav-contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5) !important;
    text-decoration: none;
  }

  body.index-page .mobile-nav-contact a:hover,
  body.prep-site .mobile-nav-contact a:hover {
    color: #22d3ee !important;
  }

  /* Close button on drawer */
  body.index-page.mobile-nav-active .mobile-nav-toggle,
  body.prep-site.mobile-nav-active .mobile-nav-toggle {
    position: fixed;
    top: max(0.65rem, env(safe-area-inset-top, 0px));
    right: calc(max(1rem, 100vw - min(320px, 88vw) + 0.85rem));
    z-index: 10065;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff !important;
    font-size: 1.35rem !important;
    transition: background 0.2s;
  }

  body.index-page.mobile-nav-active .mobile-nav-toggle:hover,
  body.prep-site.mobile-nav-active .mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
  }

  body.index-page.mobile-nav-active .header-actions,
  body.prep-site.mobile-nav-active .header-actions {
    visibility: hidden;
    pointer-events: none;
  }
}

/* Desktop — keep nav links visible (drawer wrapper is layout-transparent) */
@media (min-width: 1200px) {
  body.index-page .mobile-nav-drawer,
  body.prep-site .mobile-nav-drawer {
    display: contents;
  }

  body.index-page .mobile-nav-drawer-head,
  body.prep-site .mobile-nav-drawer-head,
  body.index-page .mobile-nav-drawer-foot,
  body.prep-site .mobile-nav-drawer-foot {
    display: none !important;
  }

  body.index-page .mobile-nav-drawer ul,
  body.prep-site .mobile-nav-drawer ul {
    display: flex !important;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  body.index-page .mobile-nav-drawer ul > li > a:not(.nav-portal-link),
  body.prep-site .mobile-nav-drawer ul > li > a:not(.nav-portal-link) {
    padding: 18px 15px !important;
    border-left: none !important;
    border-top: none !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    background: transparent !important;
  }

  body.index-page.scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link),
  body.prep-site.scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link),
  body.index-page .scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link),
  body.prep-site .scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link) {
    color: rgba(255, 255, 255, 0.85) !important;
  }

  body.index-page .mobile-nav-drawer ul > li > a:not(.nav-portal-link):hover,
  body.prep-site .mobile-nav-drawer ul > li > a:not(.nav-portal-link):hover,
  body.index-page .mobile-nav-drawer ul > li > a:not(.nav-portal-link).active,
  body.prep-site .mobile-nav-drawer ul > li > a:not(.nav-portal-link).active {
    color: #fff !important;
    background: transparent !important;
  }

  body.index-page.scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link):hover,
  body.prep-site.scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link):hover,
  body.index-page.scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link).active,
  body.prep-site.scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link).active,
  body.index-page .scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link):hover,
  body.prep-site .scrolled .mobile-nav-drawer ul > li > a:not(.nav-portal-link).active {
    color: #fff !important;
  }
}
