/* ==========================================================================
   SPRINT-THRU — MOBILE STYLESHEET
   --------------------------------------------------------------------------
   Scope   : screens BELOW 992px (Bootstrap 'lg' breakpoint)
   Purpose : adapts the desktop layout for phones/tablets. Contains ONLY
             mobile rules, so it can be safely loaded alongside the desktop
             stylesheet without affecting desktop rendering.

   LOAD ORDER (important — must be LAST):
     1. bootstrap.min.css
     2. font-awesome / aos.css
     3. Sprint_Thru_V5.css          (existing desktop base)
     4. sprint-thru-desktop.css     (desktop structural rules)
     5. sprint-thru-mobile.css      <-- THIS FILE
   ========================================================================== */


/* ==========================================================================
   1. GLOBAL (applies at all widths — required for mobile behaviour)
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

/* Hamburger is hidden by default; revealed only in the mobile block below */
.mobile-nav-toggle {
  display: none;
}


/* ==========================================================================
   2. MOBILE / TABLET  ( max-width: 991.98px )
   ========================================================================== */
@media (max-width: 991.98px) {

  /* ------------------------------------------------------------------
     2.1  PAGE FOUNDATION
     'clip' (not 'hidden') prevents sideways scroll WITHOUT creating a
     scroll container — 'hidden' would silently break position:sticky.
     ------------------------------------------------------------------ */
  html,
  body {
    overflow-x: clip;
    max-width: 100%;
  }

  img,
  svg,
  video {
    max-width: 100%;
    height: auto;
  }

  /* ------------------------------------------------------------------
     2.2  STICKY HEADER
     ------------------------------------------------------------------ */
  .sticky-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1050;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  }

  /* A transform/filter on an ancestor would also break sticky */
  body > .sticky-header {
    transform: none;
    filter: none;
  }

  /* ------------------------------------------------------------------
     2.3  NAVBAR LAYOUT  (logo | hamburger | contact | menu panel)
     ------------------------------------------------------------------ */
  .navbar {
    position: relative;
  }

  .navbar .container {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    column-gap: .5rem;
    row-gap: .35rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
  }

  .navbar-brand {
    margin-right: auto !important;
    margin-left: 0 !important;
  }

  .navbar-brand img {
    height: 46px !important;
    width: auto;
  }

  /* ------------------------------------------------------------------
     2.4  HAMBURGER TOGGLE
     ------------------------------------------------------------------ */
  .mobile-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    order: 3;
    width: 46px;
    height: 44px;
    padding: 9px 8px;
    border: 1px solid #2C5F93;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
  }

  .mobile-nav-toggle:focus-visible {
    outline: 3px solid #2C5F93;
    outline-offset: 2px;
  }

  .mobile-nav-toggle-bar {
    display: block;
    width: 100%;
    height: 3px;
    background: #2C5F93;
    border-radius: 3px;
    transition: transform .28s ease, opacity .2s ease;
  }

  /* Bars morph into an X when open */
  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* ------------------------------------------------------------------
     2.5  CONTACT CTA — stays on the top bar, always one tap away
     ------------------------------------------------------------------ */
  .nav-contact-cta {
    order: 2;
    margin-left: 0 !important;
  }

  .nav-contact-cta .btn {
    padding: .38rem .85rem !important;
    font-size: .85rem;
    white-space: nowrap;
  }

  /* ------------------------------------------------------------------
     2.6  COLLAPSIBLE MENU PANEL
     ------------------------------------------------------------------ */
  #primaryNavMenu {
    order: 4;
    flex: 0 0 100%;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    background: #fff;
    border-top: 1px solid #e9e9e9;
    box-shadow: 0 14px 22px rgba(0, 0, 0, .10);
    transition: max-height .35s ease, opacity .25s ease;
  }

  #primaryNavMenu.open {
    max-height: calc(100vh - 62px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    visibility: visible;
    padding-bottom: .75rem;
  }

  /* ------------------------------------------------------------------
     2.7  NAV LISTS — stack vertically
     ------------------------------------------------------------------ */
  #primaryNavMenu .navbar-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    gap: 0 !important;
    padding-left: 0;
    margin-bottom: 0;
  }

  #primaryNavMenu .portal-nav .d-flex,
  #primaryNavMenu .portal-nav > div {
    display: block !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100%;
  }

  #primaryNavMenu .navbar-nav > li,
  #primaryNavMenu .navbar-nav > div,
  #primaryNavMenu .navbar-nav > span {
    width: 100%;
    border-bottom: 1px solid #f1f1f1;
  }

  #primaryNavMenu .navbar-nav .nav-link,
  #primaryNavMenu .navbar-nav > div > span > a,
  #primaryNavMenu .navbar-nav a.nav-link,
  #primaryNavMenu .submenu-label,
  #primaryNavMenu .navbar-nav > li > a {
    display: block;
    padding: .72rem .95rem !important;
    font-size: 1rem;
    text-decoration: none !important;
  }

  #primaryNavMenu .navbar-nav span {
    display: block;
  }

  #primaryNavMenu .nav-chevron {
    float: right;
    margin-top: .25rem;
  }

  /* ------------------------------------------------------------------
     2.8  DROPDOWNS — render inline (accordion) instead of floating
     ------------------------------------------------------------------ */
  #primaryNavMenu .dropdown-menu {
    position: static !important;
    float: none !important;
    width: 100%;
    margin: 0;
    padding: 0 0 .25rem 1rem;
    border: none;
    box-shadow: none;
    background: #f7f9fb;
  }

  #primaryNavMenu .dropdown-submenu .dropdown-menu {
    margin-left: .6rem;
    padding-left: 1.6rem;
    border-left: 2px solid #cdd8e3;
    background: #eef2f6;
  }

  #primaryNavMenu .dropdown-item {
    white-space: normal;
    padding: .6rem .95rem;
  }

  /* Nested submenus (Merchant Store / Consumer Store / Logins) stay
     collapsed under their own label until tapped, so groups never bleed. */
  #primaryNavMenu .dropdown-submenu > .dropdown-menu {
    display: none !important;
  }

  #primaryNavMenu .dropdown-submenu.submenu-open > .dropdown-menu {
    display: block !important;
  }

  #primaryNavMenu .submenu-label {
    cursor: pointer;
    font-weight: 600;
  }

  /* Enlarged tap target on the chevron */
  #primaryNavMenu .submenu-label .nav-chevron {
    padding: .4rem .55rem;
    margin: -.4rem -.15rem -.4rem 0;
    transition: transform .25s ease;
  }

  #primaryNavMenu .dropdown-submenu.submenu-open > .submenu-label .nav-chevron {
    transform: rotate(90deg);
  }

  /* ------------------------------------------------------------------
     2.9  ANCHOR SCROLL OFFSET
     --anchor-offset is set at runtime from the real header height.
     ------------------------------------------------------------------ */
  section[id],
  [id$="-collapse-begin"],
  #about-us,
  #features,
  #solutions {
    scroll-margin-top: var(--anchor-offset, 84px) !important;
  }

  /* ------------------------------------------------------------------
     2.10  HERO
     ------------------------------------------------------------------ */
  .hero {
    padding-top: 1.4rem !important;
    padding-bottom: 1.4rem !important;
  }

  .hero .fs-1 {
    font-size: 1.6rem !important;
    line-height: 1.25;
  }

  .hero .fs-3 {
    font-size: 1.15rem !important;
  }

  .hero .lead {
    font-size: 1rem !important;
    text-align: left !important;
  }

  .slider-card,
  .slider-frame {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .slider-frame img,
  .myMerSlides {
    max-width: 100% !important;
    height: auto !important;
  }

  /* ------------------------------------------------------------------
     2.11  TYPE SCALE
     ------------------------------------------------------------------ */
  .display-1,
  .display-2,
  .display-3,
  .display-4 {
    font-size: 1.9rem !important;
  }

  .fs-1 { font-size: 1.55rem !important; }
  .fs-2 { font-size: 1.30rem !important; }
  .fs-3 { font-size: 1.15rem !important; }
  .fs-4 { font-size: 1.05rem !important; }
  .fs-5 { font-size:  .98rem !important; }
  .lead { font-size: 1rem !important; }

  /* Justified text reads poorly in narrow columns */
  p[style*="justify"],
  li[style*="justify"] {
    text-align: left !important;
  }

  /* ------------------------------------------------------------------
     2.12  SECTION RHYTHM, CARDS & BUTTONS
     ------------------------------------------------------------------ */
  .section-sort-padding {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .image-card {
    padding: .7rem !important;
  }

  .btn {
    min-height: 42px;
  }

  .btn-lg {
    padding: .6rem 1.1rem !important;
    font-size: 1rem !important;
  }

  /* ------------------------------------------------------------------
     2.13  FOOTER
     ------------------------------------------------------------------ */
  .footer-top-flex {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1.25rem;
    text-align: center;
  }

  .footer-top-col {
    width: 100%;
  }

  .footer-logo img {
    max-width: 180px;
  }

  .footer-qr {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
  }

  .footer-qr img {
    max-width: 120px;
    height: auto;
  }

  .footer-app-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
  }

  .footer-app-icons img {
    max-width: 135px;
    height: auto;
  }

  .footer-pay {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
  }

  .footer-pay img {
    max-width: 58px;
    height: auto;
  }

  .footer-bottom {
    text-align: center;
  }

  footer .row {
    text-align: left;
  }
}


/* ==========================================================================
   3. SMALL PHONES  ( max-width: 480px )
   ========================================================================== */
@media (max-width: 480px) {

  .navbar-brand img {
    height: 42px !important;
  }

  .nav-contact-cta .btn {
    padding: .32rem .6rem !important;
    font-size: .78rem;
  }

  .hero .fs-1 { font-size: 1.40rem !important; }
  .fs-1       { font-size: 1.40rem !important; }
  .fs-2       { font-size: 1.18rem !important; }

  .container {
    padding-left: .85rem;
    padding-right: .85rem;
  }
}


/* ==========================================================================
   4. FALLBACK — browsers without overflow-x:clip (e.g. Safari < 16)
   Sticky is switched to fixed so the header still stays pinned.
   ========================================================================== */
@supports not (overflow-x: clip) {
  @media (max-width: 991.98px) {

    html,
    body {
      overflow-x: visible;
    }

    .sticky-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
    }

    body {
      padding-top: var(--mobile-header-h, 74px);
    }
  }
}


/* ==========================================================================
   5. ACCESSIBILITY — reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  #primaryNavMenu,
  .mobile-nav-toggle-bar {
    transition: none !important;
  }

  [data-aos] {
    transition-duration: .01ms !important;
  }
}
