/*
 * Wave 176: iPhone / Mobile UX Polish (390x844+)
 * Dedicated mobile-only responsive stylesheet across:
 *   - 3D Map & Personalized Claim/Checkout Modal (index.html)
 *   - Standalone Storefront (store.html)
 *   - 60-Second Order Intake (order-intake.html)
 *   - Founding 50 Pitch Sheet (founding-50.html)
 *   - Coming Soon Teaser (coming-soon.html)
 *
 * NOTE: Strictly avoids pill-shaped border radii; uses 10px rounded corners.
 */

@media (max-width: 768px) {
  html,
  body {
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* Eliminate 300ms iOS tap delay & prevent Safari auto-zoom on inputs */
  a,
  button,
  [role="button"],
  input,
  select,
  textarea,
  label {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(229, 190, 99, 0.18);
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Comfortable thumb tap targets (>= 44px) for all primary CTAs */
  .btn,
  .btn-quick,
  .btn-gold,
  .btn-primary,
  .cta,
  .cta-btn,
  .tier-cta,
  .f50-cta,
  .f50-btn,
  .hero-cta,
  .claim-cta,
  .upsell-btn,
  .store-buy-btn,
  .checkout-submit,
  button[type="submit"],
  a.btn,
  a.btn-quick,
  a.btn-gold {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.25;
    border-radius: 10px;
  }

  /* Reachable modal close buttons inside 390x844 viewport */
  .modal-close,
  .close-btn,
  .sc-close,
  .checkout-close,
  .drawer-close,
  button.close,
  [aria-label*="Close" i],
  [aria-label*="Dismiss" i] {
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
  }

  /* Checkout & Upsell Modal on iPhone */
  [role="dialog"],
  .shk-checkout-modal,
  .shk-checkout-dialog,
  #shk-checkout-modal {
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  /* 3D Map Mobile Shell */
  .center-top {
    max-width: calc(100vw - 16px);
    left: 8px;
    right: 8px;
  }

  #spotlight-card,
  .place-card-sheet {
    max-width: 100vw;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  /* Storefront & Order Intake Mobile Shell */
  body.shk-store-page .store-shell,
  body.shk-intake-page .intake-shell {
    padding: 14px 12px max(28px, env(safe-area-inset-bottom));
  }

  body.shk-store-page .store-topbar {
    padding: 12px 14px;
    gap: 10px;
  }

  body.shk-store-page .store-topbar a,
  body.shk-store-page .store-topbar button {
    min-height: 44px;
  }

  body.shk-store-page .store-grid,
  body.shk-store-page .catalog-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.shk-intake-page .intake-card {
    padding: 16px 14px;
  }

  /* Coming Soon Teaser Page Mobile Polish */
  .hero-actions,
  .quick-links,
  .ea-form,
  .cta-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .ea-form input[type="email"],
  .ea-form button[type="submit"] {
    width: 100%;
    min-height: 44px;
  }

  /* Founding 50 Pitch Sheet Mobile Polish */
  .container,
  .wrap,
  main,
  section {
    max-width: 100vw;
  }

  .tier-grid,
  .tiers-grid,
  .cards-grid,
  .realtor-grid {
    grid-template-columns: 1fr;
  }

  /* Wave 219: Waves 209-218 Mobile UX & Touch-Target Polish (390x844+) */
  .back-link,
  .card-link,
  .shk-co-call-btn,
  .svf-select,
  .svf-submit {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  .svf-select {
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 16px !important;
  }

  /* Public Notices Modal (390x844) */
  #shokker-public-notices-modal {
    padding: 8px;
  }
  .pn-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pn-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #101824;
  }
  .pn-body {
    overflow-y: visible;
  }
  .pn-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .pn-portal-link,
  .pn-tab,
  .pn-btn-fly,
  .pn-btn-ext {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .pn-search {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    min-height: 44px;
  }
  .pn-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  /* Explainer Cards Modal (390x844) */
  #shokker-explainer-cards-modal {
    padding: 8px;
  }
  .ec-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ec-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #101824;
  }
  .ec-body {
    overflow-y: visible;
  }
  .ec-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .ec-tab,
  .ec-btn-fly,
  .ec-btn-ext {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .ec-search {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    min-height: 44px;
  }
  .ec-trec-footer {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  /* Side-by-Side 3D Property Comparator Modal (390x844) */
  #shokker-compare-modal-backdrop {
    padding: 8px;
  }
  .shokker-cmp-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 14px;
  }
  .shokker-cmp-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .shokker-cmp-btn,
  .shokker-cmp-dock-btn,
  .shokker-cmp-dock-clear {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .shokker-cmp-trec-footer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}
