/* R108_AAA_BOOKING_MOBILE_LAYOUT_V127_CSS_ACTIVE */

@media (max-width: 760px) {
  html body .booking-modal {
    padding: 3px !important;
    overflow: hidden !important;
  }

  html body .booking-modal-dialog {
    width: calc(100vw - 6px) !important;
    max-width: 430px !important;
    max-height: calc(100dvh - 6px) !important;
    margin: 0 auto !important;
  }

  html body .booking-card {
    max-height: calc(100dvh - 6px) !important;
    padding: 8px 9px 10px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
  }

  html body .booking-title-row {
    min-height: 32px !important;
    margin-bottom: 5px !important;
    padding: 0 42px 4px 0 !important;
  }

  html body .booking-title-row h2 {
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
  }

  html body .booking-title-row > span {
    min-height: 27px !important;
    padding: 0 8px !important;
    font-size: 9.5px !important;
  }

  html body .booking-modal-close {
    top: 6px !important;
    right: 6px !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 20px !important;
  }

  html body .booking-form.form-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    column-gap: 6px !important;
    row-gap: 5px !important;
    align-items: end !important;
  }

  html body .booking-form > *,
  html body .booking-form label,
  html body .booking-form input,
  html body .booking-form select,
  html body .booking-form textarea {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* การ์ดบ้านพัก: ชื่อด้านซ้าย ปุ่มเปลี่ยนด้านขวา */
  html body .booking-selected-room {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 1px 7px !important;
    padding: 7px 8px !important;
    border-radius: 9px !important;
  }

  html body .booking-selected-room__label {
    grid-column: 1 !important;
    font-size: 9px !important;
  }

  html body .booking-selected-room__body {
    display: contents !important;
  }

  html body .booking-selected-room__body > div {
    grid-column: 1 !important;
  }

  html body .booking-selected-room strong {
    display: block !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }

  html body .booking-selected-room p {
    display: block !important;
    max-width: 220px !important;
    margin: 1px 0 0 !important;
    overflow: hidden !important;
    color: #64748b !important;
    font-size: 8.8px !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body .booking-selected-room small {
    display: none !important;
  }

  html body .booking-change-room-button {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    min-height: 31px !important;
    padding: 5px 8px !important;
    font-size: 9.5px !important;
    white-space: nowrap !important;
  }

  /* หัวข้อวันที่และปุ่มแนะนำอยู่แถวเดียวกัน */
  html body .booking-form .date-range-field {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 4px 7px !important;
    align-items: center !important;
    position: relative !important;
  }

  html body .date-range-field > span {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    font-size: 9.5px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  html body .booking-entry-hint {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: start !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 2px 7px 2px 3px !important;
    gap: 5px !important;
  }

  html body .booking-entry-hint-arrow {
    width: 22px !important;
    height: 22px !important;
    font-size: 16px !important;
  }

  html body .booking-entry-hint strong {
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  /* บังคับวันเข้า / คืน / วันออก เป็นหนึ่งแถวเสมอ */
  html body .booking-modal .date-range-trigger {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    min-height: 54px !important;
    height: 54px !important;
    padding: 5px 8px !important;
    overflow: hidden !important;
    text-align: left !important;
  }

  html body .booking-modal .date-range-cell {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  html body .booking-modal .date-range-cell.align-right {
    align-items: flex-end !important;
    text-align: right !important;
  }

  html body .booking-modal .date-range-caption {
    display: block !important;
    margin: 0 !important;
    font-size: 8px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
  }

  html body .booking-modal .date-range-trigger strong {
    display: block !important;
    max-width: 100% !important;
    margin: 2px 0 0 !important;
    overflow: hidden !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body .booking-modal .date-range-nights {
    display: inline-flex !important;
    position: static !important;
    width: 48px !important;
    min-width: 48px !important;
    min-height: 27px !important;
    margin: 0 !important;
    padding: 0 4px !important;
    align-items: center !important;
    justify-content: center !important;
    place-self: center !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
    text-align: center !important;
    transform: none !important;
    white-space: nowrap !important;
  }

  html body .date-range-field > input[type="hidden"] {
    display: none !important;
  }

  html body .date-range-popover {
    grid-column: 1 / -1 !important;
  }

  html body .booking-form .availability-status {
    grid-column: 1 / -1 !important;
    position: static !important;
    clear: both !important;
    min-height: 27px !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    font-size: 8.7px !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere !important;
  }

  /* ฟิลด์ข้อมูล: 2 คอลัมน์แบบอ่านง่าย */
  html body .booking-form label {
    display: grid !important;
    gap: 2px !important;
    margin: 0 !important;
  }

  html body .booking-form label > span,
  html body .booking-field-heading {
    min-height: 12px !important;
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1.15 !important;
  }

  html body .booking-form input,
  html body .booking-form select {
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 4px 7px !important;
    font-size: 11px !important;
  }

  html body .booking-extra-bed-field .booking-field-heading--with-hint {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  html body .booking-extra-bed-field small {
    display: block !important;
    min-width: 0 !important;
    max-width: 120px !important;
    overflow: hidden !important;
    font-size: 7.2px !important;
    line-height: 1.1 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body .booking-form .booking-capacity-status {
    grid-column: 1 / -1 !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    gap: 2px 5px !important;
  }

  html body .booking-capacity-status strong {
    font-size: 9.3px !important;
  }

  html body .booking-capacity-status span {
    font-size: 8px !important;
  }

  html body .booking-form .booking-price-summary {
    grid-column: 1 / -1 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px 5px !important;
    margin: 0 !important;
    padding: 6px 7px !important;
  }

  html body .booking-price-summary > div,
  html body .booking-price-summary .booking-price-grand {
    display: block !important;
    min-width: 0 !important;
  }

  html body .booking-price-summary span {
    display: block !important;
    margin: 0 0 1px !important;
    overflow: hidden !important;
    font-size: 7.8px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  html body .booking-price-summary strong,
  html body .booking-price-summary .booking-price-grand strong {
    display: block !important;
    font-size: 12px !important;
  }

  html body .booking-price-summary small {
    font-size: 7px !important;
  }

  html body .booking-message-compact > summary {
    min-height: 30px !important;
    padding: 5px 7px !important;
    font-size: 9px !important;
  }

  html body .booking-form > button[type="submit"] {
    min-height: 36px !important;
    height: 36px !important;
    font-size: 10.5px !important;
  }
}

@media (max-width: 350px) {
  html body .booking-card {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  html body .booking-modal .date-range-trigger {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr) !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  html body .booking-modal .date-range-nights {
    width: 42px !important;
    min-width: 42px !important;
    font-size: 8.8px !important;
  }

  html body .booking-selected-room p {
    max-width: 155px !important;
  }
}
