/* Modal shell */
#rb-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  font-family: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.rb-modal-open {
  overflow: hidden !important;
}

#rb-modal.is-open {
  display: block;
}

#rb-modal .rb-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

#rb-modal .rb-modal {
  position: relative;
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  background: #fff !important;
  color: #111;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#rb-modal .rb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: #fff !important;
}

#rb-modal .rb-modal-title {
  font-weight: 700;
  font-size: 16px;
}

#rb-modal .rb-modal-body {
  padding: 14px 16px 16px;
  background: #fff !important;
}

@media (max-width: 576px) {
  #rb-modal .rb-modal {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
  }
}

#rb-modal .rb-popup-info {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,.04);
  border-radius: 10px;
  line-height: 1.35;
}

#rb-modal label {
  display: block;
  font-weight: 600;
  margin: 10px 0 6px;
}

#rb-modal .rb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  background: #fff;
}

#rb-modal .rb-summary {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0,0,0,.04);
  border-radius: 10px;
  line-height: 1.35;
}

#rb-modal .rb-note {
  margin-top: 10px;
  font-size: 14px;
  opacity: .85;
}

#rb-modal .rb-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

#rb-modal .rb-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

#rb-modal .rb-btn-primary {
  background: #0182c6;
  color: #fff;
}

#rb-modal .rb-btn-secondary {
  background: rgba(0,0,0,.08);
  color: #111;
}

.rb-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  margin-left: 6px;
  font-weight: 600;
  font-size: 12px;
}

#rb-modal .rb-error,
.rb-error-message {
  background-color: lightpink;
  color: #8b0000;
  padding: 10px 12px;
  border: 1px solid #f3a6b4;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
}

#rb-modal .rb-error strong,
.rb-error-message strong {
  color: #6f0000;
}

#rb-error-container {
  margin-bottom: 10px;
}

#rb-modal #rb-date-grid {
  display: block;
}

/* =========================
   RentalBooking - mobile popup usability fix
   Keeps the validate button visible above mobile browser toolbars.
========================= */
@supports (height: 100dvh) {
  @media (max-width: 768px) {
    #rb-modal.is-open {
      overflow: hidden;
      padding: 8px;
      box-sizing: border-box;
    }

    #rb-modal .rb-modal-backdrop {
      position: fixed;
    }

    #rb-modal .rb-modal {
      width: 100%;
      height: calc(100dvh - 16px);
      max-height: calc(100dvh - 16px);
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border-radius: 12px;
    }

    #rb-modal .rb-modal-header {
      flex: 0 0 auto;
      position: sticky;
      top: 0;
      z-index: 3;
    }

    #rb-modal .rb-modal-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    #rb-modal .rb-actions {
      position: sticky;
      bottom: 0;
      z-index: 5;
      margin: 14px -16px -16px;
      padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
      background: #fff;
      border-top: 1px solid rgba(0,0,0,.08);
      box-shadow: 0 -6px 16px rgba(0,0,0,.08);
    }

    #rb-modal .rb-actions .rb-btn {
      width: 100%;
      min-height: 46px;
      font-size: 16px;
    }
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 768px) {
    #rb-modal.is-open {
      overflow: hidden;
      padding: 8px;
      box-sizing: border-box;
    }

    #rb-modal .rb-modal-backdrop {
      position: fixed;
    }

    #rb-modal .rb-modal {
      width: 100%;
      height: calc(100vh - 96px);
      max-height: calc(100vh - 96px);
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border-radius: 12px;
    }

    #rb-modal .rb-modal-header {
      flex: 0 0 auto;
      position: sticky;
      top: 0;
      z-index: 3;
    }

    #rb-modal .rb-modal-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 120px;
    }

    #rb-modal .rb-actions {
      position: sticky;
      bottom: 0;
      z-index: 5;
      margin: 14px -16px -16px;
      padding: 12px 16px 18px;
      background: #fff;
      border-top: 1px solid rgba(0,0,0,.08);
      box-shadow: 0 -6px 16px rgba(0,0,0,.08);
    }

    #rb-modal .rb-actions .rb-btn {
      width: 100%;
      min-height: 46px;
      font-size: 16px;
    }
  }
}
