/* =============================================================
   responsive.css — global responsive pass
   Loaded AFTER site.css so these rules win the cascade.
   Mobile-first overrides for breakpoints not covered by site.css.
   ============================================================= */

/* -------- 0. Global overflow / scaling guards -------- */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { min-width: 0; }
img, video, svg, canvas, iframe { max-width: 100%; height: auto; }

/* Long URLs / emails (footer, contact) shouldn't blow out columns */
.foot-contact a,
.foot-office-body,
.foot-office-body a,
.office p,
.office a { word-break: break-word; overflow-wrap: anywhere; }

/* Tables become scrollable on narrow screens instead of clipping */
.cmp-table { display: block; max-width: 100%; overflow-x: auto; }

/* Make the container guard against tiny phones */
.wrap { width: 100%; max-width: 1120px; padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto; }

/* Cap absurd widths on ultra-wide monitors */
@media (min-width: 1600px) {
  .hero-grid { max-width: 1280px; }
  .nav { max-width: 1280px; }
  .page-hero h1 { max-width: 960px; }
}

/* -------- 1. Fluid typography (clamp) -------- */
.hero h1       { font-size: clamp(32px, 5.4vw, 58px); line-height: 1.06; }
.hero p        { font-size: clamp(15px, 1.6vw, 18px); }
.h2            { font-size: clamp(26px, 3.6vw, 42px); }
.cta h2        { font-size: clamp(28px, 4vw, 54px); }
.page-hero h1  { font-size: clamp(28px, 4.6vw, 50px); }
.page-hero p   { font-size: clamp(15px, 1.6vw, 19px); }

/* -------- 2. Tablet 1024px (3-col → 2-col grids) -------- */
@media (max-width: 1024px) {
  .cols3, .feat-grid, .intg-grid, .plans, .tilegrid, .why-grid, .lp-benefits {
    grid-template-columns: 1fr 1fr;
  }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .foot-grid { grid-template-columns: 1.4fr repeat(2, 1fr); }
  .foot-grid .foot-brand { grid-column: 1 / -1; }
  .foot-offices { grid-template-columns: 1fr 1fr; }
  .nav-menu { gap: 18px; font-size: 13.5px; }
  .hero-visual { height: 480px; }
  .sec { padding: 72px 24px; }
}

/* -------- 3. Below 880px (existing breakpoint reinforced) -------- */
@media (max-width: 880px) {
  /* Single column for nearly all grids */
  .cols3, .cols2, .feat-grid, .intg-grid, .plans, .tilegrid,
  .why-grid, .lp-benefits, .cards-2,
  .ind-body, .net-grid, .an-grid, .roi-wrap {
    grid-template-columns: 1fr;
  }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .foot-grid .foot-brand { grid-column: 1 / -1; }
  .foot-offices { grid-template-columns: 1fr; gap: 16px; }

  /* Hero stacks vertically */
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding: 120px 20px 64px; }
  .hero p { max-width: 100%; }
  .hero-visual { height: auto; min-height: 360px; padding: 20px 0; }

  /* Headings / spacing tighter */
  .page-hero { padding: 120px 20px 56px; }
  .sec { padding: 56px 18px; }
  .center-head { margin-bottom: 36px; }

  /* Nav: hamburger active */
  .nav-menu, .nav-talk { display: none; }
  .nav-burger { display: flex; }
  .nav-logo img { width: 46px; height: 46px; }
  .nav-logo span { font-size: 18px; }
  .nav { padding: 8px 8px 8px 14px; gap: 12px; }

  /* Contact form: ensure inline-styled grid collapses */
  section.sec.sec-light .wrap[style*="grid-template-columns"],
  section.sec.sec-light > .wrap {
    grid-template-columns: 1fr !important;
  }

  /* Tabs wrap cleanly */
  .atabs { width: 100%; justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .atab { white-space: nowrap; }
}

