/* Mobile layout overrides for direct booking */

@media (max-width: 720px) {
  .page {
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .hero {
    margin-bottom: 12px;
    gap: 8px;
  }

  .brand img {
    width: min(190px, 62vw);
  }

  .pill,
  .title,
  .subtitle {
    display: none;
  }

  .card {
    padding: 16px;
    border-radius: 20px;
  }

  .notice-banner {
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .notice-title {
    font-size: 13px;
  }

  .notice-sub {
    font-size: 12px;
  }

  .scroll-tip {
    margin-top: 8px;
    font-size: 12px;
  }

  .top-row {
    gap: 12px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    justify-items: stretch;
  }

  .meta-row:nth-child(2) {
    display: none;
  }

  .meta-row {
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(200, 167, 74, 0.14);
    background: rgba(255, 255, 255, 0.78);
  }

  .section {
    margin-top: 14px;
  }

  .stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    justify-items: stretch;
  }

  .step {
    width: 100%;
    text-align: center;
    border-radius: 14px;
    padding: 10px 8px;
    font-size: 12px;
  }

  .step.active {
    border-color: rgba(200, 167, 74, 0.65);
    background: linear-gradient(180deg, #fdf6c9, #d4b03f);
    box-shadow: 0 12px 26px rgba(200, 167, 74, 0.22);
  }

  .date-nav {
    display: none;
  }

  .date-chip {
    min-width: 88px;
    padding: 12px 10px;
  }

  .time-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sticky-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-bar .btn {
    width: 100%;
    justify-content: center;
  }

  .choice-row {
    flex-direction: column;
    align-items: stretch;
  }

  .choice-row .btn {
    width: 100%;
    justify-content: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
  }

  .field {
    gap: 8px;
  }

  .pay-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pay-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Fullscreen flow overlay (prevents iOS layout jitter) */
  #db-flow-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    touch-action: none;
  }

  /* Avoid scale/translate on the full-screen flow card */
  #db-flow-overlay .overlay-card {
    transform: none;
  }

  #db-flow-overlay.show .overlay-card {
    transform: none;
  }

  .flow-card {
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    border-radius: 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    touch-action: pan-y;
    -webkit-overflow-scrolling: auto;
  }

  .flow-top {
    margin: -18px -18px 12px;
    padding: 12px 14px;
  }

  .field label {
    font-size: 13px;
  }

  .field input:not([type="checkbox"]):not([type="radio"]) {
    padding: 11px 12px;
    font-size: 16px;
  }

  /* Segmented DOB: keep as a single unified control on mobile */
  .segmented-input {
    min-height: 48px;
  }

  .segmented-input input:not([type="checkbox"]):not([type="radio"]) {
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none !important;
    padding: 0 10px;
    height: 48px;
    font-size: 16px;
  }

  .seg-sep {
    width: 16px;
  }

  #db-step-patient .form-grid,
  #db-step-payment .pay-box {
    width: min(520px, 100%);
    margin: 0 auto;
  }

  #db-step-patient,
  #db-step-payment {
    padding-bottom: 14px;
  }

  #db-step-patient .section-title {
    margin-bottom: 12px;
  }

  #db-patient-choice .choice-row {
    margin-top: 12px;
  }

  #db-patient-choice p.muted {
    margin-top: 12px !important;
    margin-bottom: 16px !important;
    line-height: 1.45;
  }

  #db-patient-pane > p.muted {
    margin-top: 14px !important;
    line-height: 1.45;
  }

  /* Center the Step 2 choice screen on phones */
  #db-step-patient.choice-center {
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
    margin-top: 0;
    min-height: 56svh;
  }

  #db-step-patient.choice-center .section-title {
    width: min(520px, 100%);
    text-align: center;
  }

  #db-step-patient.choice-center .choice-row {
    width: min(520px, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  #db-step-patient.choice-center p.muted {
    width: min(520px, 100%);
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
  }

  /* Marketing preferences: large tap targets */
  .gdpr {
    padding: 12px;
  }

  .gdpr label {
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(17, 17, 17, 0.12);
    background: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    touch-action: manipulation;
  }

  .gdpr-option {
    justify-content: space-between;
    gap: 14px;
  }

  .gdpr label input {
    transform: scale(1.3);
    transform-origin: center;
    margin: 0;
  }

  .gdpr-note {
    font-size: 13px;
    line-height: 1.35;
  }
}
