/* svc-mobile-fixes.css — mobile defects found by the 16-page QA crawl (22.07.2026).
   Loaded on service templates + prototyping-kyiv. */

@media (max-width: 782px) {

  /* ── Wide tables ───────────────────────────────────────────────────────────
     A global rule sets `table{display:block;width:100%}` under 768px. A block
     table keeps its box at 100% while the rows lay out at their intrinsic width
     and paint OUTSIDE it, so the wrapper measures scrollWidth == clientWidth,
     never shows a scrollbar, and whole columns become unreachable
     (fdm lost "Застосування", scanning lost "Тип задач").
     Restore a real table and let the existing wrapper do the scrolling. */
  body .svc-article table,
  body .svc-inner table,
  body .entry-content table {
    display: table;
    width: auto;
    min-width: max-content;
    max-width: none;
    overflow: visible;
  }
  /* 2-column label/value tables fit without scrolling — let them wrap instead */
  body .svc-article table:not(:has(tr > *:nth-child(3))),
  body .entry-content table:not(:has(tr > *:nth-child(3))) {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  body .svc-article table:not(:has(tr > *:nth-child(3))) td,
  body .svc-article table:not(:has(tr > *:nth-child(3))) th {
    word-break: break-word;
    hyphens: auto;
  }

  /* The wrapper becomes the scroller and shows edge shadows, because touch
     devices render no scrollbar — without a hint the table just looks cut off. */
  .svc-article div:has(> table),
  .entry-content div:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left center,
      linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 70%) right center,
      radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, .16), rgba(15, 23, 42, 0)) left center,
      radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, .16), rgba(15, 23, 42, 0)) right center;
    background-repeat: no-repeat;
    background-size: 30px 100%, 30px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
  }

  /* ── Inline-styled card grids in page content ──────────────────────────────
     The key-fact strips are plain <div style="display:grid"> with fixed column
     counts, so on fdm cards 3 and 4 ("мінімальне замовлення", "термін
     виготовлення") rendered past the right edge and were invisible. */
  .svc-article div[style*="grid-template-columns"],
  .entry-content div[style*="grid-template-columns"] {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  }
  .svc-article div[style*="grid-template-columns"] > *,
  .entry-content div[style*="grid-template-columns"] > * {
    min-width: 0;
  }

  /* ── Breadcrumbs ───────────────────────────────────────────────────────────
     A long final crumb wrapped to two lines and, being baseline-aligned, printed
     its first line ABOVE the parent crumbs (seen on sls-3d-print). */
  .svc-hero .svc-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 2px 6px;
  }
  .svc-hero .svc-crumb > * { vertical-align: top; }
}

/* ── Quote modal honeypot ────────────────────────────────────────────────────
   It sat in normal flow at full width with a left offset, pushing the dialog
   15px wider than its own box, so the open modal scrolled sideways. */
.dp3-sq-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ── prototyping-kyiv (5735) prints its title twice ──────────────────────────
   It sits on the default template, which outputs .entry-header .page-title,
   while the content ships its own styled hero with the same H1. Two H1s with
   identical text; keep the styled one. */
body.page-id-5735 .entry-header .page-title { display: none; }

/* ── post-processing sticky header ───────────────────────────────────────────
   The logo anchor (logo + pipe + partner badge) and the phone link overlapped
   on phones — digits painted across the Formlabs badge, both unreadable. */
@media (max-width: 782px) {
  .fl-nav .fl-shell.fl-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: nowrap;
  }
  .fl-nav .fl-logo { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
  .fl-nav .fl-logo > img:first-child { max-height: 24px; width: auto; flex: 0 0 auto; }
  .fl-nav .fl-ap-badge { max-height: 20px; width: auto; flex: 0 1 auto; min-width: 0; }
  .fl-nav .fl-logo .pipe { flex: 0 0 auto; }
  .fl-nav a.ghost { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 560px) {
  /* no room for the trust badge next to logo + phone — it returns above 560px */
  .fl-nav .fl-ap-badge, .fl-nav .fl-logo .pipe { display: none; }
}
