/* =========================================================================
   BOOKING MODAL — LX Cottages
   A premium, animated full-screen booking widget with Booking.com deep link
   ========================================================================= */

/* ---- Overlay ---- */
.bk-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(27, 38, 30, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; transition: opacity 0.35s ease;
  pointer-events: none;
}
.bk-overlay.bk-is-open {
  opacity: 1; pointer-events: all;
}
.bk-overlay[hidden] { display: none !important; }

/* ---- Modal card ---- */
.bk-modal {
  background: #FFFDF5;
  border-radius: 20px;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 32px 80px -20px rgba(27,42,58,0.48), 0 0 0 1px rgba(44,71,30,0.08);
  transform: translateY(28px) scale(0.97);
  transition: transform 0.38s cubic-bezier(.22,.61,.36,1);
  scrollbar-width: thin;
}
.bk-overlay.bk-is-open .bk-modal {
  transform: translateY(0) scale(1);
}

/* ---- Header ---- */
.bk-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.8rem 0;
}
.bk-modal__brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem; font-weight: 600;
  color: #2C471E;
}
.bk-modal__close {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: none;
  color: #4F4433; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.bk-modal__close:hover { background: #F0E8D0; color: #C83E26; }

/* ---- Intro ---- */
.bk-modal__intro { padding: 1rem 1.8rem 0; }
.bk-eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: #C83E26; margin-bottom: 0.3rem;
}
.bk-modal__intro h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.65rem; color: #2C471E;
  margin: 0 0 0.4rem; line-height: 1.15;
}
.bk-subtitle {
  font-size: 0.88rem; color: #6B5B45; margin: 0;
}

/* ---- Form ---- */
.bk-form { padding: 1.4rem 1.8rem 1.8rem; display: flex; flex-direction: column; gap: 1.2rem; }

/* ---- Rows ---- */
.bk-row { display: grid; gap: 0.75rem; }
.bk-row--dates { grid-template-columns: 1fr auto 1fr; align-items: end; }
.bk-row--guests { grid-template-columns: repeat(3, 1fr); }
.bk-field__arrow {
  font-size: 1rem; color: #A8502B; padding-bottom: 0.9rem;
  display: flex; align-items: flex-end; justify-content: center;
}

/* ---- Individual field ---- */
.bk-field { display: flex; flex-direction: column; gap: 0.45rem; }
.bk-field label {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: #4F4433;
  display: flex; align-items: center; gap: 0.35rem;
}
.bk-field input[type="date"] {
  padding: 0.75rem 1rem;
  border: 1.5px solid #D8CCB0;
  border-radius: 10px;
  background: #fff; color: #2A241A;
  font-size: 0.95rem; font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.bk-field input[type="date"]:focus {
  outline: none; border-color: #2C471E;
  box-shadow: 0 0 0 3px rgba(44,71,30,0.12);
}
.bk-field input[type="date"].bk-error-field { border-color: #C83E26; }
.bk-field__hint {
  font-size: 0.72rem; color: #A8502B; min-height: 1em;
}

/* ---- Duration badge ---- */
.bk-duration {
  display: flex; align-items: center; gap: 0.4rem;
  background: #EAF4EC; border-radius: 999px;
  padding: 0.4rem 1rem; width: fit-content;
  font-size: 0.82rem; font-weight: 600; color: #2C471E;
}

/* ---- Stepper ---- */
.bk-stepper {
  display: flex; align-items: center;
  border: 1.5px solid #D8CCB0; border-radius: 10px;
  background: #fff; overflow: hidden;
}
.bk-step {
  width: 38px; height: 44px;
  background: transparent; border: none; cursor: pointer;
  font-size: 1.2rem; color: #4F4433; font-weight: 500;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.bk-step:hover { background: #F0E8D0; color: #2C471E; }
.bk-stepper input[type="number"] {
  width: 100%; border: none; background: transparent;
  text-align: center; font-size: 1rem; font-weight: 600;
  color: #2A241A; -moz-appearance: textfield; appearance: textfield;
}
.bk-stepper input[type="number"]::-webkit-inner-spin-button,
.bk-stepper input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; }

/* ---- Room type selector ---- */
.bk-room-select__label {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: #4F4433; margin-bottom: 0.6rem;
}
.bk-room-select__options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.bk-room-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.bk-room-option__card {
  display: flex; align-items: center; gap: 0.7rem;
  border: 2px solid #D8CCB0; border-radius: 12px;
  padding: 0.9rem 1rem; cursor: pointer;
  background: #fff; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
}
.bk-room-option__card:hover { border-color: #2C471E; background: #F6FBF6; }
.bk-room-option input:checked + .bk-room-option__card {
  border-color: #2C471E; background: #EAF4EC;
  box-shadow: 0 0 0 3px rgba(44,71,30,0.10);
}
.bk-room-option__icon { font-size: 1.4rem; flex-shrink: 0; }
.bk-room-option__card strong { font-size: 0.88rem; color: #2A241A; display: block; }
.bk-room-option__card small { font-size: 0.75rem; color: #6B5B45; }
.bk-room-option__check {
  margin-left: auto; font-size: 0.9rem; color: #2C471E; font-weight: 700;
  opacity: 0; transition: opacity 0.2s;
}
.bk-room-option input:checked + .bk-room-option__card .bk-room-option__check { opacity: 1; }

/* ---- Error ---- */
.bk-error {
  background: #FFF0ED; border-left: 3px solid #C83E26; border-radius: 6px;
  padding: 0.6rem 1rem; font-size: 0.85rem; color: #C83E26; margin: 0;
}

/* ---- Submit ---- */
.bk-submit {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 1.1rem 2rem;
  background: #2C471E; color: #FFFDF5;
  border: none; border-radius: 999px;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.02em;
  cursor: pointer; font-family: inherit;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 8px 24px -8px rgba(44,71,30,0.45);
}
.bk-submit:hover {
  background: #C83E26;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(200,62,38,0.45);
}
.bk-submit:active { transform: translateY(0); }
.bk-submit--loading .bk-submit__text::after { content: '…'; }

/* ---- Disclaimer ---- */
.bk-disclaimer {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-size: 0.74rem; color: #8A7860; text-align: center; margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .bk-modal__header { padding: 1.2rem 1.2rem 0; }
  .bk-modal__intro { padding: 0.8rem 1.2rem 0; }
  /* Include safe-area padding for iOS bottom bar */
  .bk-form { padding: 1.2rem 1.2rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }

  .bk-row--dates { grid-template-columns: 1fr; }
  .bk-field__arrow { display: none; }
  
  /* Prevent the 3 steppers from squishing by moving Rooms to its own row */
  .bk-row--guests { grid-template-columns: 1fr 1fr; gap: 1rem 0.6rem; }
  .bk-row--guests .bk-field:nth-child(3) { grid-column: 1 / -1; }

  .bk-room-select__options { grid-template-columns: 1fr; }
  
  /* Bottom sheet appearance */
  .bk-modal { max-height: 94dvh; border-radius: 20px 20px 0 0; }
  .bk-overlay { align-items: flex-end; padding: 0; }
}
