/* ============================================================
   MODAL V2 — Reservation modal redesign
   Self-contained: all styles scoped under .rv2
   ============================================================ */

/* Backdrop */
#modal-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:9999; }
#modal-backdrop.active { display:block; }

/* ---- Container ---- */
#bgUserData_c.rv2 {
  display: none !important;
  position: fixed !important;
  z-index: 10000 !important;
  top: 3vh !important;
  left: 5vw !important;
  width: 90vw !important;
  height: 94vh !important;
  max-width: 1300px !important;
  overflow: hidden !important;
  background: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.35) !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: visible !important;
}
@media (min-width:1400px) {
  #bgUserData_c.rv2 { left: calc(50% - 650px) !important; }
}
#bgUserData_c.rv2.modal-open { display: block !important; }

/* Inner wrapper */
#bgUserData.rv2 {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  visibility: visible !important;
  position: relative !important;
}

/* ---- Header bar ---- */
.rv2-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #e0e4d4;
  border-radius: 12px 12px 0 0;
}
.rv2-title {
  color: #333;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .3px;
}
.rv2-close {
  color: #999 !important;
  font-size: 32px !important;
  text-decoration: none !important;
  line-height: 1 !important;
  position: absolute !important;
  top: 12px !important;
  right: 18px !important;
  z-index: 10 !important;
  transition: color .2s;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50%;
}
.rv2-close:hover { color: #333 !important; background: #f0f0f0 !important; }

/* ---- Form wrapper ---- */
.rv2-form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* ---- Body: two columns ---- */
.rv2-body {
  display: flex !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Left column */
.rv2-col-left {
  flex: 1 1 58%;
  overflow-y: auto;
  padding: 12px 20px 14px;
  box-sizing: border-box;
  text-align: left;
}

/* Right column */
.rv2-col-right {
  flex: 1 1 42%;
  overflow-y: auto;
  padding: 12px 20px 12px;
  box-sizing: border-box;
  background: #f4f6f0;
  border-left: 1px solid #e0e4d4;
  display: flex;
  flex-direction: column;
  text-align: left;
}

/* All children in both columns: left align */
.rv2-col-left *,
.rv2-col-right * {
  text-align: left;
}

/* ---- Section titles ---- */
.rv2-section-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #3B490A !important;
  margin: 0 0 8px !important;
  padding: 0 0 4px !important;
  border-bottom: 2px solid #8FA318 !important;
  letter-spacing: .3px !important;
  line-height: 1.4 !important;
  height: auto !important;
  float: none !important;
  width: auto !important;
}

/* ---- Form rows ---- */
.rv2-row {
  display: flex !important;
  gap: 10px !important;
  margin-bottom: 6px !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
}
.rv2-row--1 .rv2-field { flex: 1; }
.rv2-row--2 .rv2-field { flex: 1; }
.rv2-row--3 .rv2-field { flex: 1; }

/* ---- Field ---- */
.rv2-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rv2-field > label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #666 !important;
  text-transform: uppercase !important;
  letter-spacing: .5px !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  width: auto !important;
  padding: 0 !important;
  text-align: left !important;
}

/* Inputs */
#bgUserData_c.rv2 input:not([type=checkbox]):not([type=radio]),
#bgUserData_c.rv2 select,
#bgUserData_c.rv2 textarea {
  height: 32px !important;
  padding: 0 10px !important;
  border: 1px solid #d0d5c0 !important;
  border-radius: 6px !important;
  background: #f9faf6 !important;
  font-size: 13px !important;
  color: #333 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  transition: border-color .2s, box-shadow .2s !important;
  font-family: inherit !important;
}
#bgUserData_c.rv2 textarea {
  height: auto !important;
  min-height: 50px !important;
  padding: 6px 10px !important;
  resize: vertical !important;
}
#bgUserData_c.rv2 textarea#bgMoreDetailsNotesInput {
  min-height: 70px !important;
  height: 70px !important;
}
#bgUserData_c.rv2 input:focus,
#bgUserData_c.rv2 select:focus,
#bgUserData_c.rv2 textarea:focus {
  outline: none !important;
  border-color: #8FA318 !important;
  box-shadow: 0 0 0 3px rgba(143,163,24,.15) !important;
}

