/* ============================================================
   MOBILE HEADER + DRAWER — single source of truth (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {

  /* Hide desktop-only elements */
  .wm-header__utility-left,
  .wm-header__icon-btn,
  .wm-header__divider,
  .wm-header__cta,
  .wm-header__nav {
    display: none !important;
  }

  /* Mobile top bar */
  .wm-header .wm-header__main {
    height: 70px !important;
    border-bottom: 1px solid #e8e8eb;
  }
  .wm-header .wm-header__main-inner {
    padding: 0 18px !important;
    height: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }
  .wm-header .wm-header__logo { flex-shrink: 0; display: flex; align-items: center; }
  .wm-header .wm-header__logo-img { height: 42px !important; width: auto !important; display: block; }
  .wm-header .wm-header__right {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0;
    margin-left: auto;
  }

  /* Mobile lang button in header bar */
  .wm-header__lang-wrap-mobile { position: relative; }
  .wm-header__lang-wrap-mobile .wm-header__lang {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 9px 12px !important;
    background: #f6f6f8 !important;
    border: 1px solid #e8e8eb !important;
    border-radius: 9px !important;
    color: #0d0d0d !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    height: 42px;
    box-sizing: border-box;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang-flag {
    width: 20px !important; height: 14px !important;
    object-fit: cover; border-radius: 2px; display: block;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang i {
    font-size: 9px !important; color: #9a9a9f;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important; left: auto !important;
    min-width: 190px !important;
    background: #ffffff !important;
    border: 1px solid #e8e8eb !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14) !important;
    padding: 6px !important;
    z-index: 1000 !important;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang-menu.is-open {
    opacity: 1; visibility: visible; transform: translateY(0);
    transition: opacity 0.2s, transform 0.2s;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang-item {
    display: flex !important; align-items: center !important;
    gap: 10px !important; padding: 11px 12px !important;
    color: #2a2a2a !important; font-size: 13px !important;
    text-decoration: none !important; border-radius: 7px;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang-item img {
    width: 22px !important; height: 16px !important;
    object-fit: cover; border-radius: 2px;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang-item.is-active {
    background: rgba(255, 233, 0, 0.12); font-weight: 700;
  }
  .wm-header__lang-wrap-mobile .wm-header__lang-item i.fa-check {
    margin-left: auto; color: #f0d800; font-size: 11px;
  }

  /* Burger */
  .wm-header .wm-header__burger {
    display: flex !important;
    align-items: center; justify-content: center;
    width: 46px !important; height: 42px !important;
    padding: 0 !important;
    background: #ffe900 !important;
    border: none !important; border-radius: 9px !important;
    flex-direction: column; gap: 4px !important;
    cursor: pointer; flex-shrink: 0; box-sizing: border-box;
  }
  .wm-header .wm-header__burger span {
    display: block; width: 20px; height: 2.5px;
    background: #0d0d0d; border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
  }
  .wm-header .wm-header__burger.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .wm-header .wm-header__burger.is-active span:nth-child(2) { opacity: 0; }
  .wm-header .wm-header__burger.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  /* ============================================================
     DRAWER (body-child element, fully isolated)
     ============================================================ */
  .wm-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden;
    z-index: 9998;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  }
  .wm-drawer-backdrop.is-open {
    opacity: 1; visibility: visible;
    transition: opacity 0.35s ease;
  }

  .wm-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 50vw; min-width: 320px; max-width: 420px;
    background: #ffffff;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease 0.1s;
    display: flex; flex-direction: column; overflow: hidden;
    /* No shadow when closed — prevents the box-shadow from leaking
       leftward into the visible viewport while the panel sits
       off-screen to the right. */
  }
  .wm-drawer.is-open {
    transform: translateX(0);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.25);
  }

  /* Drawer top: logo (left) + X (right) */
  .wm-drawer__top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f2;
    flex-shrink: 0; min-height: 70px;
  }
  .wm-drawer__logo { display: flex; align-items: center; }
  .wm-drawer__logo img { height: 38px; width: auto; display: block; }
  .wm-drawer__close {
    width: 42px; height: 42px;
    border: none;
    background: #f6f6f8;
    color: #0d0d0d; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 10px;
    transition: background 0.18s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .wm-drawer__close:active { background: #ececef; transform: scale(0.94); }

  /* Body — nav + CTA scroll if needed */
  .wm-drawer__body {
    flex: 1;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column;
  }

  .wm-drawer__nav { display: flex; flex-direction: column; }
  .wm-drawer__item {
    position: relative;
    border-bottom: 1px solid #f0f0f2;
  }
  .wm-drawer__link {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 17px 22px;
    color: #0d0d0d;
    font-size: 15px; font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: none; cursor: pointer;
    font-family: inherit; text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s;
  }
  .wm-drawer__link:active { background: #fafafb; }
  .wm-drawer__link.is-active { font-weight: 700; }
  .wm-drawer__link.is-active::before {
    content: '';
    position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 22px;
    background: #ffe900;
    border-radius: 0 3px 3px 0;
  }
  .wm-drawer__caret {
    font-size: 11px; color: #9a9a9f;
    transition: transform 0.25s ease, color 0.2s;
  }
  .wm-drawer__item.is-expanded .wm-drawer__caret {
    transform: rotate(180deg); color: #0d0d0d;
  }

  /* Sub-dropdown (accordion) */
  .wm-drawer__sub {
    max-height: 0; overflow: hidden;
    background: #fafafb;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .wm-drawer__item.is-expanded .wm-drawer__sub { max-height: 500px; }
  .wm-drawer__sub a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 22px 13px 38px;
    color: #2a2a2a;
    font-size: 13.5px; font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    -webkit-tap-highlight-color: transparent;
  }
  .wm-drawer__sub a:last-child { border-bottom: none; }
  .wm-drawer__sub a:active { background: #ffffff; }
  .wm-drawer__sub-num {
    color: #ffe900; font-weight: 700;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace, sans-serif;
    min-width: 20px;
  }
  .wm-drawer__sub-title { flex: 1; }
  .wm-drawer__sub-arrow { font-size: 10px; color: rgba(0, 0, 0, 0.25); }

  /* CTA — flows naturally below nav */
  .wm-drawer__cta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    margin: 20px 18px;
    padding: 16px 20px;
    background: #0d0d0d;
    color: #ffffff;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: transform 0.15s, background 0.18s;
    -webkit-tap-highlight-color: transparent;
  }
  .wm-drawer__cta:active { transform: scale(0.98); background: #1a1a1a; }
  .wm-drawer__cta-icon {
    width: 28px; height: 28px;
    background: #ffe900; color: #0d0d0d;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; flex-shrink: 0;
  }

  body.menu-open { overflow: hidden; }
}

/* On desktop, hide drawer completely */
@media (min-width: 1025px) {
  .wm-drawer,
  .wm-drawer-backdrop,
  .wm-header__lang-wrap-mobile {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .wm-drawer { width: 86vw; min-width: 0; }
}

