/* Naa Mart v1.9 RC9 — phone-first Farmer and Partner enquiry forms.
   Presentation only. Do not change Lead payloads, validations or CRM mappings.
   16px text controls prevent automatic iOS Safari zoom on focus. */

/* iOS auto-zooms when a focused input/select is below 16 CSS px. Keep this
   override for phones in landscape and tablets as well as portrait phones. */
@media (max-width: 1024px) {
  #naa-mart-site .nm-wizard input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  #naa-mart-site .nm-wizard select,
  #naa-mart-site .nm-wizard textarea,
  #naa-mart-site .nm-wizard .nm-crop-autocomplete .nm-crop-search {
    font-size: 16px !important;
    line-height: 1.35 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    -webkit-text-size-adjust: 100%;
  }
  #naa-mart-site .nm-wizard input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  #naa-mart-site .nm-wizard select,
  #naa-mart-site .nm-wizard .nm-crop-autocomplete .nm-crop-search {
    min-height: 46px !important;
  }
}

@media (max-width: 660px) {
  /* Open a real mobile form, not a scaled desktop popup. */
  #naa-mart-site .modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important; /* fallback for older iOS */
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
  }
  #naa-mart-site .modal .dialog.nm-wizard-dialog {
    display: block !important;
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scroll-padding-top: 104px;
  }
  /* The close button stays available while the farmer scrolls through a form. */
  #naa-mart-site .nm-wizard-head {
    position: sticky !important;
    top: -16px !important;
    z-index: 7 !important;
    background: #fff !important;
    padding-top: 16px !important;
    padding-bottom: 12px !important;
    margin-top: -16px !important;
    margin-bottom: 12px !important;
    gap: 12px !important;
  }
  #naa-mart-site .nm-wizard-brand { min-width: 0 !important; flex: 1 1 auto !important; }
  #naa-mart-site .nm-wizard-brand h3 { font-size: clamp(21px, 5.8vw, 25px) !important; line-height: 1.12 !important; }
  #naa-mart-site .nm-wizard-brand p { font-size: 12.5px !important; line-height: 1.42 !important; }
  #naa-mart-site .nm-stepper { gap: 8px !important; margin: 0 0 18px !important; }
  #naa-mart-site .nm-step-indicator { min-width: 0 !important; }
  #naa-mart-site .nm-step-indicator small { font-size: 10.5px !important; line-height: 1.25 !important; overflow-wrap: anywhere; }
  #naa-mart-site .nm-step-hint, #naa-mart-site .nm-step-note { font-size: 13px !important; line-height: 1.5 !important; }
  #naa-mart-site .nm-step h4 { font-size: 17px !important; }
  #naa-mart-site .nm-wizard label:not(.nm-image-tile):not(.nm-tick):not(.legal-consent) { font-size: 13px !important; }
  #naa-mart-site .nm-wizard .nm-location-grid,
  #naa-mart-site .nm-wizard .nm-contact-grid,
  #naa-mart-site .nm-wizard .nm-pin-row { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #naa-mart-site .nm-wizard .nm-pin-row { gap: 5px !important; }
  #naa-mart-site .nm-wizard .nm-location-grid > *,
  #naa-mart-site .nm-wizard .nm-contact-grid > *,
  #naa-mart-site .nm-conditional-crop,
  #naa-mart-site .nm-crop-autocomplete { min-width: 0 !important; max-width: 100% !important; }
  #naa-mart-site .nm-conditional-crop { padding: 13px !important; }
  #naa-mart-site .nm-crop-autocomplete { width: 100% !important; }
  #naa-mart-site .nm-crop-autocomplete .nm-crop-search { height: auto !important; }
  #naa-mart-site .nm-crop-suggestion { min-height: 46px; font-size: 15px; }
  #naa-mart-site .nm-tile-grid, #naa-mart-site .nm-partner-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #naa-mart-site .nm-crop-featured { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #naa-mart-site .nm-selected-crop-media { width: 76px; height: 68px; flex-basis: 76px; }
  #naa-mart-site .nm-form-actions .nm-back,
  #naa-mart-site .nm-form-actions .nm-next,
  #naa-mart-site .nm-form-actions .nm-submit { min-height: 44px !important; font-size: 14px !important; }
  #naa-mart-site .nm-form-actions { min-width: 0; }
  #naa-mart-site .nm-form-actions .nm-form-status { min-width: 0; overflow-wrap: break-word; }
}
