/* NAIA — phones and the home-screen app (4 Nov 2026).

   Loaded last in <head> on every public page, result.html included, so these
   rules win over the page's own styles at equal specificity. Desktop is not
   touched: everything sits behind a phone-width or touch-only media query,
   apart from two fixes that are wrong at any width (marked). Findings from a
   375 px walk-through of naia.care after it became installable (Miguel:
   "make sure everything looks good on a phone screen and makes sense
   scrolling and looking around"). */

/* iOS enlarges text in landscape unless told not to. Any width. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* The early-access field could not shrink: a text input keeps a built-in
   minimum width, so on a phone the button was pushed out past the form and
   the screen edge (cut off at x=375). Any width. */
.email-form input { min-width: 0; }

@media (max-width: 900px) {
  /* iPhone zooms the whole page in when a field under 16 px gets focus, and
     in the home-screen app it stays zoomed. Every text field on the site was
     14–15 px (search, filters, refine, contact, My NAIA, early access). */
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  textarea, select { font-size: 16px !important; }

  /* Tap targets: a finger needs about 44 px. The menu button was 26 px; the
     lines stay exactly where they were. */
  .nav-burger { width: 44px; height: 44px; right: 7px; padding: 0 11px 0 0; }

  /* The open menu scrolls on its own when the screen is short (on a 667 px
     iPhone SE the language buttons sat below the screen, out of reach), and
     the page behind it stays still (nav.js sets html.nav-open). */
  .mobile-menu { max-height: calc(100vh - var(--nav-h)); max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain; }
  html.nav-open, html.nav-open body { overflow: hidden; }

  /* Homepage search: Upload, Filter and Find look were 28 px tall. */
  .search-actions .upload-trigger, .search-actions .filter-btn, .search-actions .find-look { min-height: 40px; }
  /* Recent searches under the box (my-naia.js styles them at runtime). */
  a.me-recent-chip { padding-top: 9px; padding-bottom: 9px; }

  /* Filter drawer and styling note: 100vh is taller than what Safari shows
     while its toolbar is up, which put Apply below the screen. dvh is the
     visible height. The buttons also clear the iPhone's home bar. */
  .filter-drawer, .note-panel { height: 100vh; height: 100dvh; }
  .fd-foot { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .fd-close { width: 44px; height: 44px; margin: -4px; }

  .cookie-banner { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

  /* Result page: row arrows, Find all, Back to search, the photo buttons. */
  .carousel-nav button { width: 40px; height: 40px; }
  .find-all { padding: 13px 16px; }
  .back-link { padding: 12px 0; margin: -12px 0; }
  .product-more-pill { padding: 9px 13px; }
  .piece-vote button { width: 36px; height: 36px; }

  /* Brands: 900 names on one page (~31,000 px on a phone) and the A–Z only at
     the top. On a phone the letters become one strip under the header that
     stays in view and swipes sideways, so any letter is one tap away. */
  .brands-index {
    position: sticky; top: var(--nav-h); z-index: 50;
    flex-wrap: nowrap; justify-content: flex-start; gap: 0;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    margin: 20px -20px 28px; padding: 4px 12px;
    background: rgba(245, 243, 241, 0.97);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .brands-index::-webkit-scrollbar { display: none; }
  .brands-index a, .brands-index span { flex: 0 0 auto; padding: 12px 10px; }
  .brands-group { scroll-margin-top: calc(var(--nav-h) + 64px); }
}

/* Phones: the early-access form stacks — the address on one line, the button
   full width under it — instead of squeezing both into one pill. */
@media (max-width: 480px) {
  .email-form { flex-direction: column; gap: 10px; padding: 0; border: 0; border-radius: 0; background: none; }
  .email-form:focus-within { box-shadow: none; }
  .email-form input { flex: none; width: 100%; background: var(--white); border: 1px solid var(--border); border-radius: 100px; padding: 14px 22px; }
  .email-form input:focus { border-color: var(--charcoal); }
  .email-form .btn-pill-dark { width: 100%; justify-content: center; padding: 15px 18px; }
}

/* No hover on a touchscreen: the swap button on a photo was 26 px. */
@media (hover: none) {
  .product-swap { width: 34px; height: 34px; }
}
