/*
 * Nauti Reservations — shared mobile styles v3
 * Injected via index.php <head> for ALL pages (main + inner/iframe).
 */

/* ═══════════════════════════════════════════════════════════════
   FULL HEIGHT
   ═══════════════════════════════════════════════════════════════ */
html {
  height: 100%;
  height: 100dvh;
}
body {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > .wrap,
body > .wrap--flush {
  flex: 1;
  min-height: 0;
}
body > .wrap .card,
body > .wrap--flush .card {
  min-height: 0;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL — applies to every page
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Prevent iOS auto-zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  input[type="url"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Minimum 44 × 44 px touch targets */
  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
  select,
  textarea {
    min-height: 44px;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  button, .btn, [role="button"] { min-height: 44px; }
  .btn { display: inline-flex !important; align-items: center; justify-content: center; }

  /* Tables scroll horizontally */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  th, td { white-space: nowrap; }

  /* Page padding */
  .wrap { padding: 10px 10px !important; }
  .wrap--flush { padding: 0 !important; }

  /* Small cards fill screen width */
  .card--sm { --card-max: 100% !important; margin: 0 !important; }

  /* Forms: full width on mobile */
  form[style*="max-width:320px"], form[style*="max-width: 320px"],
  form[style*="max-width:360px"], form[style*="max-width: 360px"],
  form[style*="max-width:480px"], form[style*="max-width: 480px"],
  form[style*="max-width:560px"], form[style*="max-width: 560px"],
  form[style*="max-width:600px"], form[style*="max-width: 600px"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Flex rows that hold buttons — allow wrap */
  div[style*="display:flex"][style*="gap:10px"],
  div[style*="display:flex"][style*="gap: 10px"] {
    flex-wrap: wrap;
  }

  /* Business list & admin dashboard iframes: fill screen, scroll freely */
  #biz-frame,
  #adm-frame {
    /* banner is now 56px on mobile */
    height: calc(100dvh - 56px) !important;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Calendar full height */
  #cal-wrap, .cal-outer {
    height: calc(100dvh - 56px) !important;
    min-height: 0;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  #biz-frame, #adm-frame {
    height: calc(100dvh - 52px) !important;
  }
  #cal-wrap, .cal-outer {
    height: calc(100dvh - 52px) !important;
  }
}
