/* =========================================================================
   Booking — the calendar page and the guest's booking / payment page.
   Loaded after the site sheets by the two booking templates only.
   The class names are the ones static/js/booking.js writes; do not rename.
   ========================================================================= */

.book__block { display: grid; gap: var(--space-4); }
.book__block > .eyebrow { margin-bottom: var(--space-1); }

/* With the script the native date rows (and the no-JS "Show price" button)
   are clipped, not removed: still required, still validated, still
   focusable — only the calendar is visible. */
.js-enhanced .cal-native {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Calendar ----------------------------------------------------------------- */
.cal { position: relative; font-family: var(--font-ui); }
.cal:empty { display: none; }
.cal__nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  pointer-events: none;
  z-index: 1;
}
.cal__btn {
  pointer-events: auto;
  min-width: 44px; min-height: 44px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--step-1);
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.cal__btn:hover { background: var(--sun); border-color: var(--sun); }
.cal__btn[disabled] { opacity: 0.3; cursor: default; }
.cal__btn[disabled]:hover { background: var(--paper); border-color: var(--line-strong); }

.cal__months { display: grid; gap: var(--space-7); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .cal__months--two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cal__title {
  margin-inline: 52px;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 700;
  text-align: center;
  line-height: 44px;                         /* matches the nav buttons */
}
.cal__weekdays,
.cal__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 0; }
.cal__weekdays { margin-top: var(--space-3); }
.cal__weekdays span { padding-block: var(--space-2); font-size: 0.78rem; font-weight: 600; text-align: center; color: var(--ink-faint); }
.cal__day {
  position: relative;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.cal__day:hover:not([disabled]) { background: var(--sun); }
.cal__day:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; }
.cal__day[disabled] { color: var(--ink-faint); opacity: 0.4; cursor: default; }
.cal__day.is-unavailable { text-decoration: line-through; opacity: 0.3; }
.cal__day.is-today::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 6px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sun-deep);
  transform: translateX(-50%);
}
.cal__day.is-range { border-radius: 0; background: var(--dawn); opacity: 1; }
.cal__day.is-start,
.cal__day.is-end {
  background: #141414;
  color: #ffffff;
  font-weight: 700;
  opacity: 1;
  text-decoration: none;
}
.cal__day.is-start:hover:not([disabled]),
.cal__day.is-end:hover:not([disabled]) { background: #141414; }
.cal__day.is-start { border-radius: 50% 0 0 50%; }
.cal__day.is-end { border-radius: 0 50% 50% 0; }
.cal__day.is-start.is-end { border-radius: 50%; }
.cal__day.is-end[disabled] { opacity: 1; color: #ffffff; }
/* Pointing at a day shows what a click would select: the whole session, or
   the longer stay. */
.cal__day.is-preview { border-radius: 0; background: var(--dawn); opacity: 1; }
.cal__day.is-preview[disabled] { color: var(--ink); }
/* The departure being moved: the old one becomes an ordinary night of the stay. */
.cal__day.is-end.is-preview:not(.is-preview-end) { color: var(--ink); font-weight: 500; }
.cal__day.is-preview-start { border-radius: 50% 0 0 50%; background: var(--sun); color: #141414; }
.cal__day.is-preview-end { border-radius: 0 50% 50% 0; background: var(--sun); color: #141414; }
.cal__day.is-start.is-preview,
.cal__day.is-end.is-preview-end { background: #141414; color: #ffffff; }
.cal__day.is-start.is-preview { border-radius: 50% 0 0 50%; }
.cal__hint { margin-top: var(--space-4); font-size: var(--step--1); line-height: 1.5; color: var(--ink-faint); }
.cal__clear {
  margin-top: var(--space-3);
  padding: 0.4em 1em;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.cal__clear:hover { background: var(--sun); border-color: var(--sun); }
.cal__clear[hidden] { display: none; }

/* ---- Terms ------------------------------------------------------------------------ */
.terms { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); font-family: var(--font-ui); }
.terms summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  list-style: none;
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 600;
}
.terms summary::-webkit-details-marker { display: none; }
.terms summary::after { content: "+"; font-size: 1.3rem; font-weight: 400; line-height: 1; }
.terms[open] summary::after { content: "–"; }
.terms__body { max-height: 22rem; overflow-y: auto; padding: 0 var(--space-4) var(--space-4); font-family: var(--font-body); font-size: var(--step--1); color: var(--ink-soft); }
.terms__body > * + * { margin-top: var(--space-3); }

/* ---- Payment panel -------------------------------------------------------------------- */
.pay { font-family: var(--font-ui); }
/* The card, beside the transfer (Stripe, 2026-09-27): same voice as the transfer panel. */
.pay-card { font-family: var(--font-ui); }
.pay-card p { margin-top: var(--space-3); font-size: var(--step-0); line-height: 1.5; }
.pay-card form { margin-top: var(--space-5); }
.pay__amount { margin: var(--space-3) 0 var(--space-5); font-family: var(--font-display); font-size: var(--step-4); font-weight: 800; font-stretch: 86%; letter-spacing: -0.015em; line-height: 1; }
.pay__grid { display: grid; gap: var(--space-5); }
.pay .spec__val { word-break: break-all; }
/* What the amount is made of: his fee, and the bed at the Mas's rate. Sums, so they never break. */
.pay__lines { margin: var(--space-2) 0 var(--space-3); }
.pay__lines .spec__val { word-break: normal; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay__lines + .form-hint { margin-bottom: var(--space-5); }
.pay__ref { display: grid; gap: var(--space-2); justify-items: start; }
.pay__code {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  background: var(--sun);
  color: #141414;
  font-family: var(--font-mono);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.16em;
}
.pay__code--inline { padding: 0.1em 0.5em; font-size: var(--step-0); letter-spacing: 0.1em; }
.pay__qr { display: grid; gap: var(--space-2); justify-items: start; margin: var(--space-5) 0 0; }
.pay__qr img { width: 176px; height: 176px; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #ffffff; }
.pay__qr figcaption { font-size: var(--step--1); color: var(--ink-faint); }
.pay__deadline { margin-top: var(--space-5); color: var(--ink); }
.pay__deadline strong { font-weight: 700; background: linear-gradient(var(--sun), var(--sun)) 0 100% / 100% 0.35em no-repeat; }
.pay .form-hint + .form-hint { margin-top: var(--space-2); }
.pay__deadline + .form-hint { margin-top: var(--space-3); }

.copy-btn {
  margin-left: var(--space-2);
  padding: 0.35em 0.9em;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  vertical-align: middle;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.copy-btn:hover { background: var(--sun); border-color: var(--sun); }
.copy-btn[hidden] { display: none; }

.release { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.receipt .spec__val { text-align: right; }
@media (max-width: 520px) { .receipt .spec__val { text-align: left; } }

/* ---- Where to sleep: one choice among the Mas's places ----------------------------------- */
.choices { display: grid; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.choices > legend { margin-bottom: var(--space-3); padding: 0; }
.choices > .form-hint { margin-top: var(--space-2); }
.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.choice:hover { border-color: var(--ink-faint); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--dawn); }
.choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.choice input { grid-row: 1 / span 2; width: 1.2em; height: 1.2em; margin-top: 0.2em; accent-color: #141414; }
.choice__name { font-size: var(--step-0); font-weight: 600; line-height: 1.3; }
.choice__price { font-size: var(--step--1); line-height: 1.45; color: var(--ink-soft); }

/* ---- The two lines, and what they add up to ------------------------------------------------ */
.bill { border-radius: var(--radius); background: var(--dawn); padding: var(--space-2) var(--space-5); font-family: var(--font-ui); }
.bill[hidden] { display: none; }
.bill__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-5);
  padding-block: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  font-weight: 500;
}
.bill__row:first-child { border-top: 0; }
.bill__row[hidden] { display: none; }
.bill__row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill__row--total { font-size: var(--step-0); font-weight: 700; }
