/* ===========================
   RED MANGO — BOOK.CSS
   =========================== */

.book-main {
  background: var(--white);
  padding: 80px 60px;
  position: relative;
}

/* Soft, low-opacity color blobs sitting behind the grid — purely so the
   glass panels below have something ambient to blur/refract. Kept subtle
   on purpose: this is a booking page, not a marketing hero. */
.book-main::before,
.book-main::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
}

.book-main::before {
  width: 380px;
  height: 380px;
  top: -60px;
  right: 8%;
  background: rgba(192, 57, 43, 0.14); /* var(--red) whisper */
}

.book-main::after {
  width: 320px;
  height: 320px;
  bottom: 10%;
  left: 4%;
  background: rgba(240, 230, 211, 0.6); /* var(--cream) whisper */
}

.book-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 60px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* ===== LEFT — FORM ===== */
.category-preview {
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  border: 1px solid #eee;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.category-preview.is-visible {
  max-height: 320px;
  opacity: 1;
}

.category-preview img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.category-preview-info {
  padding: 16px 18px;
  background: var(--white);
}

.category-preview-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #222;
  margin-bottom: 6px;
}

.category-preview-tagline {
  font-size: 13px;
  font-weight: 400;
  color: #888;
  line-height: 1.5;
}

.book-form-wrapper {
  background: var(--white);
}

.book-eyebrow {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.book-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 14px;
  line-height: 1.2;
}

.book-subtext {
  font-size: 15px;
  font-weight: 500;
  color: #777;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* Reuse contact-form field styling patterns but on plain white, minimal borders */
.book-form-wrapper .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.book-form-wrapper .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.book-form-wrapper .form-group-full {
  margin-bottom: 20px;
}

.book-form-wrapper label {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #444;
}

.book-form-wrapper .required {
  color: var(--red);
}

.book-form-wrapper input[type="text"],
.book-form-wrapper input[type="email"],
.book-form-wrapper input[type="tel"],
.book-form-wrapper input[type="number"],
.book-form-wrapper input[type="date"],
.book-form-wrapper select,
.book-form-wrapper textarea {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 300;
  color: #333;
  background: var(--white);
  border: 1px solid #e0e0e0;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

.book-form-wrapper input[type="date"],
.book-form-wrapper select {
  cursor: pointer;
}

.book-form-wrapper select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.book-form-wrapper input:focus,
.book-form-wrapper select:focus,
.book-form-wrapper textarea:focus {
  border-color: var(--red);
}

.book-form-wrapper input::placeholder,
.book-form-wrapper textarea::placeholder {
  color: #bbb;
  font-weight: 300;
}

.book-form-wrapper textarea {
  resize: vertical;
  min-height: 110px;
}

/* ===== CART MODE — selected apartments list =====
   Shown instead of the category dropdown when the guest arrives from
   availability.html with more than one (or just a confirmed) apartment
   already chosen. Deliberately styled close to category-preview above —
   same white card, same border/radius language — rather than inventing
   a new visual pattern for what is conceptually the same "here's what
   you picked" moment. */

.book-cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.book-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.book-cart-item-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #222;
}

.book-cart-item-price {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  white-space: nowrap;
}

.book-cart-change-link {
  display: inline-block;
  margin-top: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: rgba(192, 57, 43, 0.4);
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.book-cart-change-link:hover {
  color: var(--red-dark);
}

.book-submit-wrapper .btn-submit {
  width: 100%;
  background: var(--red);
  color: var(--white);
  border: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 4px;
}

.book-submit-wrapper .btn-submit:hover {
  background: var(--red-dark);
}

.book-submit-wrapper .btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.book-submit-wrapper .form-feedback {
  margin-top: 16px;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.book-submit-wrapper .form-success {
  background: #f0faf4;
  border: 1px solid #a8d5b5;
  color: #2e7d32;
}

.book-sumbit-wrapper .form-error {
  background: #fff5f5;
  border: 1px solid #f5c6c6;
  color: #c0392b;
}

/* ===== RIGHT — SUMMARY ===== */

.book-summary {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  padding: 36px 32px;

  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5),
    rgba(250, 248, 246, 0.28)
  );

  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);

  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;

  box-shadow:
    0 20px 60px rgba(13, 13, 13, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);

  overflow: hidden;
  isolation: isolate;
}

