/**
 * RSTQ Modern 1.1.8.0 — mobile sticky header + horizontal nav strip (≤767px)
 * Logo bar + horizontal link strip pin together while scrolling.
 * Hamburger (.dl-trigger) restored beside the strip; full-site dl-menu
 * injected client-side (see mobile-sticky-nav.js). Desktop (≥768) unchanged.
 * Does not touch LeadQuote, RingCentral, or gdlr-car.
 */

#rstq-mobile-nav-spacer {
  display: none;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

/* Strip is mobile-only; hide until MQ matches (JS also only inserts ≤767). */
#rstq-mobile-h-nav {
  display: none;
}

@media only screen and (max-width: 767px) {
  #rstq-mobile-nav-spacer {
    display: block;
  }

  /* Hamburger visible again — right of logo bar (parent positions it). */
  #limoking-responsive-navigation.dl-menuwrapper .dl-trigger {
    display: block !important;
    position: absolute !important;
    right: 15px !important;
    top: 25px !important;
    z-index: 10055 !important;
  }

  /* Keep trigger usable when the compact bar is pinned. */
  body.rstq-mobile-nav-pinned #limoking-responsive-navigation.dl-menuwrapper .dl-trigger {
    top: 14px !important;
    right: 12px !important;
  }

  /*
   * Closed dl-menu stays hidden; open panel is shown below the header
   * (logo + strip) so it does not cover the horizontal strip.
   * style.css already anchors top:100% to the header wrapper.
   */
  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu:not(.dl-menuopen) {
    display: none !important;
  }

  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu.dl-menuopen {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 100% !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background-color: #1a1f26 !important;
    z-index: 10050 !important;
    max-height: min(70vh, calc(100vh - 140px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  }

  /* Expand/collapse sub-lists (Fleet, Services, Wine & Brewery). */
  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub {
    position: relative;
  }

  /* span toggle — must NOT be a <button> (parent dl-menu styles buttons as hamburgers) */
  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > .rstq-sub-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #e8ecf0 !important;
    font-family: system-ui, sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    text-indent: 0 !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
    user-select: none;
  }

  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > a {
    padding-right: 52px !important;
  }

  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > ul.rstq-sub-list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #14181e;
  }

  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub.is-open > ul.rstq-sub-list {
    display: block;
  }

  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > ul.rstq-sub-list > li > a {
    display: block !important;
    padding: 12px 20px 12px 32px !important;
    box-sizing: border-box !important;
    color: #c8d0d8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: 0.03em !important;
    text-transform: none !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent !important;
  }

  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > ul.rstq-sub-list > li > a:hover,
  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > ul.rstq-sub-list > li > a:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
  }

  /* Horizontal nav strip under the logo / contacts bar */
  #rstq-mobile-h-nav {
    display: block;
    position: relative;
    width: 100%;
    background-color: #1b1e24;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 10041;
    -webkit-tap-highlight-color: transparent;
  }

  #rstq-mobile-h-nav .rstq-h-nav-scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
    padding: 0 8px;
    margin: 0;
    list-style: none;
  }

  #rstq-mobile-h-nav .rstq-h-nav-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Subtle right-edge fade hint that more links exist */
  #rstq-mobile-h-nav::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 36px;
    pointer-events: none;
    background: linear-gradient(
      to right,
      rgba(27, 30, 36, 0),
      rgba(27, 30, 36, 0.92)
    );
    z-index: 2;
  }

  #rstq-mobile-h-nav .rstq-h-nav-scroll > li {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    list-style: none;
    scroll-snap-align: start;
  }

  #rstq-mobile-h-nav .rstq-h-nav-scroll > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    box-sizing: border-box;
    font-family: "Montserrat", "Inter", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    color: #e8ecf0 !important;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
  }

  #rstq-mobile-h-nav .rstq-h-nav-scroll > li > a:hover,
  #rstq-mobile-h-nav .rstq-h-nav-scroll > li > a:focus {
    color: #ffffff !important;
  }

  #rstq-mobile-h-nav .rstq-h-nav-scroll > li.current-menu-item > a,
  #rstq-mobile-h-nav .rstq-h-nav-scroll > li.current_page_item > a,
  #rstq-mobile-h-nav .rstq-h-nav-scroll > li.current-menu-ancestor > a,
  #rstq-mobile-h-nav .rstq-h-nav-scroll > li.is-current > a {
    color: #ffffff !important;
    border-bottom-color: #1eacc7;
  }

  /* Pinned compact bar — logo + horizontal strip */
  body.rstq-mobile-nav-pinned .limoking-header-wrapper.header-style-2-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 10040 !important;
    background-color: #1a1f26 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
    overflow: visible !important;
  }

  /* Hide contacts / Available 24/7 when pinned — keeps bar compact */
  body.rstq-mobile-nav-pinned .limoking-header-wrapper .limoking-logo-right-text {
    display: none !important;
  }

  body.rstq-mobile-nav-pinned .limoking-header-wrapper .limoking-logo-wrapper {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  body.rstq-mobile-nav-pinned .limoking-header-wrapper .limoking-logo {
    margin: 8px 15px !important;
  }

  body.rstq-mobile-nav-pinned .limoking-header-wrapper .limoking-logo img {
    max-height: 52px !important;
  }

  /* Strip stays visible when pinned (same dark header) */
  body.rstq-mobile-nav-pinned #rstq-mobile-h-nav {
    background-color: #1a1f26;
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  body.rstq-mobile-nav-pinned #rstq-mobile-h-nav::after {
    background: linear-gradient(
      to right,
      rgba(26, 31, 38, 0),
      rgba(26, 31, 38, 0.92)
    );
  }

  /* Keep float BOOK NOW above the sticky bar if they ever compete */
  body.rstq-mobile-nav-pinned .rstq-float-booknow {
    z-index: 99990;
  }

  /*
   * Page title sits below the (taller) sticky header. Existing page-title-pop
   * animations remain; no extra hide. Spacer JS covers flow height.
   */
}

@media only screen and (min-width: 768px) {
  #rstq-mobile-nav-spacer {
    display: none !important;
    height: 0 !important;
  }

  #rstq-mobile-h-nav {
    display: none !important;
  }
}

/* 1.1.8.1: hide parent theme's sub-menu arrow that overlapped our +/- toggle */
@media (max-width: 767px) {
  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > a::after,
  #limoking-responsive-navigation.dl-menuwrapper > .dl-menu > li.rstq-has-sub > a::before {
    content: none !important;
    display: none !important;
  }
}
