/* =========================================================
   RUMAPA PREMIUM MOBILE NAVIGATION V1
   ========================================================= */

.mobile-nav-toggle,
.mobile-nav-overlay {
  display: none;
}

@media (max-width: 1120px) {

  .site-header {
    position: relative;
    z-index: 1000;
  }

  .mobile-nav-toggle {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-left: 2px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 15px;
    color: #fff;
    background:
      linear-gradient(
        145deg,
        rgba(19,33,65,.88),
        rgba(7,15,37,.78)
      );
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.07),
      0 12px 32px rgba(0,0,0,.2);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-toggle span {
    width: 19px;
    height: 1.5px;
    display: block;
    border-radius: 999px;
    background: rgba(247,249,255,.94);
    transition:
      transform 220ms cubic-bezier(.16,1,.3,1),
      opacity 180ms ease;
  }

  .mobile-nav-toggle:hover {
    border-color: rgba(80,176,255,.32);
    background:
      linear-gradient(
        145deg,
        rgba(23,42,82,.94),
        rgba(8,18,44,.88)
      );
  }

  .mobile-nav-overlay {
    position: fixed;
    z-index: 9998;
    inset: 0;
    display: flex;
    justify-content: flex-end;
    padding: 12px;
    visibility: hidden;
    opacity: 0;
    background: rgba(1,5,16,.58);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition:
      opacity 260ms ease,
      visibility 260ms ease;
  }

  .mobile-nav-overlay.is-open {
    visibility: visible;
    opacity: 1;
  }

  .mobile-nav-panel {
    width: min(440px, 100%);
    height: calc(100dvh - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 28px;
    background:
      radial-gradient(
        circle at 88% 7%,
        rgba(31,123,255,.15),
        transparent 32%
      ),
      radial-gradient(
        circle at 16% 92%,
        rgba(107,61,255,.11),
        transparent 33%
      ),
      linear-gradient(
        155deg,
        rgba(9,20,46,.98),
        rgba(3,9,25,.99)
      );
    box-shadow:
      -25px 0 80px rgba(0,0,0,.34),
      inset 0 1px 0 rgba(255,255,255,.055);
    transform: translateX(24px) scale(.985);
    opacity: 0;
    transition:
      transform 320ms cubic-bezier(.16,1,.3,1),
      opacity 240ms ease;
  }

  .mobile-nav-overlay.is-open .mobile-nav-panel {
    transform: translateX(0) scale(1);
    opacity: 1;
  }

  .mobile-nav-top {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,.075);
  }

  .mobile-nav-top .brand {
    min-width: 0;
    gap: 10px;
    font-size: 21px;
  }

  .mobile-nav-top .brand img {
    width: 46px;
    height: 46px;
  }

  .mobile-nav-top .brand span {
    display: inline;
  }

  .mobile-nav-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 14px;
    color: rgba(247,249,255,.9);
    background: rgba(255,255,255,.045);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-close span {
    display: block;
    margin-top: -2px;
    font-size: 31px;
    font-weight: 300;
    line-height: 1;
  }

  .mobile-nav-links {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 23px 18px 20px;
    scrollbar-width: none;
  }

  .mobile-nav-links::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav-links a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0 17px;
    border-radius: 16px;
    color: rgba(232,239,255,.78);
    font-size: 18px;
    font-weight: 620;
    letter-spacing: -.015em;
    text-decoration: none;
    transition:
      color 180ms ease,
      background 180ms ease,
      transform 180ms ease;
  }

  .mobile-nav-links a:hover {
    color: #fff;
    background: rgba(255,255,255,.045);
    transform: translateX(2px);
  }

  .mobile-nav-links a[aria-current="page"] {
    color: #fff;
    background:
      linear-gradient(
        100deg,
        rgba(3,215,202,.11),
        rgba(8,121,255,.13),
        rgba(139,66,255,.09)
      );
    box-shadow:
      inset 0 0 0 1px rgba(78,156,255,.13);
  }

  .mobile-nav-links a[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 50%;
    width: 3px;
    height: 24px;
    transform: translateY(-50%);
    border-radius: 999px;
    background:
      linear-gradient(180deg, #03d7ca, #1688ff);
    box-shadow: 0 0 14px rgba(22,136,255,.55);
  }

  .mobile-nav-bottom {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-top: 1px solid rgba(255,255,255,.075);
    background: rgba(2,7,21,.36);
  }

  .mobile-nav-languages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .mobile-nav-languages a,
  .mobile-nav-languages button {
    min-width: 46px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 0;
    border-radius: 999px;
    color: rgba(194,207,234,.68);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 720;
    cursor: pointer;
    text-decoration: none;
  }

  .mobile-nav-languages .active,
  .mobile-nav-languages [aria-current="page"] {
    color: #fff;
    background:
      linear-gradient(
        135deg,
        rgba(3,215,202,.88),
        rgba(8,121,255,.92)
      );
    box-shadow: 0 7px 20px rgba(8,121,255,.22);
  }

  .mobile-nav-app-cta {
    width: 100%;
    min-height: 54px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border-radius: 999px;
    color: #fff;
    background:
      linear-gradient(
        100deg,
        #03bfc2,
        #0879ff 54%,
        #8148ef
      );
    box-shadow:
      0 15px 35px rgba(20,102,255,.22),
      inset 0 1px 0 rgba(255,255,255,.18);
    font-size: 14px;
    font-weight: 760;
    text-decoration: none;
  }

  body.mobile-nav-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  /* Existing desktop navigation disappears here already.
     Keep language + app CTA visible on tablet; hamburger sits beside them. */
  .site-header .mobile-nav-toggle {
    order: 10;
  }
}

@media (max-width: 720px) {

  .site-header {
    gap: 12px;
  }

  .site-header > .header-actions {
    margin-left: auto;
  }

  /* On phones the full language switcher lives inside the menu. */
  .site-header > .header-actions .language-switcher,
  .site-header > .header-actions .features-language-switcher {
    display: none;
  }

  .site-header > .header-actions:has(.header-cta) {
    gap: 0;
  }

  .mobile-nav-toggle {
    margin-left: auto;
  }

  .mobile-nav-overlay {
    padding: 8px;
  }

  .mobile-nav-panel {
    width: 100%;
    height: calc(100dvh - 16px);
    border-radius: 24px;
  }

  .mobile-nav-top {
    min-height: 72px;
    padding: 10px 11px 9px 15px;
  }

  .mobile-nav-top .brand img {
    width: 44px;
    height: 44px;
  }

  .mobile-nav-top .brand {
    font-size: 20px;
  }

  .mobile-nav-links {
    padding: 17px 12px;
  }

  .mobile-nav-links a {
    min-height: 55px;
    padding: 0 15px;
    font-size: 17px;
  }

  .mobile-nav-bottom {
    padding: 15px;
  }
}

@media (max-width: 430px) {
  .mobile-nav-toggle {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-overlay,
  .mobile-nav-panel,
  .mobile-nav-toggle span,
  .mobile-nav-links a {
    transition: none !important;
  }
}
