/* ==========================================================================
   PAYMITRAA — responsive layer
   Breakpoints and the measurements used at each:

     width   container   h1        h2        section pad   hero pad-top  card pad
     1440+   1364        60/72     40/48     140           230           60
     1200    100%        60/72     40/48     140           230           60
     1024    100%-24     60/72     40/48     140           180           60
      992    100%-24     60/72     40/48     140           180           60
      768    100%-24     60/72     40/48     140           180           60
      767    100%-24     36/43.2   36/43.2    80           180           30
      576    100%-24     36/43.2   36/43.2    80           180           30
      480    100%-24     36/43.2   36/43.2    80           180           30
   ========================================================================== */

/* ------------------------------------------------- 1201px – 1363px ----
   The absolutely-positioned split overlays are measured against the full
   1364px container; below it they must be re-anchored to the media box or
   they push the page sideways.                                            */
@media (max-width: 1363px) and (min-width: 1201px) {
  .split-front--phone { left: 50%; width: 330px; transform: translateX(-50%); }
  .split-front--graph { left: 50%; width: 460px; transform: translateX(-50%); }
}

/* ---------------------------------------------------------- <= 1200px ---- */
@media (max-width: 1200px) {
  /* the nav needs the room before the call chip does */
  .header-call { display: none; }
  .topbar-info li:first-child { display: none; }

  .hero-visual { max-width: 480px; }

  .feature-card { padding: 60px 40px; }
  .feature-card > img { width: 100%; max-width: 302px; }

  .efficient-media .about-bg    { left: 60px;  top: 62px;  width: 470px; }
  .efficient-media .about-photo { left: 108px; top: 74px;  width: 370px; }
  .efficient-media .about-arrow { display: none; }
  .efficient-media .about-rate  { left: 20px;  top: 320px; width: 150px; }

  .spotlight-grid   { grid-template-columns: 380px 1fr; }
  .testimonials-grid { grid-template-columns: 380px 1fr; }
  .testimonial-slider { padding-left: 24px; }
  .testimonial-card { padding: 30px 28px; }
  /* the duplicated page only exists for the desktop 2x2 rotation */
  .testimonial-card.is-clone { display: none; }

  .split-front--phone { top: 70px; left: 50%; width: 300px; transform: translateX(-50%); }
  .split-front--graph { top: 90px; left: 50%; width: 420px; transform: translateX(-50%); }
  .split--media-left  .split-copy { padding-left: 46px; }
  .split--media-right .split-copy { padding-right: 46px; }

  .cta-grid { grid-template-columns: 300px 1fr auto; gap: 24px; }
  .cta-media img { width: 280px; left: 12px; }
}