/* -------- 4. Phones ≤640px -------- */
@media (max-width: 640px) {
  .sec { padding: 48px 16px; }
  .hero { padding: 110px 16px 118px !important; }
  .page-hero { padding: 110px 16px 48px; }
  .hero-visual { height: 470px !important; min-height: 470px !important; align-items: flex-start !important; padding-top: 26px !important; }
  .hero-visual img.portrait { width: min(78vw, 292px) !important; }
  .portal-glow { width: 420px; height: 420px; }
  .portal-ring { width: 360px; height: 360px; }
  .float-card { left: 0 !important; right: auto !important; bottom: -30px !important; width: min(320px, 58vw) !important; max-width: 58vw !important; padding: 12px; transform: translateY(36px) !important; }
  .metric-chip { top: 118px !important; right: 0 !important; padding: 9px 12px; font-size: 12px; transform: translateY(18px) !important; }

  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn, .hero-cta .btn-primary, .hero-cta .btn-ghost { width: 100%; justify-content: center; }

  .center-head { margin-bottom: 28px; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; padding-bottom: 28px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .foot-bottom .legal { flex-wrap: wrap; gap: 10px 14px; }

  /* Cards / inline-styled blocks: less padding */
  .card-l[style*="padding: 32"],
  .card-l[style*="padding:32"] { padding: 22px !important; }

  /* Contact form grids stack */
  form > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  button[type="submit"].btn-primary { width: 100% !important; }

  /* Pricing / plan card padding */
  .plan { padding: 22px !important; }

  /* FAQ */
  .faq summary { padding: 16px 16px; font-size: 15px; }
  .faq details p { padding: 0 16px 16px; }

  /* ROI */
  .roi-card, .roi-out { padding: 22px; }
  .roi-out .big { font-size: 36px; }

  /* Sticky CTA full-width */
  .sticky-cta { left: 12px; right: 12px; bottom: 12px; }
  .sticky-cta a { flex: 1; text-align: center; padding: 14px; }

  /* Demo */
  .demo-stage { padding: 16px; }
  .lang-btn { min-width: calc(50% - 4px); }
  .voice-map { padding: 22px 18px; min-height: auto; background-image: none !important; background-color: #ece6f5; }
  .map-pills { position: static; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
  .mk { position: static; transform: none; }
  .mk-pop { position: static; transform: none; margin-top: 6px; }

  /* Tables on small */
  .cmp-table th, .cmp-table td { padding: 10px 12px; font-size: 13px; }
}

/* -------- 5. Very small phones ≤480px -------- */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .stats { grid-template-columns: 1fr; }

  .hero { padding: 100px 14px 120px !important; }
  .hero p { font-size: 15.5px; }
  .badge { font-size: 11px; padding: 6px 12px; }
  .trust-row { flex-wrap: wrap; }

  .h2 { letter-spacing: -.02em; }
  .lead { font-size: 15.5px; }

  .nav-shell { padding: 0 12px; top: 12px; }
  .nav { padding: 6px 6px 6px 12px; gap: 8px; }
  .nav-logo img { width: 40px; height: 40px; }
  .nav-logo span { font-size: 16px; }
  .nav-book { padding: 9px 14px; font-size: 13px; }
  .mobile-menu { top: 78px; left: 12px; right: 12px; }

  .sec { padding: 44px 14px; }
  .page-hero { padding: 100px 14px 42px; }

  .hero-visual { height: 456px !important; min-height: 456px !important; }
  .hero-visual img.portrait { width: min(78vw, 290px) !important; }
  .portal-glow { width: 340px; height: 340px; }
  .portal-ring { width: 290px; height: 290px; }
  .float-card { left: 0 !important; bottom: -36px !important; width: min(320px, 58vw) !important; padding: 10px; transform: translateY(38px) !important; }
  .metric-chip { right: 0 !important; top: 116px !important; padding: 8px 10px; transform: translateY(18px) !important; }

  /* Buttons readable on tiny screens */
  .btn, .btn-primary, .btn-ghost, .btn-white {
    padding: 13px 22px; font-size: 14.5px;
  }
  .cta .row { flex-direction: column; align-items: stretch; gap: 10px; }
  .cta .row > * { width: 100%; justify-content: center; }

  /* Footer */
  footer { padding: 48px 16px 28px; }
  .foot-office { padding: 18px 16px; }
  .foot-hours { font-size: 12.5px; gap: 14px 20px; }

  /* Demo grid */
  .lang-btn { min-width: 100%; }
  .key-row input, .key-row select { width: 100%; min-width: 0; }
  .picker-row { gap: 10px; }
  .picker-field { min-width: 100%; }

  /* Agent cards */
  .acard { padding: 18px; }
  .acard .top { flex-direction: column; gap: 12px; }
  .acard .btns { flex-direction: row; }
  .callbtn { padding: 14px 22px; font-size: 17px; flex-wrap: wrap; justify-content: center; text-align: center; }

  /* Comparison */
  .cmp { padding: 22px 18px !important; }

  /* Forms: comfortable touch target */
  input, select, textarea, button { font-size: 16px !important; } /* prevents iOS zoom */
}

/* -------- 6. Ultra-narrow ≤360px (320–360 range) -------- */
@media (max-width: 360px) {
  .hero h1 { font-size: 28px; }
  .page-hero h1 { font-size: 26px; }
  .h2 { font-size: 24px; }
  .nav-logo span { display: none; }
  .nav-book { padding: 8px 12px; font-size: 12.5px; }
  .float-card { display: block !important; bottom: -40px !important; }
  .metric-chip { right: 4px !important; top: 112px !important; }
  .stats .stat { padding: 18px 16px; }
  footer { padding: 40px 12px 24px; }
}

/* -------- 7. Touch targets / accessibility -------- */
@media (hover: none) and (pointer: coarse) {
  a.btn, button.btn, .btn-primary, .btn-ghost, .btn-white,
  .nav-book, .nav-talk, .lang-btn, .map-pill, .mk-btn,
  .atab, .aplay, .aarrow {
    min-height: 44px;
  }
  .socials a { min-width: 44px; min-height: 44px; }
}

/* -------- 8. Reduced motion -------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------- 9. Focus visibility -------- */
a:focus-visible, button:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #c084fc;
  outline-offset: 2px;
}
