/* CFB24 — mobil nézet */

/* ===== Tablet és mobil (<= 900px) ===== */
@media (max-width: 900px) {
  :root {
    --space-24: 3.5rem;
    --space-20: 3rem;
    --space-16: 2.5rem;
  }

  /* ---- Fejléc ---- */
  header > div > nav, header .navcta { display: none !important; }
  header .navburger { display: inline-flex !important; }
  header > div { min-height: 62px !important; padding: 8px var(--space-8) !important; }

  /* ---- Container: szűkebb oldalmargó ---- */
  .container,
  [style*="max-width: var(--container)"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* ---- Rácsok egy hasábra ---- */
  .grid-3, .grid-4, .grid-5,
  [style*="grid-template-columns"]:not(.procgrid):not([style*="grid-template-columns: 78px"]):not([style*="grid-template-columns: 40px"]) {
    grid-template-columns: 1fr !important;
  }
  /* Stat rácsok kettő hasábban */
  .grid-5,
  [style*="grid-template-columns: repeat(4"]:not(.procgrid),
  [style*="grid-template-columns: repeat(5"]:not(.procgrid) {
    grid-template-columns: 1fr 1fr !important;
  }

  /* ---- Szöveg ---- */
  .text-balance, .h2-section,
  main [style*="text-wrap: balance"], main [style*="text-wrap: pretty"] { text-wrap: normal !important; }
  main h1, main h2, main h3, main p, main li, main a, main span { overflow-wrap: break-word; }
  main [style*="white-space: nowrap"]:not([style*="border-radius: var(--radius-pill)"]) { white-space: normal !important; }
  main [style*="display: flex"]:has(> [style*="border-radius: var(--radius-pill)"][style*="white-space: nowrap"]) { flex-wrap: wrap !important; }
  main [style*="min-width:"] { min-width: 0 !important; }
  main img { max-width: 100%; }
  .sticky-aside, main [style*="position: sticky"] { position: static !important; }
  main input, main select, main textarea { font-size: 16px !important; }

  /* Section header: egymás alá */
  .section-header,
  main [style*="align-items: flex-end"][style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }
  main [style*="justify-content: flex-end"] { justify-content: flex-start !important; }

  /* ---- Folyamat-ábrák ---- */
  .procgrid { grid-template-columns: 1fr !important; gap: 4px !important; }
  .procgrid > div, .proc-step {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 16px !important;
    padding: 12px 0 !important;
  }
  .procgrid > div > span:first-of-type { flex-shrink: 0; }
  .procgrid > div > div, .proc-label { text-align: left !important; max-width: none !important; padding-top: 8px; }
  [style*="left: 12.5%"], [style*="left: 12%"] { display: none !important; }

  /* ---- Lakossági folyamat ---- */
  .brow {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 20px 0 !important;
  }

  /* ---- Önkormányzati folyamat ---- */
  .mstep {
    grid-template-columns: 46px 1fr !important;
    gap: 14px !important;
    padding: 20px 0 !important;
    margin: 0 !important;
  }

  /* ---- Szolgáltatás-sorok ---- */
  .srow { display: block !important; padding-left: 0 !important; padding-right: 0 !important; }
  .srow > div:first-child, .srow .stile { display: none !important; }
  .srow .snum { display: block; margin-bottom: 6px; }
  .srow:nth-child(odd), .srow:nth-child(even), .rvx { transform: none !important; }

  /* ---- Főoldal kártyák ---- */
  [style*="168px"] { padding-bottom: 96px !important; }
  [style*="margin-top: -120px"] { margin-top: -56px !important; }

  /* ---- CTA grid ---- */
  .cta-grid { grid-template-columns: 1fr !important; }

  /* ---- Szélenergia ---- */
  .spin { animation: none !important; }
  main svg { max-width: 100%; height: auto; }

  /* ---- Modál és süti-sáv ---- */
  [role="dialog"]:not([aria-label="Menü"]) > div { max-height: 92vh !important; }
  [role="dialog"]:not([aria-label="Menü"]) > div > div { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="width: 400px"] {
    width: auto !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
  }
}

/* ===== Telefon (<= 560px) ===== */
@media (max-width: 560px) {
  .container,
  [style*="max-width: var(--container)"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  main [style*="padding: var(--space-9)"],
  main [style*="padding: var(--space-8)"] { padding: 20px !important; }
  [style*="grid-template-columns: 40px"] { font-size: 13px !important; }
  main [style*="border-radius: var(--radius-pill)"][style*="white-space: nowrap"]:not([style*="text-transform: uppercase"]) {
    width: 100% !important;
  }
}