/* Uppercase input values */
#bgUserData_c.rv2 input:not([type=checkbox]):not([type=radio]) {
  text-transform: uppercase !important;
}
#bgUserData_c.rv2 textarea {
  text-transform: uppercase !important;
}

/* Phone group (prefix + phone inline) */
.rv2-phone-group {
  display: flex;
  gap: 6px;
}
.rv2-phone-group select { flex: 0 0 140px; }
.rv2-phone-group input { flex: 1; }

/* ---- Payment section resets ---- */
#bgUserData_c.rv2 #paymentInfo {
  position: static !important;
  height: auto !important;
  text-align: left !important;
}
#bgUserData_c.rv2 #paymentTypeShell {
  position: static !important;
  z-index: auto !important;
  text-align: left !important;
}
#bgUserData_c.rv2 #creditCardInfo {
  position: static !important;
  width: 100% !important;
  text-align: left !important;
}

/* ---- Payment section ---- */
.rv2-payment {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e0e4d4;
  text-align: left !important;
}
.rv2-payment .rv2-section-title {
  border-bottom-color: #D69942 !important;
}

.rv2-radio {
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;
  margin-bottom: 4px !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
  color: #444 !important;
  cursor: pointer !important;
  text-align: left !important;
  justify-content: flex-start !important;
  width: 100% !important;
}
.rv2-radio span,
.rv2-radio .infoPayment {
  text-align: left !important;
  display: block !important;
  flex: 1 !important;
  font-weight: normal !important;
}
.rv2-radio input[type=radio] {
  margin-top: 3px !important;
  flex-shrink: 0 !important;
  height: auto !important;
  width: auto !important;
}

.rv2-pay-note {
  font-size: 11.5px;
  color: #777;
  margin: 0 0 6px 16px;
  line-height: 1.4;
}
/* Hide card images that come from PHP text content */
.rv2-pay-note img,
.rv2-payment .infoPayment img {
  display: none !important;
}

/* Expiration row: month+year fixed width, titular takes rest */
.rv2-row--cc {
  display: flex !important;
  gap: 10px !important;
  margin-bottom: 6px !important;
  width: 100% !important;
  height: auto !important;
  padding: 0 !important;
}
.rv2-field--exp {
  flex: 0 0 200px !important;
}
.rv2-exp-group {
  display: flex;
  gap: 6px;
  width: 100% !important;
}
.rv2-exp-group select {
  flex: 1;
}
.rv2-field--holder {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

/* Credit card inputs stretch full width */
#creditCardInfo .rv2-row--2 .rv2-field {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}
#creditCardInfo .rv2-row--2 .rv2-field input {
  width: 100% !important;
}

#bgUserData_c.rv2 .rv2-card-logos {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  margin-top: 6px !important;
  padding: 0 !important;
  width: auto !important;
  flex-wrap: nowrap !important;
  height: auto !important;
  border: none !important;
  background: transparent !important;
}
#bgUserData_c.rv2 .rv2-card-logos img {
  flex-shrink: 0 !important;
  height: auto !important;
  width: auto !important;
  border: none !important;
  background: transparent !important;
}

/* ---- Right column: Summary ---- */
.rv2-summary { margin-bottom: 8px; }

.rv2-s-hotel {
  font-weight: 700;
  font-size: 14px;
  color: #3B490A;
  margin-bottom: 10px;
}

.rv2-s-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  margin-bottom: 6px;
}
.rv2-s-label {
  font-size: 12.5px;
  color: #555;
  padding: 3px 0;
  width: 100% !important;
}
.rv2-s-val {
  font-size: 12.5px;
  font-weight: 600;
  color: #333;
  text-align: right !important;
  padding: 3px 0;
  width: 100% !important
}

.rv2-s-divider {
  border-top: 1px solid #d2dba4;
  margin: 6px 0;
}

.rv2-s-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 4px;
  border-top: 2px solid #8FA318;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #3B490A;
}

.rv2-s-tax {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
  margin-top: 2px;
}

/* Observations */
.rv2-obs {
  margin-top: 8px;
  width: 100% !important;
}
.rv2-obs label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #3B490A !important;
  display: block !important;
  margin-bottom: 4px !important;
}
#bgUserData_c.rv2 .rv2-obs textarea#bgMoreDetailsNotesInput {
  width: 100% !important;
  min-height: 70px !important;
  height: 70px !important;
}

