/*
 * Now Journey tour-page alignment layer
 * Keeps legacy tour templates visually consistent with the current flagship
 * desktop/mobile system without affecting the global header, navigation or footer.
 */

@media (max-width: 900px) {
  .nj-tour .nj-anchorbar,
  .njp-page .njp-tour-nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 995 !important;
    display: block !important;
  }

  .nj-tour .nj-anchorbar__inner,
  .njp-page .njp-tour-nav__inner {
    justify-content: flex-start !important;
    gap: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-right: 18px !important;
    padding-left: 18px !important;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nj-tour .nj-anchorbar__inner::-webkit-scrollbar,
  .njp-page .njp-tour-nav__inner::-webkit-scrollbar {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1000px) {
  .nj-bookbar,
  .njp-bottom-bar {
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: none !important;
    min-height: 70px !important;
    flex-direction: row !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border-radius: 28px !important;
  }

  .nj-bookbar__facts,
  .nj-bookbar__summary,
  .njp-bottom-bar__facts {
    display: none !important;
  }

  .nj-bookbar .nj-actions,
  .nj-bookbar__actions,
  .nj-bookbar__desktop-actions,
  .njp-bottom-bar__desktop-actions {
    display: flex !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .nj-bookbar__mobile-actions,
  .njp-bottom-bar__mobile-actions,
  .nj-bookbar__actions a[href*="direct.lc.chat"] {
    display: none !important;
  }

  .nj-bookbar .nj-button,
  .njp-bottom-bar .njp-btn {
    width: auto !important;
    min-width: 0 !important;
    min-height: 46px !important;
    flex: 1 1 0 !important;
    padding: 9px 11px !important;
    font-size: 10px !important;
    letter-spacing: .025em !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 767px) {
  body.has-bottom-bar,
  .nj-tour {
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }

  .nj-tour,
  .njp-page {
    overflow-x: hidden;
    overflow-x: clip;
  }

  .nj-tour section[id],
  .nj-tour article[id],
  .njp-page .njp-anchor {
    scroll-margin-top: 76px !important;
  }

  .nj-tour .nj-hero,
  .njp-page .njp-hero {
    min-height: 0 !important;
    height: auto !important;
    align-items: stretch !important;
  }

  .nj-tour .nj-hero::after {
    background: linear-gradient(0deg,rgba(5,30,38,.96) 0%,rgba(5,30,38,.86) 64%,rgba(5,30,38,.4) 100%) !important;
  }

  .nj-tour .nj-hero__content,
  .nj-tour .nj-hero--treasures .nj-hero__content,
  .njp-page .njp-hero__content {
    padding-top: 38px !important;
    padding-bottom: 28px !important;
  }

  .nj-tour .nj-hero .nj-eyebrow,
  .nj-tour .nj-hero .nj-trust,
  .nj-tour .nj-hero__badges,
  .nj-tour .nj-hero__reassurance,
  .njp-page .njp-hero__eyebrow,
  .njp-page .njp-pills {
    display: none !important;
  }

  .nj-tour .nj-hero h1,
  .nj-tour .nj-hero--treasures h1,
  .njp-page .njp-hero h1 {
    max-width: 350px !important;
    margin-bottom: 10px !important;
    font-size: clamp(43px,13vw,54px) !important;
    letter-spacing: -.05em !important;
    line-height: .94 !important;
    text-wrap: balance;
  }

  .nj-tour .nj-hero__subhead,
  .njp-page .njp-hero__sub {
    max-width: 34ch !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    font-size: 17px !important;
    line-height: 1.4 !important;
  }

  .nj-tour .nj-hero__route,
  .njp-page .njp-hero__route {
    max-width: 38ch !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  .nj-tour .nj-hero .nj-actions,
  .nj-tour .nj-hero__actions,
  .njp-page .njp-hero__actions {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 0 !important;
    align-items: stretch !important;
  }

  .nj-tour .nj-hero .nj-actions a[href="#itinerary"],
  .nj-tour .nj-hero__actions a[href="#itinerary"],
  .njp-page .njp-hero__mobile-itinerary,
  .nj-tour .nj-quick-bubble[href="#complete-journey"] {
    display: none !important;
  }

  .njp-page .njp-hero__plan,
  .nj-tour .nj-hero__proposal {
    display: block !important;
  }

  .nj-tour .nj-hero .nj-button,
  .njp-page .njp-hero__actions .njp-btn,
  .nj-tour .nj-hero__proposal .nj-button,
  .nj-tour .nj-quick-bubble {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
    font-size: 10px !important;
    letter-spacing: .035em !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .nj-tour .nj-hero__proposal {
    margin-bottom: 8px !important;
  }

  .nj-tour .nj-quick-bubbles {
    display: grid !important;
    width: 100%;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .nj-tour .nj-anchorbar__inner,
  .njp-page .njp-tour-nav__inner {
    min-height: 56px !important;
    height: 56px !important;
  }

  .nj-tour .nj-anchorbar a,
  .njp-page .njp-tour-nav a {
    display: inline-flex !important;
    min-height: 46px;
    flex: 0 0 auto;
    align-items: center;
    padding-right: 2px !important;
    padding-left: 2px !important;
    font-size: 10px !important;
    letter-spacing: .045em !important;
  }

  .nj-tour .nj-glance {
    display: block !important;
    overflow: hidden;
  }

  .nj-tour .nj-glance__grid {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    gap: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin: 0 !important;
    padding: 0 15px !important;
    scroll-padding-left: 15px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nj-tour .nj-glance__grid::-webkit-scrollbar {
    display: none;
  }

  .nj-tour .nj-glance__item {
    display: flex !important;
    min-height: 72px !important;
    flex: 0 0 min(72vw,245px) !important;
    flex-direction: column;
    justify-content: center;
    padding: 10px 16px !important;
    border-right: 1px solid rgba(255,255,255,.14) !important;
    border-bottom: 0 !important;
    text-align: left !important;
    scroll-snap-align: start;
  }

  .nj-bookbar,
  .njp-bottom-bar {
    right: 8px !important;
    bottom: max(8px,env(safe-area-inset-bottom)) !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    min-height: 64px !important;
    flex-direction: row !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 8px !important;
    border-radius: 18px !important;
  }

  .nj-bookbar__facts,
  .nj-bookbar__summary,
  .njp-bottom-bar .njp-bottom-bar__facts,
  .nj-bookbar__desktop-actions,
  .njp-bottom-bar .njp-bottom-bar__desktop-actions {
    display: none !important;
  }

  .nj-bookbar .nj-actions,
  .nj-bookbar__actions,
  .nj-bookbar__mobile-actions,
  .njp-bottom-bar .njp-bottom-bar__mobile-actions {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 7px !important;
    margin: 0 !important;
  }

  .nj-bookbar__actions a[href*="direct.lc.chat"] {
    display: none !important;
  }

  .nj-bookbar .nj-button,
  .njp-bottom-bar .njp-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    padding: 8px 7px !important;
    font-size: 10px !important;
    letter-spacing: .025em !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .nj-bookbar a[href="/reservation/"],
  .njp-bottom-bar a[href="/reservation/"] {
    order: 1;
    border-color: #f3b451 !important;
    background: #f3b451 !important;
    color: #173f49 !important;
  }

  .nj-bookbar a[href="#dates"],
  .njp-bottom-bar a[href="#dates"] {
    order: 2;
    border-color: rgba(255,255,255,.78) !important;
    background: transparent !important;
    color: #fff !important;
  }
}

@media (max-width: 359.98px) {
  .nj-tour .nj-hero h1,
  .njp-page .njp-hero h1 {
    font-size: 42px !important;
  }

  .nj-bookbar .nj-button,
  .njp-bottom-bar .njp-btn {
    font-size: 9px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nj-tour .nj-anchorbar__inner,
  .njp-page .njp-tour-nav__inner,
  .nj-tour .nj-glance__grid {
    scroll-behavior: auto !important;
  }
}