/* ---------------------------------------------------------- <= 1024px ---- */
@media (max-width: 1024px) {
  .container { padding: 0 12px; }
  .topbar .topbar-utils li { padding: 0 0 0 20px; }
  .hero { padding: calc(var(--pm-header-total) + 52px) 0 90px; }

  /* --- off-canvas navigation --- */
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed;
    top: 0; right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    margin: 0;
    padding: calc(var(--pm-header-total) + 20px) 26px 40px;
    background: #fff;
    border-left: 1px solid var(--pm-border);
    box-shadow: -22px 0 54px rgba(21, 32, 42, .14);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .4s var(--pm-ease);
    z-index: 999;
  }
  body.nav-open .main-nav { transform: translateX(0); }
  /* once the topbar has folded away the panel only needs to clear the nav row */
  .site-header.is-stuck .main-nav { padding-top: calc(var(--pm-header-h) + 20px); }
  /* the page must not scroll behind the open panel */
  body.nav-open { overflow: hidden; }
  /* the header stays beside the panel, so it is dimmed like the page overlay */
  .topbar, .header-main { position: relative; }
  .topbar::after, .header-main::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(21, 32, 42, .55);
    opacity: 0; visibility: hidden;
    transition: opacity .35s var(--pm-ease), visibility .35s;
  }
  body.nav-open .topbar::after,
  body.nav-open .header-main::after { opacity: 1; visibility: visible; }
  /* the nav leaves the flow here, so the actions need their own right push.
     They also sit above the panel, so the toggle doubles as its close button. */
  .header-actions { margin-left: auto; z-index: 1000; }
  body.nav-open .header-cta { visibility: hidden; }
  .menu { flex-direction: column; align-items: stretch; gap: 0; }
  .menu > li { border-bottom: 1px solid var(--pm-border); }
  .menu > li > a { height: auto; padding: 14px 0; justify-content: space-between; width: 100%; }
  /* Log In lives in the panel on small screens — the header row hides it */
  .menu-login { display: block; }
  /* the desktop underline would sit mid-text in the stacked menu */
  .menu > li > a::after { display: none; }
  .menu > li.has-sub > a::before { transform: rotate(45deg) translate(-3px, -3px); }
  .menu > li.is-open > a::before { transform: rotate(-135deg) translate(-3px, -3px); }
  .sub-menu {
    position: static;
    opacity: 1; visibility: visible;
    transform: none;
    display: none;
    min-width: 0;
    padding: 4px 0 10px 14px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  .menu > li.is-open > .sub-menu { display: block; }
  .sub-menu a { padding: 8px 0; color: var(--pm-body); }
  .sub-menu a:hover { color: var(--pm-primary-text); background: transparent; }
  .login-link { display: none; }

  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { max-width: 460px; }
  .hero-glow { top: -280px; right: -260px; }

  /* reference collapses the feature cards straight to a single column here */
  .feature-grid { grid-template-columns: 1fr; gap: 24px; }
  .feature-card > img { max-width: 302px; margin-left: auto; margin-right: auto; }

  .efficient-grid { grid-template-columns: 1fr; height: auto; gap: 40px; padding-bottom: 60px; }
  .efficient-media { order: 2; }
  .efficient-copy { order: 1; }
  /* the photo sits in normal flow, so a fixed height only adds a gap below it */
  .efficient-media { height: auto; display: flex; justify-content: center; }
  .efficient-media .about-bg    { left: 74px;  top: 50px;  width: 450px; }
  .efficient-media .about-photo { left: 122px; top: 60px;  width: 356px; }
  .efficient-media .about-rate  { left: 30px;  top: 300px; width: 150px; }
  .efficient-copy { padding-right: 12px; padding-bottom: 0; }

  .spotlight-grid { grid-template-columns: 1fr; gap: 50px; }
  .spotlight-shape { left: calc(50% - 300px); opacity: .6; }
  .service-grid { grid-template-columns: 1fr; gap: 24px; }

  .split-grid { grid-template-columns: 1fr; gap: 50px; }
  .split--media-left .split-copy,
  .split--media-right .split-copy { padding-left: 12px; padding-right: 12px; }
  .split-media { order: 2; }
  .split-copy  { order: 1; }
  .split-bg { margin: 0 auto; max-width: 660px; }
  .split-front--phone { width: 320px; top: 100px; }
  .split-front--graph { width: 440px; top: 110px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 50px 0; }

  .testimonials-grid { grid-template-columns: 1fr; gap: 50px; }
  .testimonial-slider { padding-left: 12px; height: auto; }
  .testimonial-track { grid-auto-rows: auto; }

  /* 2 posts per view, matching the reference slider */
  .blog-card { width: calc((100% - 23px) / 2); }

  .cta-grid { grid-template-columns: 1fr; text-align: center; gap: 30px; padding-top: 30px; padding-bottom: 30px; height: auto; }
  .cta-copy   { order: 1; }
  .cta-media  { order: 2; height: 241px; }
  .cta-action { order: 3; display: flex; justify-content: center; }
  .cta-media img { position: static; margin: 0 auto; width: 307px; }
}

/* ----------------------------------------------------------- <= 992px ---- */
@media (max-width: 992px) {
  .topbar li.topbar-hours { display: none; }
  .brand-item { padding: 0 26px; }
}

/* ----------------------------------------------------------- <= 767px ----
   The reference's real mobile switch: type drops to 36/43.2 and the
   section rhythm halves from 140px to 80px.                                */
