/* =========================================================
   SummitFX — Mobile Polish
   Loaded only at <= 960px after site-base.css has supplied the
   font, overflow safety, touch feedback and desktop burger state.
   Finer tuning is applied at <= 600px, <= 480px and <= 360px.

   Mobile breakpoint  (<= 960px)
   Threshold matches the legacy `<=960` link-hiding rules in
   product-page.css / whatsapp.html / contact.html so the
   burger appears at exactly the moment desktop links disappear
   (no 901–960 dead zone).
   ========================================================= */
@media (max-width: 960px) {

  /* ---- NAV: smaller, tighter ---- */
  nav {
    height: 70px !important;
    padding: 0 1rem !important;
  }
  nav.scrolled {
    height: 60px !important;
  }

  /* Shrink the cropped logo by ~40% so it fits a small viewport */
  .logo-wrap {
    height: 42px !important;
    margin-left: -78px !important;
  }
  .logo-svg {
    height: 140px !important;
    margin-top: -56px !important;
  }
  nav.scrolled .logo-wrap {
    height: 36px !important;
  }
  nav.scrolled .logo-svg {
    height: 120px !important;
    margin-top: -48px !important;
  }

  /* Show burger — positioned absolutely so the wide cropped logo
     SVG can't squeeze it out of the flex layout */
  nav { position: fixed; }
  .nav-burger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    z-index: 5;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy, #0d213c);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-direction: column;
    align-items: stretch;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0.25rem 0 0.5rem !important;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0s linear 0.25s;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    display: flex !important;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  nav.menu-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.95rem 1.5rem !important;
    font-size: 1rem !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }
  .nav-links a.btn-nav {
    margin: 0.75rem 1.25rem 0.5rem !important;
    padding: 0.85rem 1.4rem !important;
    border-radius: 6px;
    text-align: center;
    border-bottom: 0;
    color: #0d213c !important;
  }
  /* Login is a ghost (outline) button — keep its text azure in the
     mobile menu, unlike the solid green "Open account" CTA. */
  .nav-links a.btn-nav[href="/login"] {
    color: #00b5e0 !important;
  }

  /* Ticker sits below the (now smaller) fixed nav.
     The .nav-scrolled class is added/removed by components.js
     to avoid relying on the modern :has() selector for the
     scrolled-state offset. */
  #tickerWrap {
    margin-top: 70px !important;
  }
  #tickerWrap.nav-scrolled {
    margin-top: 60px !important;
  }

  /* =========================================================
     HERO — keep headlines inside the viewport
     ========================================================= */
  .hero {
    min-height: auto !important;
    padding: 5rem 1.25rem 3rem !important;
  }
  .hero h1,
  .hero-content h1,
  h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.6rem) !important;
    line-height: 1.12 !important;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
  /* Override inline white-space: nowrap on hero copy spans */
  .hero h1 span,
  .hero-content h1 span,
  h1 span,
  h2 span {
    white-space: normal !important;
  }
  .hero-sub, .hero p {
    font-size: 0.98rem !important;
    line-height: 1.7 !important;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-whatsapp,
  .hero-actions .btn-ghost,
  .hero-actions a,
  .hero-actions button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  /* Decorative mountain bg shouldn't compete with hero copy on mobile */
  .mtn-bg { width: 100% !important; opacity: 0.08 !important; }

  /* =========================================================
     Sections / typography rhythm
     ========================================================= */
  .section { padding: 3rem 1.25rem !important; }

  h2 {
    font-size: clamp(1.55rem, 6.5vw, 2.1rem) !important;
    line-height: 1.18;
    overflow-wrap: break-word;
  }
  h3 {
    font-size: 1.15rem !important;
    overflow-wrap: break-word;
  }

  /* Common grid containers — collapse to single column */
  .equity-grid,
  .wa-grid,
  .features-grid,
  .steps-grid,
  .testi-grid,
  .cta-inner,
  .stats-grid,
  .partners-grid,
  .footer-grid,
  .equity,
  .contact,
  .testimonials,
  .steps {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  /* Stats prefer 2-up on small phones */
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* =========================================================
     WhatsApp feature carousel
     ========================================================= */
  .wa-slides-wrap {
    height: auto !important;
    min-height: 540px;
  }
  .wa-slide {
    flex-direction: column !important;
    padding: 0.5rem 0.25rem 0 !important;
    gap: 1.5rem !important;
    align-items: stretch !important;
  }
  .wa-slide-copy {
    max-width: 100% !important;
    padding-right: 0 !important;
  }
  .wa-slide-phone {
    justify-content: center !important;
  }
  .wa-phone-shell {
    transform: scale(0.85);
    transform-origin: top center;
  }

  /* =========================================================
     Tables — let them scroll horizontally when too wide
     ========================================================= */
  .rates,
  .rates__table,
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .rates__table { display: table; min-width: 480px; }
  .rates { padding: 0; }

  /* =========================================================
     Floating WhatsApp button — keep it tappable, away from edge
     ========================================================= */
  .whatsapp-float {
    right: 16px !important;
    bottom: 16px !important;
    width: 52px !important;
    height: 52px !important;
  }

  /* =========================================================
     Forms — full-width inputs and large tap area
     ========================================================= */
  .contact__form,
  form {
    padding: 1.25rem !important;
  }
  .field input,
  .field select,
  .field textarea,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important; /* prevents iOS auto-zoom on focus */
    width: 100%;
  }

  /* =========================================================
     Footer (already responsive at 560px) — small spacing tweak
     ========================================================= */
  footer { padding: 2.5rem 1.25rem 1.5rem !important; }

  /* Misc: prevent any 320px-fixed images/cards overflowing */
  img, video, svg, iframe { max-width: 100%; height: auto; }
}

