/* DMTA storefront — mobile layout overrides.
   Loaded AFTER site.css / header.css / the homepage inline <style>, so these
   rules win. Scope is deliberately limited to <=900px / <=768px / <=400px. */

/* Stop any element from widening the layout viewport. On iOS Safari a wider
   layout viewport makes the browser shrink the whole page, so text and cards
   look tiny even though their CSS widths are correct. */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, table { max-width: 100%; }

/* Phones and small tablets must never squeeze cards into narrow columns. */
@media (max-width: 900px) {
  .prod-grid, .machine-grid, .products-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  /* ── containers ── */
  .container, .page-hero-inner, .split-section, section,
  .brands-section { padding-left: 16px !important; padding-right: 16px !important; }
  .catalog-wrap { padding: 20px 14px 90px; gap: 16px; }

  /* ── header: keep the DMTA mark legible, trim wasted vertical space ── */
  .header-inner { --hp: 14px; gap: 10px; row-gap: 6px; padding: 9px var(--hp); min-height: 0; }
  .logo { gap: 9px; }
  .logo-img { width: 54px; height: 54px; }
  .logo-text .heading { font-size: 15.5px; letter-spacing: .6px; }
  .logo-text .tagline { font-size: 8.5px; letter-spacing: .4px; margin-top: 3px; }
  .pt-utils { gap: 1px; }
  .pt-util { padding: 5px 7px; }
  .pu-ic { font-size: 16px; }
  .pt-search { height: 40px; }
  .pt-search select { max-width: 104px; font-size: 11.5px; padding: 0 8px; }
  .pt-search input { font-size: 13px; padding: 0 10px; }
  .pt-search button { width: 44px; }

  /* nav: wrap into two fully visible rows instead of a cut-off scroll strip */
  header nav, header nav.main {
    flex-wrap: wrap; overflow-x: visible; gap: 8px 18px; margin-bottom: 0;
    width: calc(100% + var(--hp, 14px) * 2); padding: 6px var(--hp, 14px);
  }
  header nav a { font-size: 11.5px; letter-spacing: .6px; padding: 8px 0; }
  .nav-right { margin-left: 0; padding-left: 0; }

  /* ── homepage hero carousel ── */
  .hero { height: 430px; }
  .hero-content { padding: 20px 16px; }
  .hero h1 { font-size: 27px !important; line-height: 1.12; letter-spacing: .6px; margin-bottom: 14px; }
  .hero-desc { font-size: 14.5px !important; line-height: 1.55; margin-bottom: 22px; max-width: 100%; }
  .hero-buttons { gap: 10px; }
  .btn-primary, .btn-outline { padding: 12px 18px; font-size: 12.5px; }

  /* ── inner-page hero ── */
  .page-hero-inner { padding-top: 34px; padding-bottom: 38px; }
  .page-hero h1 { font-size: 29px; letter-spacing: .5px; }
  .page-hero p.lead { font-size: 14px; line-height: 1.55; margin-top: 10px; }
  .hero-stats { gap: 12px 20px; margin-top: 18px; }
  .hero-stat { font-size: 12px; gap: 7px; }
  .hero-stat i { font-size: 14px; }

  /* ── hero search: stack cleanly, remove the min-width overflow ── */
  .hero-search { margin-top: 20px; padding: 10px; gap: 8px; }
  .hero-search input[type="text"] { flex: 1 1 100%; min-width: 0; width: 100%; height: 46px; font-size: 14px; }
  .hero-search select { flex: 1 1 calc(50% - 4px); min-width: 0; width: auto; height: 46px; font-size: 13px; padding: 0 10px; }
  .hero-search button { flex: 1 1 100%; height: 46px; justify-content: center; font-size: 13px; }

  /* ── brand logo wall: 11/6 columns made every logo tiny on a phone ── */
  .brands-section { padding-top: 30px; padding-bottom: 30px; }
  .brands-title { font-size: 12px; letter-spacing: 1.5px; margin-bottom: 20px; }
  .brands-title::before, .brands-title::after { width: 20px; margin: 0 8px; }
  .brand-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px; }
  .brand-item {
    min-height: 72px; padding: 10px; border-right: none;
    border: 1px solid #eeeae2; border-radius: 8px; background: #fff;
  }
  .brand-item img { max-height: 42px; }

  /* ── filters: compact so products are not pushed far down the page ── */
  .filters { gap: 10px; }
  .filter-card { padding: 13px; min-width: 0; }
  .filter-card h4 { font-size: 12px; margin-bottom: 8px; }
  .fcheck { font-size: 12.5px; padding: 4px 0; gap: 8px; }
  .fcheck .count { font-size: 10px; }
  .toolbar { padding: 10px 12px; gap: 8px; margin-bottom: 16px; }
  .toolbar select { margin-left: 0; height: 36px; font-size: 12px; }

  /* ── product cards ── */
  .prod-grid { gap: 14px; }
  .prod-img { height: 180px; }
  .prod-body { padding: 14px; }
  .prod-body h4 { font-size: 16px; }
  .prod-cat { font-size: 10px; letter-spacing: 1.2px; }
  .prod-pn { font-size: 11.5px; }
  .prod-actions { gap: 8px; }
  .prod-actions button { flex: 1 1 0; min-width: 0; font-size: 12px; padding: 11px 6px; }

  /* floating inquiry button must not cover the card action buttons */
  .inq-fab { right: 12px; bottom: 12px; padding: 11px 16px; font-size: 12px; letter-spacing: .4px; }
  body { padding-bottom: 64px; }

  /* ── misc ── */
  .modal-mask { padding: 12px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 400px) {
  .logo-img { width: 48px; height: 48px; }
  .logo-text .heading { font-size: 14px; }
  .brand-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .hero h1 { font-size: 24px !important; }
  .page-hero h1 { font-size: 26px; }
}

/* Hot Sell was a fixed 4-column grid: on a phone each card shrank to ~70px
   and its two side-by-side buttons were pushed off-screen (right=457px). */
@media (max-width: 768px) {
  .hotsell-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hotsell-info { padding: 12px 12px 14px; }
  .hotsell-info h4 { font-size: 13px; }
  .hotsell-info p { font-size: 11px; }
  .hotsell-meta { font-size: 10px; gap: 4px; }
  .hotsell-actions { flex-wrap: wrap; gap: 6px; }
  .hotsell-btn { flex: 1 1 100%; min-width: 0; font-size: 10.5px; letter-spacing: .5px; padding: 10px 6px; }
}
@media (max-width: 400px) {
  .hotsell-btn { font-size: 10px; padding: 9px 4px; }
}
