/* =========================================================
   Mobile / app-feel refinements (loaded last on every page)
   ========================================================= */

/* ---- app feel ---- */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; overflow-x: clip; width: 100%; }
body { overflow-x: clip; width: 100%; max-width: 100%; margin: 0; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
.drawer { overflow: hidden; }
.drawer:not(.is-open) { visibility: hidden; }
.drawer.is-open { visibility: visible; }
body { -webkit-font-smoothing: antialiased; }
a, button { touch-action: manipulation; }
img { -webkit-user-drag: none; user-select: none; }
input, textarea, select { font-size: 16px !important; }              /* prevents iOS zoom on focus */
.appbar { padding-top: env(safe-area-inset-top); height: calc(var(--appbar-h) + env(safe-area-inset-top)); }
.subnav { top: calc(var(--appbar-h) + env(safe-area-inset-top)); }
.container { padding-inline: var(--gutter); }
:root { --gutter: max(16px, env(safe-area-inset-left)); }
/* full-bleed horizontal scrollers must use the same gutter as .container */
.scroller, .formats, .fmt__row { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.drawer { contain: paint; }
::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }
@media (min-width: 900px) { * { scrollbar-width: auto; } ::-webkit-scrollbar { width: 10px; height: 10px; } :root { --gutter: 20px; } .scroller, .formats, .fmt__row { margin-inline: 0; padding-inline: 0; } }

/* ---- theme toggle: header on desktop, inside menu on mobile ---- */
.theme-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--dark-line); color: #fff; font-size: 1.05rem; font-weight: 600; text-align: left; }
.theme-row__ico { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.theme-row__ico svg { width: 20px; height: 20px; }
.theme-row__label { flex: 1; }
.theme-row__switch { width: 44px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.18); position: relative; transition: background .2s; }
.theme-row__switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
:root[data-theme="dark"] .theme-row__switch { background: var(--accent); }
:root[data-theme="dark"] .theme-row__switch i { transform: translateX(18px); }
@media (max-width: 899px) { .appbar .theme-toggle { display: none; } }
@media (min-width: 900px) { .theme-row { display: none; } .drawer__label + .theme-row { display: none; } }

/* ---- press feedback on tappable cards ---- */
@media (hover: none) {
  .bcard:active, .mcard:active, .pcard:active, .solution:active, .industry:active, .ind-card:active, .fmt:active,
  .accstrip__i:active, .quick__tile:active, .download:active, .contact-list a:active, .acc-item:active, .model:active { transform: scale(.985); transition: transform .08s; }
  .bcard:hover, .pcard:hover, .solution:hover { transform: none; box-shadow: var(--shadow); }
}

/* ---- sticky bottom action bar (product / category pages) ---- */
.stickybar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 55; display: flex; gap: 8px; padding: 8px 12px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.stickybar .btn { flex: 1; min-height: 44px; font-size: .88rem; padding: 0 12px; }
.stickybar .btn--ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
body.has-stickybar { padding-bottom: calc(var(--tabbar-h) + 62px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .stickybar { display: none; } body.has-stickybar { padding-bottom: 0; } }

/* ---- small-screen layout fixes (< 900px) ---- */
@media (max-width: 899px) {
  h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  h2 { font-size: clamp(1.4rem, 5.5vw, 1.8rem); }
  .section { padding: 40px 0; }
  .section__head { margin-bottom: 20px; }
  .section__head--row { flex-direction: column; align-items: flex-start; }
  .section__head--row > .btn { align-self: flex-start; min-height: 40px; font-size: .85rem; }

  .appbar { gap: 8px; }
  .appbar .brand { padding: 3px 10px 3px 8px; }
  .brand__logo { height: 42px; }

  /* hero (home) */
  .h2hero { padding: 24px 0 20px; }
  .h2hero h1 { font-size: clamp(2.2rem, 11vw, 3rem); }
  .h2hero__cta .btn { flex: 1 1 100%; }
  .h2hero__chip { padding: 6px 10px; font-size: .7rem; }
  .h2hero__chip b { font-size: .88rem; }
  .h2hero__chip--3 { display: none; }

  /* page hero (inner) */
  .phero { padding: 22px 0 28px; }
  .phero__cta .btn { flex: 1 1 100%; }
  .phero__media { height: 200px; margin-top: 14px; }
  .keyspecs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* machine scroller: swipe instead of arrows */
  .scroller__nav { display: none; }
  #machines .section__head--row::after { content: "Swipe to see all →"; font-size: .78rem; color: var(--ink-3); }
  .mcard { flex-basis: 220px; }
  .mcard__img { height: 160px; }

  /* bento */
  .bcard { min-height: 0; }
  .bcard__img { min-height: 150px; }
  .bcard__img img { max-height: 190px; }
  .bcard--dark, .bcard--accent { min-height: 0; }

  /* trust band */
  .trust__stats { gap: 8px; }
  .trust__stats div { padding: 10px 8px; }
  .trust__stats b { font-size: 1.2rem; }
  .trust__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .trust__logo { height: 70px; padding: 8px; border-radius: 12px; }
  .trust__foot { flex-direction: column; align-items: flex-start; }
  .trust__badges img { height: 52px; }

  /* grids */
  .fmt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fmt { padding: 8px; border-radius: 12px; }
  .accstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .models { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .acc__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .acc-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pcard { grid-template-rows: 130px auto; }
  .pcard__body { padding: 10px; gap: 6px; }
  .pcard__body h3 { font-size: .92rem; }
  .pcard__body p, .pcard__ind { display: none; }
  .pcard__specs { grid-template-columns: 1fr; }
  .pcard__wave { top: 8px; left: 8px; font-size: .62rem; padding: 2px 7px; }
  .pcard__specs small { font-size: .6rem; }

  /* forms: stack fields */
  .form { padding: 16px; }
  .form__row { grid-template-columns: 1fr; gap: 12px; }
  .form__seg label { flex: 1 1 calc(50% - 4px); }
  .form__seg span { width: 100%; justify-content: center; }

  /* tables */
  .spec th { width: 42%; font-size: .82rem; padding: 10px 12px; }
  .spec td { font-size: .88rem; padding: 10px 12px; }
  .spec td small { font-size: .74rem; }

  /* cta band */
  .cta-band { padding: 32px 0; }
  .cta-band__actions .btn { flex: 1 1 100%; }

  /* enquiry card */
  .enq__card { padding: 22px 18px; border-radius: 20px; }

  /* footer */
  .footer { padding: 32px 0 20px; font-size: .85rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .footer__grid > div:first-child { grid-column: 1 / -1; }
  .footer__grid > div:last-child { grid-column: 1 / -1; }
  .footer__bar { font-size: .74rem; }

  /* tab bar: slight elevation */
  .tabbar { box-shadow: 0 -8px 24px rgba(19,26,46,.08); }
}

/* very small phones */
@media (max-width: 380px) {
  .trust__grid, .fmt-grid, .acc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust__stats { grid-template-columns: 1fr 1fr; }
  .trust__stats div:last-child { grid-column: 1 / -1; }
  .tabbar__item { font-size: .62rem; }
  .keyspecs { grid-template-columns: 1fr 1fr; }
}
