/* VMD Supply — shared mobile refinements
   Keep the desktop design intact; apply only below the tablet breakpoint. */

@media (max-width: 767px) {
  html, body {
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  img, video, canvas, svg {
    max-width: 100%;
  }

  /* Prevent iOS Safari from zooming into form fields. */
  input, select, textarea, button {
    font-size: 16px;
  }

  /* A compact, consistent header on narrow screens. */
  header#navbar {
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
  }

  header#navbar > div.flex {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  header#navbar > div.flex > a {
    padding-left: 0 !important;
    min-width: 0;
  }

  header#navbar > div.flex > a img {
    max-width: min(58vw, 220px);
    height: auto;
    max-height: 3.25rem;
  }

  #menu-button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border-radius: 8px;
    touch-action: manipulation;
  }

  #menu-button:focus-visible,
  #mobile-menu a:focus-visible {
    outline: 2px solid #C8102E;
    outline-offset: 4px;
  }

  #mobile-menu {
    width: 100%;
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #mobile-menu:not(.hidden) {
    display: block;
  }

  #mobile-menu nav {
    gap: 0.25rem;
    padding: 0.75rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
    letter-spacing: 0.18em;
  }

  #mobile-menu nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.65rem 0;
    line-height: 1.35;
  }

  /* The centered-logo pages use a taller desktop header; reduce it on phones. */
  header#navbar #nav-logo {
    height: 64px !important;
    max-height: 64px;
    width: auto;
  }

  #header-spacer {
    height: 142px !important;
  }

  /* Keep large editorial headings readable without horizontal clipping. */
  h1 {
    font-size: clamp(2rem, 8.2vw, 3rem) !important;
    line-height: 1.12 !important;
    letter-spacing: 0.04em !important;
    overflow-wrap: anywhere;
  }

  h2 {
    font-size: clamp(1.65rem, 6.5vw, 2.45rem) !important;
    line-height: 1.18 !important;
    overflow-wrap: anywhere;
  }

  h3 {
    overflow-wrap: anywhere;
  }

  /* Avoid narrow-screen layouts being squeezed by wide utility padding. */
  main, footer {
    min-width: 0;
  }

  footer .max-w-7xl,
  footer .max-w-6xl {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Keep product and cart controls easy to reach. */
  #qty, #checkout-button, #pay-button {
    min-height: 44px;
  }

}

/* Respect users who prefer reduced motion on every screen size. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