/* Diagonal light sheen — the "liquid" part of liquid glass.
   z-index: -1 matters here: without it, this absolutely-positioned
   pseudo-element paints ON TOP of the row/label text (per CSS stacking
   rules, positioned z-index:auto content paints after normal in-flow
   content), washing out the numbers instead of sitting behind them. */
.book-summary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0) 32%,
    rgba(255, 255, 255, 0) 68%,
    rgba(255, 255, 255, 0.22) 100%
  );
  pointer-events: none;
  z-index: -1;
}

.book-summary-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 24px;
}

/* ===== AVAILABILITY STATUS BANNER ===== */

.avail-check-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;

  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: background 0.35s ease, border-color 0.35s ease;

  animation: availSettle 0.4s ease-out;
}

/* Runs once when a status appears/changes — gives it a bit of "liquid"
   life without nagging the user with motion forever like a continuous
   loop would (and a continuous loop on a sticky, price-bearing card with
   no motion-preference check is a real usability concern, not just taste). */
@keyframes availSettle {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .avail-check-status {
    animation: none;
  }
}

.avail-check-status::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0) 35%
  );
  pointer-events: none;
  z-index: -1;
}

.avail-check-status .avail-spinner {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: availCheckSpin 0.7s linear infinite;
}

@keyframes availCheckSpin {
  to { transform: rotate(360deg); }
}

.avail-check-status.is-checking {
  background: rgba(247, 246, 244, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #888;
}

/* Green/amber tuned to match the existing .form-success / long-standing
   palette elsewhere on this page, rather than introducing a third,
   slightly different green — same brand color, just translucent now. */
.avail-check-status.is-available {
  background: rgba(46, 125, 50, 0.16);
  border: 1px solid rgba(46, 125, 50, 0.35);
  color: #2e7d32;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 26px rgba(46, 125, 50, 0.14);
}

.avail-check-status.is-unavailable {
  background: rgba(138, 109, 59, 0.18);
  border: 1px solid rgba(138, 109, 59, 0.35);
  color: #8a6d3b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 26px rgba(138, 109, 59, 0.14);
}

.avail-check-status.is-error {
  background: rgba(140, 140, 140, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #666;
}

.book-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  padding: 10px 0;
  border-bottom: 1px solid #ece8e3;
}

.book-summary-row span:first-child {
  color: #999;
}

.book-summary-row span:last-child {
  color: #222;
  font-weight: 600;
  text-align: right;
}

.book-summary-divider {
  height: 1px;
  background: #ddd;
  margin: 16px 0;
}

.book-summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #222;
}

.book-summary-total-row span:last-child {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--red);
  text-transform: none;
  letter-spacing: 0;
}

.book-summary-usd {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 4px;
  margin-bottom: 20px;
}

.book-summary-usd #sum-total-usd {
  font-size: 14px;
  font-weight: 600;
  color: #888;
}

.book-rate-note {
  font-size: 10px;
  font-weight: 500;
  color: #bbb;
  margin-top: 2px;
}

.book-summary-fineprint {
  font-size: 11px;
  font-weight: 500;
  color: #aaa;
  line-height: 1.6;
}

.policy-link {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: rgba(192, 57, 43, 0.4);
  text-underline-offset: 2px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.policy-link:hover {
  color: var(--red-dark);
  text-decoration-color: var(--red-dark);
}

/* ===== RESPONSIVE ===== */

.book-submit-wrapper {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .book-main {
    padding: 60px 24px;
  }

  .book-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .book-form-wrapper {
    order: 1;
  }

  .book-summary {
    order: 2;
    position: static;
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
  }

  .book-submit-wrapper {
    order: 3;
  }

  .book-form-wrapper .form-row {
    grid-template-columns: 1fr;
  }

  .book-main::before,
  .book-main::after {
    display: none;
  }
}