/* Neutral PC defaults; all new visual rules are mobile-only. */
.md-mobile-header__actions,
.md-mobile-header__contact,
.md-mobile-menu-toggle { display: none; }

@media (width < 1024px) {
  .md-site .md-v2-header {
    --md-mobile-surface: #fff;
    --md-mobile-ink: #333;
    --md-mobile-muted: #adadad;
    --md-mobile-rule: #cecece;
    --md-mobile-logo: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/logo-light.svg');
    --md-mobile-menu-icon: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/menu-light.svg');
    --md-mobile-close-icon: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/close-light.svg');
    --md-mobile-arrow-right: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/arrow-right-light.svg');
    --md-mobile-arrow-down: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/arrow-down-light.svg');
    --md-mobile-header-row-height: calc(44px + env(safe-area-inset-top));
    z-index: 100 !important;
    height: var(--md-mobile-header-row-height);
    min-height: var(--md-mobile-header-row-height) !important;
    border-bottom: .5px solid var(--md-mobile-rule) !important;
    background: var(--md-mobile-surface) !important;
  }
  .md-site .md-v2-header:is(.md-v2-header--dark, [data-current-route="home"]) {
    --md-mobile-surface: #000;
    --md-mobile-ink: #fff;
    --md-mobile-muted: #6a6a6a;
    --md-mobile-rule: #333;
    --md-mobile-logo: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/logo-dark.svg');
    --md-mobile-menu-icon: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/menu-dark.svg');
    --md-mobile-close-icon: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/close-dark.svg');
    --md-mobile-arrow-right: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/arrow-right-dark.svg');
    --md-mobile-arrow-down: url('/wp-content/themes/meituan-drone-child/assets/images/mobile/arrow-down-dark.svg');
    border-bottom-color: var(--md-mobile-rule) !important;
    background: var(--md-mobile-surface) !important;
  }
  .md-site .md-v2-header__inner {
    width: 100%;
    height: var(--md-mobile-header-row-height);
    padding: env(safe-area-inset-top) max(var(--md-mobile-gutter), env(safe-area-inset-right)) 0 max(var(--md-mobile-gutter), env(safe-area-inset-left));
    box-sizing: border-box;
    justify-content: space-between;
  }
  .md-site .md-v2-header .md-v2-brand {
    display: flex !important;
    width: 100.5px !important;
    height: 44px !important;
    flex: 0 0 100.5px;
    align-items: center;
  }
  .md-site .md-v2-header .md-v2-brand img {
    width: 100.5px; height: 18px;
    filter: none;
    content: var(--md-mobile-logo);
  }
  .md-site .md-v2-header .md-v2-brand::after { display: none; }
  .md-site .md-mobile-header__actions { display: flex; height: 44px; margin-right: -14px; align-items: center; }
  .md-site .md-mobile-header__contact { display: none; }
  .md-site .md-mobile-menu-toggle {
    display: block;
    width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    margin: 0; padding: 0; border: 0; border-radius: 0;
    color: var(--md-mobile-ink);
    background: var(--md-mobile-menu-icon) center / 36px 36px no-repeat;
    box-shadow: none;
    cursor: pointer;
  }
  .md-site .md-mobile-menu-toggle > span { display: none; }
  .md-site .md-v2-header.is-mobile-menu-open .md-mobile-menu-toggle { background-image: var(--md-mobile-close-icon); }
  .md-site .md-v2-header.is-mobile-menu-open { position: fixed !important; top: 0; left: 0; }
  .md-site .md-v2-header :is(a, button):focus:not(:focus-visible) { outline: none; }
  .md-site .md-v2-header :is(a, button):focus-visible { outline: 2px solid #d6a700; outline-offset: -2px; }

  .md-site .md-v2-header .md-v2-nav {
    position: fixed;
    z-index: 101;
    top: var(--md-mobile-header-row-height); right: 0; bottom: 0; left: 0;
    display: none !important;
    width: 100%;
    height: calc(100vh - var(--md-mobile-header-row-height));
    height: calc(100dvh - var(--md-mobile-header-row-height));
    margin: 0 !important;
    padding: 16px max(var(--md-mobile-gutter), env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(var(--md-mobile-gutter), env(safe-area-inset-left));
    box-sizing: border-box;
    overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    color: var(--md-mobile-ink);
    background: var(--md-mobile-surface);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .md-site .md-v2-header.is-mobile-menu-open .md-v2-nav { display: flex !important; }
  .md-site .md-v2-header .md-v2-nav-item {
    display: flex;
    width: 100%; height: auto; min-height: 48.5px;
    margin: 0; padding: 0; border: 0;
    flex: 0 0 auto; flex-direction: column; align-items: stretch;
  }
  .md-site .md-v2-header .md-v2-nav > .md-v2-nav-item > a {
    display: flex !important;
    width: 100%; height: auto; min-height: 48.5px;
    padding: 12px 22px 12px 2px !important;
    box-sizing: border-box;
    color: var(--md-mobile-ink) !important;
    font-family: var(--md-font-medium);
    font-size: 14px !important; font-weight: 400 !important; line-height: 24.5px !important;
    white-space: normal;
    align-items: center; justify-content: flex-start; flex: 0 0 auto;
  }
  .md-site .md-v2-header .md-v2-nav > .md-v2-nav-item > a::after { display: none !important; }
  .md-site .md-v2-header .md-v2-nav-item--has-menu > a::before {
    position: absolute; top: 50%; right: 0;
    width: 13px; height: 13px;
    background: var(--md-mobile-arrow-right) right center / 7px 13px no-repeat;
    content: "";
    transform: translateY(-50%);
  }
  .md-site .md-v2-header .md-v2-nav-item--has-menu.is-open > a::before {
    background-image: var(--md-mobile-arrow-down);
    background-size: 13px 7px;
  }
  .md-site .md-v2-header .md-v2-nav-contact-item { position: relative; margin-top: 24px; padding-top: 24px; border-top: 0; }
  .md-site .md-v2-header .md-v2-nav-contact-item::before { position: absolute; top: 0; right: 0; left: 0; display: block; height: 1px; background: var(--md-mobile-rule); content: ""; }
  .md-site .md-v2-header .md-v2-nav-contact img { display: none; }
  .md-site .md-v2-header .md-v2-mega-menu {
    position: static;
    display: none !important;
    visibility: visible !important;
    width: 100%; height: auto; min-height: 0; max-height: none;
    margin: 0; padding: 0; border: 0;
    background: transparent !important;
    box-shadow: none;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: none;
  }
  .md-site .md-v2-header .md-v2-nav-item.is-open > .md-v2-mega-menu { display: block !important; }
  .md-site .md-v2-header .md-v2-mega-menu__inner,
  .md-site .md-v2-header .md-v2-mega-menu__list,
  .md-site .md-v2-header .md-v2-mega-menu__groups,
  .md-site .md-v2-header .md-v2-mega-menu__contact-actions {
    position: static;
    display: flex;
    width: 100%; height: auto; margin: 0; padding: 0;
    flex-direction: column; align-items: stretch; gap: 0;
  }
  .md-site .md-v2-header .md-v2-mega-menu__inner { padding: 0 0 8px 45.5px; box-sizing: border-box; }
  .md-site .md-v2-header .md-v2-mega-menu__group { width: 100%; gap: 0; align-items: stretch; }
  .md-site .md-v2-header .md-v2-mega-menu__group + .md-v2-mega-menu__group { margin-top: 14px; }
  .md-site .md-v2-header .md-v2-mega-menu__heading {
    min-height: 36px;
    margin: 0 0 4px !important; padding: 8px 0 !important;
    border-bottom: .5px solid var(--md-mobile-rule) !important;
    color: var(--md-mobile-muted) !important;
    font-family: var(--md-font-medium);
    font-size: 14px !important; font-weight: 400 !important; line-height: 20px !important;
    white-space: normal;
  }
  .md-site .md-v2-header :is(.md-v2-mega-menu__list, .md-v2-mega-menu__group, .md-v2-mega-menu__contact-actions) > a:not(.md-v2-mega-menu__heading) {
    display: flex !important;
    width: 100%; min-height: 44px; margin: 0; padding: 10px 0;
    box-sizing: border-box;
    color: var(--md-mobile-ink) !important;
    font-family: var(--md-font-medium);
    font-size: 14px !important; font-weight: 400 !important; line-height: 24px !important;
    white-space: normal; overflow-wrap: anywhere; align-items: center;
  }
  .md-site .md-v2-header .md-v2-mega-menu__list > a.md-product-menu-label { display: block !important; min-height: 44px; padding-block: 10px; line-height: 24px !important; white-space: nowrap; overflow-wrap: normal; }
  .md-site .md-v2-header .md-product-menu-label > span { display: inline; white-space: nowrap; }
  body.admin-bar .md-site .md-v2-header { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .md-site .md-mobile-menu-toggle > span,
  .md-site .md-v2-nav,
  .md-site .md-v2-mega-menu { transition: none; }
}