/* Bed type */
.rv2-bed-type {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rv2-bed-type > label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #3B490A !important;
  white-space: nowrap !important;
  flex-shrink: 0;
}
.rv2-bed-type > select {
  flex: 1;
}

/* Terms */
.rv2-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #d2dba4;
  font-size: 12px;
  color: #444;
}
.rv2-terms input[type=checkbox] {
  margin-top: 2px;
  flex-shrink: 0;
  height: auto !important;
  width: auto !important;
}
.rv2-terms a { color: #3B490A; }

/* ---- Footer buttons ---- */
.rv2-footer {
  display: flex !important;
  gap: 10px !important;
  justify-content: flex-end !important;
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid #d2dba4 !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  float: none !important;
}

.rv2-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 28px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: background .2s, box-shadow .2s !important;
  letter-spacing: .3px;
}
.rv2-btn--confirm {
  background: #8FA318 !important;
  color: #fff !important;
}
.rv2-btn--confirm:hover {
  background: #7a8e10 !important;
  box-shadow: 0 2px 8px rgba(143,163,24,.3) !important;
}
.rv2-btn--confirm.disabled {
  background: #b5c46a !important;
  cursor: default !important;
}
.rv2-btn--back {
  background: #e8eae0 !important;
  color: #555 !important;
}
.rv2-btn--back:hover {
  background: #dcdfd2 !important;
}

/* jQuery UI dialog above modal */
.ui-dialog {
  z-index: 10001 !important;
}
.ui-widget-overlay {
  z-index: 10000 !important;
}
/* SweetAlert above modal */
.swal2-container,
.sweet-alert,
.swal-overlay,
.swal2-popup {
  z-index: 10002 !important;
}
.swal2-backdrop-show,
.sweet-overlay {
  z-index: 10001 !important;
}

/* ---- MOBILE ---- */
@media only screen and (max-width: 900px) {
  /* Container */
  #bgUserData_c.rv2 {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    max-width: none !important;
  }
  .rv2-header {
    border-radius: 0;
    padding: 12px 16px;
  }
  .rv2-title { font-size: 16px; }

  /* Body stacks columns */
  #bgUserData_c.rv2 .rv2-body {
    flex-direction: column !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #bgUserData_c.rv2 .rv2-col-left,
  #bgUserData_c.rv2 .rv2-col-right {
    flex: none !important;
    width: 100% !important;
    overflow: visible !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    position: static !important;
    float: none !important;
    display: block !important;
  }
  #bgUserData_c.rv2 .rv2-col-right {
    border-left: none !important;
    border-top: 1px solid #e0e4d4 !important;
  }

  /* Reset ALL absolute positioning from estilos/style_mobile */
  #bgUserData_c.rv2 #bgUserDataFormArea {
    width: 100% !important;
    margin-top: 0 !important;
    position: static !important;
  }
  #bgUserData_c.rv2 #paymentInfo {
    position: static !important;
    height: auto !important;
  }
  #bgUserData_c.rv2 #paymentTypeShell {
    position: static !important;
  }
  #bgUserData_c.rv2 #creditCardInfo {
    position: static !important;
    top: auto !important;
    width: 100% !important;
  }
  #bgUserData_c.rv2 #bgUserDataAmount {
    width: 100% !important;
    float: none !important;
    position: static !important;
  }
  #bgUserData_c.rv2 #bgUserDataFooter {
    position: static !important;
    width: 100% !important;
    float: none !important;
  }

  /* 2-col rows stay inline on mobile */
  .rv2-row--2,
  .rv2-row--cc {
    flex-direction: row !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }
  .rv2-row--2 .rv2-field,
  .rv2-row--cc .rv2-field {
    margin-bottom: 0 !important;
  }
  .rv2-field--exp {
    flex: none !important;
  }
  .rv2-field {
    margin-bottom: 10px;
  }
  .rv2-phone-group {
    flex-direction: column;
  }
  .rv2-phone-group select { flex: none; }

  /* Observaciones full width on mobile */
  #bgUserData_c.rv2 .rv2-obs textarea#bgMoreDetailsNotesInput {
    width: 100% !important;
  }

  .rv2-footer {
    justify-content: center !important;
  }
}