/* =========================================================
   Tighter phone breakpoint (<= 480px)
   ========================================================= */
@media (max-width: 480px) {
  .hero h1, .hero-content h1, h1 {
    font-size: clamp(1.7rem, 9vw, 2.3rem) !important;
  }
  h2 {
    font-size: clamp(1.4rem, 7.5vw, 1.9rem) !important;
  }
  .hero-eyebrow, .eyebrow {
    font-size: 0.7rem !important;
  }
  .hero {
    padding: 4.5rem 1rem 2.5rem !important;
  }
  .section { padding: 2.5rem 1rem !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .nav-burger { width: 40px; height: 40px; padding: 8px; }
}

/* =========================================================
   Very small (<= 360px)
   ========================================================= */
@media (max-width: 360px) {
  .logo-wrap { height: 36px !important; margin-left: -68px !important; }
  .logo-svg { height: 120px !important; margin-top: -48px !important; }
  nav { padding: 0 0.85rem !important; }
}

/* =========================================================
   Home: bank/payments partner carousel
   Cards are absolute-positioned with hard translateX values
   that overflow narrow viewports — clip the wrap, pull the
   side cards in, and hide the back-row cards on mobile.
   ========================================================= */
.partner-carousel-wrap { overflow: hidden; max-width: 100%; }

@media (max-width: 960px) {
  .partner-stage { height: 440px !important; }
  .partner-card {
    width: min(340px, calc(100vw - 2.5rem)) !important;
    padding: 1.5rem !important;
  }
  /* Show only the active card on mobile — the side cards
     overlapped the active one at narrow widths even when
     translated. Users navigate with the existing dots/arrows. */
  .partner-card.pc-next,
  .partner-card.pc-prev,
  .partner-card.pc-next2,
  .partner-card.pc-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
  }
}

/* =========================================================
   Home: WhatsApp feature mockup carousel
   Same pattern as above — .feature-card.fc-* uses big
   translateX offsets. The .wa-slides-wrap already clips
   overflow, but pulling the side cards in stops them feeling
   detached from the active one.
   ========================================================= */
@media (max-width: 960px) {
  /* Show only active feature card on mobile (same reasoning
     as the partner carousel above). */
  .feature-card.fc-next,
  .feature-card.fc-prev,
  .feature-card.fc-next2,
  .feature-card.fc-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
  }
}

/* =========================================================
   Firm-page live-rate widget — hide the long currency name
   on small screens so the 3-col [from][swap][to] row fits
   without wrapping.
   ========================================================= */
@media (max-width: 600px) {
  .ref-rates-button .name { display: none !important; }
  .ref-rates-button { padding: 0.7rem 0.75rem !important; }
  .ref-rates-row { gap: 0.5rem !important; }
}

/* =========================================================
   Firm-page consultation calendar grid — keep 7 cols but
   tighten gap and cap font so cells don't crush below ~36px
   tap targets at 360px.
   ========================================================= */
@media (max-width: 480px) {
  .speak-cal-grid { gap: 0.2rem !important; }
  .speak-cal-day {
    font-size: 0.78rem !important;
    border-radius: 6px !important;
  }
  .speak-cal-dow { font-size: 0.6rem !important; padding: 0.3rem 0 0.4rem !important; }
}

/* =========================================================
   Missing section padding overrides
   .cta-section and .rates-section weren't covered by the
   generic .section rule so they were keeping their inline
   "padding: 5rem 3rem" on mobile, pushing edge-to-edge.
   ========================================================= */
@media (max-width: 960px) {
  .cta-section,
  .rates-section {
    padding: 3rem 1.25rem !important;
  }
  .cta-inner {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    text-align: center;
  }
}
@media (max-width: 480px) {
  .cta-section,
  .rates-section {
    padding: 2.5rem 1rem !important;
  }
}

/* =========================================================
   Ticker — boost tap target + vertical centring on mobile
   (was 0 vertical padding + 0.7rem font, well under 44px).
   ========================================================= */
@media (max-width: 960px) {
  .ticker-item {
    padding: 0.85rem 1.1rem !important;
    font-size: 0.78rem !important;
    min-height: 44px;
    align-items: center;
  }
}
