/* =====================================================================
   GLOBAL RESPONSIVE — applied to all pages (loaded after page-specific CSS)
   Breakpoints: 1200, 1024, 768, 480
   Goal: zero horizontal overflow, perfect stacking on mobile, readable text.
   ===================================================================== */

/* --- 1200 and below: tighten hero dashboards / right cards --- */
@media (max-width: 1200px) {
  .tr-hero-inner,
  .ch-hero-inner,
  .uni-hero-inner,
  .aca-hero-inner,
  .net-hero-inner {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 48px;
  }
  .ch-inbox, .uni-progress-card, .aca-platform,
  .net-commission, .tr-dashboard { max-width: 100%; }
}

/* --- 1024 and below: stack heroes, 2-col grids --- */
@media (max-width: 1024px) {
  /* Heroes stack */
  .tr-hero-inner,
  .ch-hero-inner,
  .uni-hero-inner,
  .aca-hero-inner,
  .net-hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
    padding-top: 120px;
  }
  .tr-hero-text, .ch-hero-text, .uni-hero-text, .aca-hero-text, .net-hero-text {
    text-align: center;
  }
  .tr-feature-list, .ch-feature-list,
  .tr-hero-ctas, .ch-hero-ctas, .uni-hero-ctas, .aca-hero-ctas, .net-hero-ctas,
  .uni-badges, .aca-hero-badges, .net-hero-meta {
    justify-content: center;
    align-items: center;
  }
  .tr-hero-dash, .ch-hero-dash, .ch-hero-mock,
  .uni-hero-card, .aca-hero-card, .net-hero-card {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
  }
  .ch-lead, .tr-lead, .uni-lead, .aca-lead, .net-lead {
    margin-left: auto;
    margin-right: auto;
  }

  /* Split sections stack */
  .ch-split, .ch-split-reverse,
  .tr-sig-grid, .aca-what,
  .ch-quality-head {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .ch-split-reverse { grid-template-areas: "text" "visual"; }

  /* 3+ col grids become 2-col */
  .cards-grid,
  .tr-criteria-grid, .tr-devices-grid,
  .ch-criteria-grid, .ch-benefits, .ch-diffs,
  .uni-features,
  .aca-benefits,
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 4-col grids become 2-col */
  .tr-challenges,
  .ch-problems, .ch-segments,
  .net-benefits,
  .ch-pipeline,
  .ch-alerts-grid,
  .ch-reports,
  .cont-quick, .cont-offices,
  .aca-plans, .ch-plans, .tr-plans {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  /* Steps horizontal timelines become vertical */
  .tr-steps { grid-template-columns: 1fr !important; gap: 16px; }
  .tr-step-line { display: none; }
}

/* --- 768 and below: mobile — everything single column --- */
@media (max-width: 768px) {
  /* Section padding */
  .section { padding: 80px 0; }

  /* Container padding */
  .container,
  .gloss-container,
  .cont-container,
  .news-container { padding-left: 20px; padding-right: 20px; }

  /* Hero padding */
  .tr-hero-inner, .ch-hero-inner, .uni-hero-inner,
  .aca-hero-inner, .net-hero-inner {
    padding: 110px 20px 64px;
    gap: 40px;
  }

  /* Intro headers (news/glossário/contato — no hero) */
  #news-head, #gloss-head, #cont-head { padding: 120px 0 36px; }

  /* All grids → single column */
  .cards-grid,
  .tr-challenges, .tr-devices-grid, .tr-alerts-grid, .tr-criteria-grid,
  .ch-problems, .ch-alerts-grid, .ch-benefits, .ch-criteria-grid,
  .ch-pipeline, .ch-reports, .ch-segments, .ch-diffs, .ch-plans,
  .uni-features,
  .aca-benefits, .aca-plans,
  .net-benefits,
  .cont-quick, .cont-offices,
  .news-grid,
  .gloss-grid,
  .tr-plans,
  .footer-grid,
  .aca-what, .tr-sig-grid, .ch-split, .ch-split-reverse {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Section titles */
  .section-title { font-size: clamp(28px, 8vw, 40px); line-height: 1.1; }
  .section-title br { display: none; }
  .section-sub { font-size: 14px; margin-bottom: 40px; }

  /* Hero titles scale */
  .tr-title, .ch-title, .uni-title, .aca-title, .net-title {
    font-size: clamp(34px, 9vw, 48px);
  }
  .cont-title, .news-title, .gloss-title {
    font-size: clamp(34px, 10vw, 48px);
  }

  /* Stats strips stack */
  .stats-strip {
    flex-direction: column;
    gap: 20px;
  }
  .stat-block {
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding-bottom: 20px;
  }
  .stat-block:last-child { border-bottom: none; }
  .stat-sep { display: none; }

  .uni-stats-strip {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 24px;
  }
  .uni-stat + .uni-stat {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.06);
    padding-top: 24px;
  }

  /* Footer */
  .footer-bottom {
    flex-direction: column;
    gap: 14px;
    text-align: center;
    align-items: center;
  }
  .footer-legal { justify-content: center; flex-wrap: wrap; }
  .footer-badges { justify-content: center; }

  /* Banner */
  .banner-wrap { padding: 48px 24px; }
  .banner-title { font-size: clamp(26px, 7vw, 36px); }
  .banner-sub { font-size: 13px; }

  /* Pipeline (chat CRM) — too wide, scroll horizontally on mobile */
  .ch-pipeline {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .ch-pipeline-col {
    flex: 0 0 75%;
    min-width: 240px;
    scroll-snap-align: start;
  }

  /* Timelines reduce size */
  .tr-steps, .uni-method, .aca-timeline, .net-steps {
    max-width: 100%;
  }
  .uni-method-item, .aca-step, .net-step {
    grid-template-columns: 44px 1fr;
    gap: 16px;
  }
  .uni-method-num, .aca-step-num, .net-step-num {
    width: 44px; height: 44px; font-size: 13px;
  }
  .uni-method::before, .aca-timeline::before, .net-steps::before {
    left: 22px;
  }

  /* Compare (chat) */
  .ch-compare {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ch-compare::before { display: none; }

  /* Quality classes */
  .ch-score { margin: 0 auto; }
  .ch-score-ring { width: 180px; height: 180px; }

  /* Form layouts */
  .net-form, .cont-form {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .net-form-wrap, .cont-form-wrap {
    padding: 40px 24px;
  }

  /* News filter pills — horizontal scroll instead of wrap */
  .news-filter-inner {
    padding: 0 20px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }
  .news-filter-inner::-webkit-scrollbar { display: none; }
  .news-pill { flex-shrink: 0; }

  /* Featured post stacks */
  .news-featured {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 24px;
  }

  /* Glossário alphabet */
  .gloss-alphabet {
    gap: 2px;
    padding: 5px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .gloss-letter-btn { flex-shrink: 0; width: 32px; height: 32px; font-size: 11px; }
  .gloss-section-head { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Logo marquee smaller */
  .ch-marquee-item { width: 180px; height: 110px; padding: 0 24px; }
  .ch-marquee-item img { max-height: 72px; }

  /* Footer badges smaller */
  .footer-badge-img { height: 78px; }

  /* Contato quick cards stack */
  .cont-quick-card { padding: 32px 24px 28px; }
  .cont-quick-wa { position: static; margin-bottom: 14px; display: inline-flex; }

  /* Academy/Network plans */
  .aca-plan, .ch-plan, .tr-plan-card {
    padding: 32px 24px 28px;
  }
  .aca-plan-price-val, .ch-plan-price-val, .tr-price-val {
    font-size: 38px;
  }

  /* Chat benefits / features grids */
  .ch-benefit, .uni-feat, .aca-benefit, .net-benefit {
    padding: 28px 22px 24px;
  }

  /* Tracking dashboard card */
  .tr-dashboard { padding: 16px; }
  .tr-dash-metrics { grid-template-columns: 1fr; }

  /* Chat phone / simulation */
  .ch-phone-body, .ch-sim { padding: 16px; }

  /* Any hero mock-up cards — prevent overflow */
  .ch-inbox, .uni-progress-card, .aca-platform,
  .net-commission, .tr-dashboard {
    max-width: 100%;
  }

  /* Network form — full width */
  .net-form .field.full,
  .net-form .field { grid-column: 1 / -1; }
}

/* --- 480 and below: phones — edges tight, buttons full width --- */
@media (max-width: 480px) {
  .container,
  .gloss-container,
  .cont-container,
  .news-container { padding-left: 16px; padding-right: 16px; }

  .tr-hero-inner, .ch-hero-inner, .uni-hero-inner,
  .aca-hero-inner, .net-hero-inner {
    padding: 100px 16px 56px;
  }

  /* Section titles — extra compact */
  .section-title { font-size: 30px; }
  .tr-title, .ch-title, .uni-title, .aca-title, .net-title,
  .cont-title, .news-title, .gloss-title { font-size: 34px; }

  /* Buttons stretch full width */
  .btn-whatsapp,
  .btn-secondary,
  .tr-hero-ctas a,
  .ch-hero-ctas a,
  .uni-hero-ctas a,
  .aca-hero-ctas a,
  .net-hero-ctas a,
  .banner-ctas a {
    width: 100%;
    justify-content: center;
  }
  .tr-hero-ctas, .ch-hero-ctas, .uni-hero-ctas, .aca-hero-ctas, .net-hero-ctas,
  .banner-ctas {
    flex-direction: column;
    align-items: stretch;
  }

  /* Quality score ring shrinks */
  .ch-score-ring { width: 160px; height: 160px; }
  .ch-score-grade { font-size: 52px; }

  /* Reduce float-around mockups */
  .ch-phone-head { padding: 12px 14px; }
  .ch-phone-avatar { width: 28px; height: 28px; }

  /* Hide scroll hint on tiny screens — less noise */
  .tr-scroll-hint, .ch-scroll-hint, .uni-scroll-hint,
  .aca-scroll-hint, .net-scroll-hint { display: none; }

  /* Newsletter compact */
  .news-newsletter-form { flex-direction: column; }
  .news-newsletter-form button { padding: 12px; }

  /* Logo marquee minimum */
  .ch-marquee-item { width: 150px; height: 96px; padding: 0 18px; }
  .ch-marquee-item img { max-height: 60px; }

  /* Footer badges */
  .footer-badge-img { height: 64px; }

  /* Eyebrow / tag labels compact */
  .section-eyebrow { font-size: 9.5px; letter-spacing: .22em; }

  /* Inbox hero items — tighten */
  .ch-inbox-row { padding: 10px 14px; gap: 10px; }
  .ch-inbox-info strong { font-size: 12px; }

  /* University progress card */
  .uni-pc-body { padding: 18px 16px; }
  .uni-pc-score strong { font-size: 32px; }

  /* Academy platform card */
  .aca-plat-body { padding: 14px; }

  /* Net commission card */
  .net-com-val { font-size: 36px; }
}

/* --- Prevent horizontal overflow site-wide --- */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
img { max-width: 100%; height: auto; }
svg { max-width: 100%; }

/* Smooth tap highlight on mobile */
a, button { -webkit-tap-highlight-color: rgba(0,204,255,.15); }
