/* ──────────────────────────────────────────────────────────────────
   SCC Mobile Fixes — universal mobile UX patches that apply
   site-wide. Loaded after the page's main stylesheet so these rules
   override page-specific styling where needed.

   Goals:
   1. Prevent iOS auto-zoom on input focus (16px font minimum)
   2. Ensure tap targets are at least 44px tall on mobile
   3. Make form submit buttons full-width on mobile
   4. Improve touch feedback (no 300ms tap delay, kill highlight haze)
   5. Tighten footer spacing and tap targets on mobile site-wide
   ────────────────────────────────────────────────────────────────── */

/* Kill the 300ms tap delay and the gray highlight that appears when
   tapping links/buttons on iOS. */
* { -webkit-tap-highlight-color: transparent; }
a, button, input[type="submit"], input[type="button"], select {
  touch-action: manipulation;
}

/* Inputs need to be at least 16px on iOS to prevent the page from
   zooming in when the user taps the field. This is a Safari quirk that
   has nothing to do with accessibility — it's purely mechanical. */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Inputs and textareas should be at least 44px tall for easy tapping.
     The line-height and padding combo on most of our forms gets us
     close, but this enforces the floor. */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  select {
    min-height: 44px;
  }

  /* Form submit buttons go full-width and tall on mobile. The selector
     covers our common patterns (form-submit, btn-gold inside forms,
     contact form buttons). */
  form button[type="submit"],
  form .btn-gold,
  form .btn-dark,
  form .form-submit {
    width: 100%;
    min-height: 48px;
  }

  /* Catch-all: any button under 44px on mobile gets bumped. The
     `:not()` selectors exempt elements that are intentionally compact
     (qty steppers, nav arrows, badge controls) where a smaller size
     is part of the design. */
  button:not(.qty-stepper button):not(.thumb):not(.lightbox-thumb):not(.lightbox-close):not(.lightbox-nav):not(.cart-drawer-close):not(.mobile-nav-close):not(.cart-item-remove):not(.filter-pill):not(.sub-filter-chip):not(.page-btn) {
    min-height: 44px;
  }

  /* Filter pills and chips on shop.html: bump tap area without making
     the visual size huge. Padding handles the visual; min-height
     handles the actual tap target. */
  .filter-pill,
  .sub-filter-chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* Page numbers on pagination: also need a reliable tap area. */
  .page-btn {
    min-height: 40px;
    min-width: 40px;
  }

  /* ──────────────────────────────────────────────────────────────
     Footer fixes — universal across every page on mobile.

     The per-page CSS sets `footer { margin-top: 6rem }` for desktop
     breathing room, and most preceding sections also have heavy
     bottom padding (5-7rem). Stacked on mobile, this creates a huge
     empty cream gap above the footer plus a visible white "band"
     where the section background ends and the footer background
     begins. These rules override that for screens 768px and below.
     ────────────────────────────────────────────────────────────── */
  footer {
    margin-top: 0 !important;
    padding: 2.25rem 1.5rem 2rem !important;
    gap: 1rem !important;
  }
  footer img {
    height: 36px !important;
  }
  .footer-links {
    gap: 1.5rem !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-links a, .footer-links button {
    padding: 0.6rem 0.4rem !important;
    font-size: 0.72rem !important;
    display: inline-block;
  }
  .footer-copy {
    margin-top: 1rem !important;
    padding-top: 1.25rem !important;
    font-size: 0.75rem !important;
    line-height: 1.6 !important;
  }
  .footer-founder {
    margin-top: 0.5rem !important;
    font-size: 0.62rem !important;
  }

  /* Tighten the bottom padding of common section containers that
     immediately precede the footer, so the empty gap above the
     footer disappears. Targets the patterns used across all 7 pages.
     Selector list reflects the actual classes used on each page. */
  .carries,
  .contact-section,
  .submit-section,
  .details-section,
  .related,
  main.shop,
  main.product,
  main.cart-page,
  .review-note {
    padding-bottom: 3.5rem !important;
  }
}

/* iOS safe-area for any fixed-position elements that hit the bottom
   of the screen. Cart drawer footer already handles its own spacing,
   but this is a fallback for anything that gets added later. */
@supports (padding: env(safe-area-inset-bottom)) {
  .nav-cart, .nav-hamburger { -webkit-tap-highlight-color: transparent; }
}