@media (max-width: 767px) {
  :root { --rt-section-space: 80px; --pm-topbar-h: 40px; }

  /* on phones the topbar keeps only tap-to-call, centred; Log In moves into
     the off-canvas menu, where it already lives */
  .topbar .topbar-inner { justify-content: center; }
  .topbar .topbar-info { display: none; }
  .topbar .topbar-utils li { display: none; padding: 0; border: 0; }
  .topbar .topbar-utils li.topbar-call { display: inline-flex; }
  .topbar li { font-size: 13px; }

  .hero-title,
  .section-title,
  .stats-title,
  .cta-title { font-size: 36px; line-height: 43.2px; }

  .hero { padding-bottom: 80px; }
  .hero-copy { text-align: center; }
  /* the badge wraps to two lines on phones, so it cannot keep a fixed height */
  .hero-badge { height: auto; min-height: 36px; padding: 8px 18px; line-height: 20px; }
  .hero-badge .dot { flex: 0 0 auto; }
  .hero-title .rotator { line-height: 43.2px; }
  .hero-title, .hero-text, .hero-counters { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { max-width: 400px; }
  .hero-phone { max-width: 260px; }

  .feature-card { padding: 30px; }
  .feature-card > img { max-width: 100%; }

  .efficient-grid { padding-bottom: 80px; }
  .efficient-media .about-bg    { left: 44px; top: 50px;  width: 400px; }
  .efficient-media .about-photo { left: 82px; top: 60px;  width: 320px; }
  .efficient-media .about-rate  { left: 8px;  top: 300px; width: 140px; }

  .service-grid { grid-template-columns: 1fr; gap: 20px; }
  .service-card { padding: 30px; box-shadow: 6px 6px 0 0 rgba(21, 32, 42, .16); }

  .split-front--phone { width: 250px; top: 70px; }
  .split-front--graph { width: 340px; top: 80px; }

  .stat .counter-number { font-size: 56px; line-height: 68px; }
  .stat .counter-label { font-size: 18px; }

  .testimonial-track { grid-template-columns: 1fr; gap: 20px; }
  .testimonial-card { padding: 30px; }

  .blog-title { margin-top: 24px; font-size: 20px; line-height: 28px; }
  .cta-grid { padding-top: 20px; padding-bottom: 20px; gap: 24px; }
}

/* ----------------------------------------------------------- <= 576px ---- */
@media (max-width: 576px) {
  .site-header .brand img { width: auto; height: 38px; }
  .site-header .brand-text { font-size: 19px; }
  .site-header .brand-text small { display: none; }
  .header-cta { height: 44px; padding: 12px 18px; font-size: 14px; }

  .hero .counter-box { padding-right: 16px; }
  .hero .counter-box + .counter-box { padding-left: 16px; }
  .counter-number { font-size: 32px; line-height: 38px; }

  .efficient-media .about-bg    { left: 30px; top: 44px;  width: 320px; }
  .efficient-media .about-photo { left: 60px; top: 54px;  width: 300px; }
  .efficient-media .about-rate  { left: 4px;  top: 252px; width: 120px; }

  .split-front--phone { width: 210px; top: 50px; }
  .split-front--graph { width: 280px; top: 60px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 0; }

  .icon-list li, .check-list li { font-size: 16px; }
}

/* ----------------------------------------------------------- <= 480px ----
   Reference shows a single post per view below this width.                 */
@media (max-width: 480px) {
  /* the header row runs out of width here: trim the CTA rather than the logo */
  .header-actions { gap: 12px; }
  .header-cta { padding: 12px 14px; font-size: 13px; }
  .header-cta i { display: none; }

  .blog-card { width: 100%; }

  .btn { padding: 14px 17px; height: 40px; font-size: 15px; }
  .hero-title, .section-title, .stats-title, .cta-title { font-size: 30px; line-height: 38px; }
  .hero-title .rotator { line-height: 38px; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .efficient-media .about-bg    { left: 22px; top: 32px;  width: 240px; }
  .efficient-media .about-photo { left: 46px; top: 40px;  width: 280px; }
  .efficient-media .about-rate  { left: 0;    top: 190px; width: 96px; }

  .split-front--phone { width: 180px; top: 40px; }
  .split-front--graph { width: 240px; top: 50px; }

  .feature-card { padding: 30px; }
  .brand-item { padding: 0 16px; }
  .brand-item img { max-height: 30px; }
}

/* ----------------------------------------------------------- <= 360px ---- */
@media (max-width: 360px) {
  /* the wordmark no longer fits beside the CTA — the mark carries the brand */
  .site-header .brand-text { display: none; }
  .header-cta { padding: 12px 12px; }
}
