/* ===== 328: new-booking form on phones - one column, full-width fields, dresses stacked =====
   329: cancel/return window on phones - same treatment, same scoping.
   Scoped to those two modals and to phone/tablet widths only.
   Desktop layout is untouched. */

@media (max-width: 768px) {

  /* ---- modal fills the phone width ---- */
  #reservation-form-modal .modal-box,
  #return-form-modal .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  #reservation-form-modal .modal-body,
  #return-form-modal .modal-body { padding: 10px !important; }

  /* ---- top fields: one under the other, each full width ---- */
  #reservation-form-body .r316-shared,
  #reservation-form-body .r316-rows,
  #return-form-body .r316-shared,
  #return-form-body .r316-rows {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #reservation-form-body .input-group,
  #return-form-body .input-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
  }
  #reservation-form-body .input-group > label,
  #return-form-body .input-group > label {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 4px !important;
  }
  #reservation-form-body .input-group > input:not([type="hidden"]),
  #reservation-form-body .input-group > select,
  #reservation-form-body .input-group > textarea,
  #return-form-body .input-group > input:not([type="hidden"]),
  #return-form-body .input-group > select,
  #return-form-body .input-group > textarea {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #reservation-form-body .input-group > div,
  #return-form-body .input-group > div {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* ---- dresses: stacked, each full width ---- */
  #reservation-form-body .r316-grid,
  #return-form-body .r316-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }
  #reservation-form-body .r316-item,
  #return-form-body .r316-item {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #reservation-form-body .r316-item-title,
  #reservation-form-body .r316-img-wrap,
  #reservation-form-body .r316-code,
  #reservation-form-body .r316-busy,
  #return-form-body .r316-item-title,
  #return-form-body .r316-img-wrap,
  #return-form-body .r316-code,
  #return-form-body .r316-busy {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* ---- dress field rows: label on one side, wide input on the other ---- */
  #reservation-form-body .r316-frow,
  #return-form-body .r316-frow {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  #reservation-form-body .r316-frow > label,
  #return-form-body .r316-frow > label {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }
  #reservation-form-body .r316-frow > input,
  #return-form-body .r316-frow > input {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* ---- payment: three wide buttons, text on one line ---- */
  #reservation-form-body .payment-icons,
  #return-form-body .payment-icons {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
  }
  #reservation-form-body .payment-option,
  #return-form-body .payment-option {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 46px !important;
    gap: 8px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  #reservation-form-body .payment-option .pay-logo,
  #return-form-body .payment-option .pay-logo { flex: 0 0 auto !important; }
}
