/* templates-next/_shared/booking.css — shared booking widget (calendar + quote).
 *
 * Used by tidal / agora / canvas. Self-contained, `tnb-` prefixed so it never
 * clashes with a template's own classes. Themes off the template's CSS custom
 * properties when present, with hard fallbacks so it works standalone.
 *
 * Contract: LINK-OUT checkout to Bookerty. Nightly hints may come from public
 * price APIs; stay totals must come from calculate-price (Pattern 17).
 */
.tnb { position: relative; background: var(--bg-surface, #fff); border: 1px solid var(--border, #e7e2d9);
  border-radius: var(--radius-2xl, 20px); box-shadow: var(--shadow-3, 0 18px 50px rgba(20,20,30,.18));
  padding: 14px; max-width: 880px; color: var(--text-primary, #1f2430); text-align: left; }
.tnb * { box-sizing: border-box; }
.tnb-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 720px) { .tnb-row { grid-template-columns: 1fr 1fr; } }
/* Unit/property selector (duo segment / many dropdown) */
.tnb-unitrow { margin-bottom: 12px; }
.tnb-unit-field { display: flex; flex-direction: column; gap: 6px; }
.tnb-units { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tnb-unit { padding: 9px 16px; min-height: 44px; border-radius: var(--radius-full, 999px);
  border: 1.5px solid var(--border-strong, #dcd6c9); background: var(--bg-surface, #fff);
  color: var(--text-primary, #1f2430); font: inherit; font-weight: 600; cursor: pointer; transition: all .16s; }
.tnb-unit:hover { border-color: var(--accent, #ff7a4d); }
.tnb-unit.is-sel { background: var(--accent, #ff7a4d); color: var(--text-on-accent, #fff); border-color: var(--accent, #ff7a4d); }
.tnb-quote .q-unit { width: 100%; font-weight: 700; color: var(--text-primary, #1f2430); }
.tnb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tnb-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted, #8a8fa0); }
.tnb-control { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 10px 13px;
  border: 1.5px solid var(--border-strong, #dcd6c9); border-radius: var(--field-radius, 12px);
  background: var(--bg-surface, #fff); cursor: pointer; transition: border-color .18s; }
.tnb-control:hover, .tnb-control.is-open { border-color: var(--accent, #ff7a4d); }
.tnb-control .tnb-ic { color: var(--accent, #ff7a4d); flex: 0 0 auto; }
.tnb-val { font-size: 15px; color: var(--text-primary, #1f2430); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnb-val.is-empty { color: var(--text-muted, #8a8fa0); }
.tnb-control select { border: 0; background: transparent; font: inherit; color: inherit; width: 100%; min-height: 24px; cursor: pointer; -webkit-appearance: none; appearance: none; }
/* Native <option> list often ignores inherited color — pin dark ink on a light
   surface so dark-themed hosts (Canvas) stay readable when the popup opens. */
.tnb-control select option { color: #1f2430; background: #fff; }
/* Many-unit stay menu: photo, title, nightly price. Templates restyle it. */
.tnb-pick { position: relative; z-index: 4; margin-bottom: 12px; min-width: 0; max-width: 100%; }
.tnb-pick-btn {
  width: 100%; display: flex; align-items: center; gap: 0; padding: 6px 10px 6px 6px; margin: 0;
  border: 1.5px solid var(--border-strong, #dcd6c9); border-radius: var(--field-radius, 12px);
  background: var(--bg-surface, #fff); color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.tnb-pick-btn:hover, .tnb-pick.is-open .tnb-pick-btn { border-color: var(--accent, #ff7a4d); }
.tnb-pick-row { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.tnb-pick-photo { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
  background: var(--bg-muted, #f3f1ea); display: block; }
.tnb-pick-photo--empty { background: linear-gradient(160deg, var(--bg-muted, #f3f1ea), var(--border, #e7e2d9)); }
.tnb-pick-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tnb-pick-name { font-size: 14px; font-weight: 700; line-height: 1.25; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tnb-pick-sub { font-size: 12px; font-weight: 600; color: var(--text-secondary, #5a6072); }
.tnb-pick-chev { flex: 0 0 8px; width: 8px; height: 8px; margin: 0 6px 0 4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .7; }
.tnb-pick.is-open .tnb-pick-chev { transform: rotate(225deg) translateY(-1px); }
.tnb-pick-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 6;
  max-height: min(560px, 72vh); overflow: auto; padding: 6px;
  background: var(--bg-surface, #fff); border: 1px solid var(--border, #e7e2d9);
  border-radius: var(--field-radius, 12px);
  box-shadow: var(--shadow-3, 0 18px 50px rgba(20, 20, 30, .18));
}
.tnb-pick-opt {
  width: 100%; display: block; padding: 4px; margin: 0; border: 0; border-radius: 10px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.tnb-pick-opt:hover { background: var(--bg-muted, #f3f1ea); }
.tnb-pick-opt[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent, #ff7a4d) 16%, var(--bg-surface, #fff));
}
.tnb-contact-name { margin: 0 0 12px; font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.bk-contact-when-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bk-contact-change { flex: 0 0 auto; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: 0.72; }
.tnb .bk-contact-stay { margin: 0 0 14px; }
.tnb .bk-contact-when-row { margin: 0 0 10px; }
.tnb .bk-contact-when { margin: 0; font-weight: 700; }
.tnb .bk-contact-lines { display: grid; gap: 8px; }
.tnb .bk-contact-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.tnb .bk-contact-total { padding-top: 8px; border-top: 1px solid var(--border, #e7e2d9); font-weight: 700; }
.tnb-book-contact { margin-top: 12px; padding: 14px 14px 12px; border: 1px solid var(--border, #e7e2d9); border-radius: 12px; background: var(--surface, #fff); }
.tnb-book-contact a[data-bk-contact="phone"] { white-space: nowrap; font-weight: 800; font-size: 1.12rem; }

/* ── Phone / Online channel tabs ────────────────────────────────────────── */
.tnb-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--bg-muted, #f3f1ea); padding: 4px; border-radius: var(--radius-full, 999px); }
.tnb-tab { flex: 1; text-align: center; padding: 10px 14px; border-radius: var(--radius-full, 999px); border: 0; background: transparent;
  font: inherit; font-weight: 700; font-size: 14px; color: var(--text-secondary, #5a6072); cursor: pointer; transition: all .15s; }
.tnb-tab.is-active { background: var(--accent, #ff7a4d); color: var(--text-on-accent, #fff); box-shadow: var(--shadow-accent, 0 6px 16px rgba(255,122,77,.35)); }
.tnb-book { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: 54px; padding: 14px 26px; font-weight: 700; font-size: 16px; border: 0; cursor: pointer;
  color: var(--text-on-accent, #fff); background: var(--accent, #ff7a4d); border-radius: var(--btn-radius, 999px);
  box-shadow: var(--shadow-accent, 0 10px 26px rgba(255,122,77,.4)); transition: transform .12s, background .18s;
  text-decoration: none; box-sizing: border-box; width: 100%; }
.tnb-book:hover { background: var(--accent-hover, #ff9a73); transform: translateY(-2px); }
.tnb-book:active { transform: translateY(0) scale(.98); }
.tnb-book[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }

/* ── Quote line (estimate) ──────────────────────────────────────────────── */
.tnb-quote { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border, #e7e2d9);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 15px; }
.tnb-quote .q-calc { color: var(--text-secondary, #5a6072); font-variant-numeric: tabular-nums; }
.tnb-quote .q-total { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.tnb-quote .q-note { width: 100%; font-size: 12.5px; color: var(--text-muted, #8a8fa0); }
.tnb-quote[hidden] { display: none; }
.tnb-redirect { margin: 14px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-muted, #8a8fa0); }
.tnb-guest { margin-top: 14px; display: grid; gap: 10px; }
.tnb-guest-title { margin: 0; font-size: 15px; font-weight: 700; }
.tnb-guest-field { display: grid; gap: 4px; }
.tnb-guest-label { font-size: 13px; font-weight: 600; color: var(--text-secondary, #5a6072); }
.tnb-guest input, .tnb-guest select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--border-strong, #dcd6c9);
  border-radius: var(--field-radius, 12px); background: var(--bg-surface, #fff); color: var(--text-primary, #1f2430); font: inherit; }
.tnb-guest-phone { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(0, 1.15fr); gap: 8px; }
.tnb-dial { position: relative; min-width: 0; }
.tnb-dial-input { text-overflow: ellipsis; }
.tnb-dial-menu {
  position: absolute; z-index: 5; left: 0; bottom: calc(100% + 4px);
  width: min(18rem, calc(100vw - 64px)); max-height: 220px; overflow: auto;
  margin: 0; padding: 4px; border: 1px solid var(--border, #e7e2d9); border-radius: 12px;
  background: var(--surface, var(--bg-surface, #fff));
  color: var(--ink, var(--text-primary, #1f2430));
  box-shadow: var(--shadow-2, 0 10px 28px rgba(20,20,30,.16));
}
.tnb-dial-menu[hidden] { display: none; }
.tnb-dial-menu button {
  display: block; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font: inherit; font-size: 14px; line-height: 1.3;
  text-align: left; cursor: pointer;
}
.tnb-dial-menu button[hidden] { display: none; }
.tnb-dial-menu button:hover,
.tnb-dial-menu button.is-active { background: var(--accent-soft, #ffe9df); }
.tnb-dial-menu button[aria-selected="true"] { font-weight: 700; }
.tnb-dial-empty { padding: 8px 10px; font-size: 13px; color: var(--text-muted, #8a8fa0); }
.tnb-dial-empty[hidden] { display: none; }
.tnb-guest-error { margin: 0; font-size: 13px; color: #b42318; }
html.tnb-guest-open,
html.tnb-guest-open body,
html.cv-contact-open,
html.cv-contact-open body,
html.bk-contact-open,
html.bk-contact-open body { overflow: hidden; }
.tnb-guest-modal { position: fixed; inset: 0; z-index: 280; display: grid; place-items: center; padding: 24px; }
/* On <body> these sit above sticky headers and the booking card (Canvas 200,
   mobile drawers 220) and the backdrop blocks clicks on the page behind. */
body > .tnb-guest-modal,
body > .cv-contact-modal,
body > .bk-contact-modal { z-index: 4000; }
.tnb-guest-modal-back { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(22, 19, 13, .56); cursor: pointer; }
.tnb-guest-dialog { position: relative; z-index: 1; width: min(100%, 28rem); max-height: min(86vh, 44rem); overflow: auto;
  padding: 28px 24px 22px; border: 1px solid var(--line, var(--border, #e7e2d9)); border-radius: 16px;
  background: var(--surface, var(--surf, var(--bg-surface, #fff)));
  color: var(--ink, var(--ink-1, var(--text-primary, #1f2430)));
  box-shadow: var(--shadow-3, 0 18px 50px rgba(20, 20, 30, .22)); }
.tnb-guest-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line, var(--border, #e7e2d9)); background: var(--surface, var(--surf, #fff));
  color: inherit; font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.tnb-guest-stay { margin: 8px 0 0; font-size: 15px; font-weight: 600; }
.tnb-guest-dialog .tnb-guest { margin-top: 16px; }
.tnb-guest-dialog .tnb-book { margin-top: 16px; }
.book-card:has(.tnb-guest-modal), .book-band:has(.tnb-guest-modal), .book-rail:has(.tnb-guest-modal) { overflow: visible; }

/* Adults / children / infants (and pets, when shown) share one line.
   Label sits above a compact − n + so a narrow reservation card still fits. */
.tnb-guests {
  position: relative; display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: flex-start; gap: 6px 4px;
}
.tnb-guests > .tnb-label,
.tnb-guests > .tnb-guest-pop { flex: 1 0 100%; }
.tnb-guest-row {
  flex: 1 1 0; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px; text-align: center;
}
.tnb-guest-row-label {
  max-width: 100%; font-size: 12px; font-weight: 600; line-height: 1.15;
  color: var(--text-primary, #1f2430); white-space: nowrap;
}
.tnb-guest-row-step,
.tnb-guest-row-step.tnb-control {
  flex: 0 0 auto; display: inline-flex; flex-direction: row; flex-wrap: nowrap;
  align-items: center; justify-content: center; gap: 2px; width: auto; max-width: 100%;
  min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: default;
}
.tnb-guest-row-step.tnb-control:hover,
.tnb-guest-row-step.tnb-control.is-open { border-color: transparent; }
.tnb-guest-row-step button {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border-radius: 999px;
  border: 1px solid var(--border-strong, #dcd6c9);
  background: var(--bg-surface, #fff); color: var(--text-primary, #1f2430);
  font: inherit; font-size: 14px; line-height: 1; cursor: pointer;
}
.tnb-guest-row-step button:hover:not([disabled]) { border-color: var(--accent, #ff7a4d); color: var(--accent, #ff7a4d); }
.tnb-guest-row-step button[disabled] { opacity: .4; cursor: not-allowed; }
.tnb-guest-row-step [data-guest-val] {
  min-width: 0.9rem; text-align: center; font-size: 13px;
  font-variant-numeric: tabular-nums; font-weight: 700;
}
/* Four counters (pets) on the same line — nudge type down so labels stay intact. */
.tnb-guests:has(> .tnb-guest-row:nth-child(5)) .tnb-guest-row-label { font-size: 11px; }
.tnb-guests:has(> .tnb-guest-row:nth-child(5)) .tnb-guest-row-step button {
  width: 20px; height: 20px; font-size: 13px;
}
.tnb-guest-pop {
  margin-top: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-primary, #1f2430);
  background: var(--accent-soft, #ffe9df);
  border: 1px solid var(--border, #e7e2d9);
  border-radius: 10px;
  box-shadow: var(--shadow-1, 0 6px 18px rgba(20,20,30,.08));
}
.tnb-host-preview-note {
  margin: 12px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.4;
  color: var(--text-secondary, #5a6072);
  background: var(--bg-muted, #f3f1ea);
  border: 1px solid var(--border, #e7e2d9);
  border-radius: 10px;
}

/* ── Calendar popover ───────────────────────────────────────────────────── */
.tnb-pop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; width: min(360px, 92vw);
  background: var(--bg-surface, #fff); border: 1px solid var(--border, #e7e2d9); border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-3, 0 18px 50px rgba(20,20,30,.22)); padding: 14px; }
.tnb-pop[hidden] { display: none; }
.tnb-pop.up { top: auto; bottom: calc(100% + 8px); }
.tnb-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tnb-cal-title { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.tnb-nav { display: inline-flex; gap: 6px; }
.tnb-nav button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border-strong, #dcd6c9);
  background: var(--bg-surface, #fff); color: var(--text-primary, #1f2430); font-size: 16px; cursor: pointer; }
.tnb-nav button:hover:not([disabled]) { border-color: var(--accent, #ff7a4d); color: var(--accent, #ff7a4d); }
.tnb-nav button[disabled] { opacity: .4; cursor: not-allowed; }
.tnb-dow, .tnb-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.tnb-dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted, #8a8fa0); padding-bottom: 6px; }
.tnb-day { height: 44px; display: grid; place-items: center; font-size: 14px; font-variant-numeric: tabular-nums;
  border: 1.5px solid transparent; border-radius: 10px; background: transparent; color: var(--text-primary, #1f2430); cursor: pointer; }
.tnb-day:hover:not(.is-disabled):not(.is-empty) { border-color: var(--accent, #ff7a4d); }
.tnb-day.is-empty { cursor: default; }
.tnb-day.is-disabled { color: var(--text-muted, #b8b4ab); text-decoration: line-through; cursor: not-allowed; opacity: .5; }
.tnb-day.in-range { background: var(--accent-soft, #ffe9df); border-radius: 0; }
.tnb-day.is-start, .tnb-day.is-end { background: var(--accent, #ff7a4d); color: var(--text-on-accent, #fff); font-weight: 700; }
.tnb-day.is-start { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.tnb-day.is-end { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.tnb-pop-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border, #e7e2d9); }
.tnb-hint { font-size: 12.5px; color: var(--text-muted, #8a8fa0); }
.tnb-clear { background: none; border: 0; color: var(--accent, #ff7a4d); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px; }

/* ── Inline calendar (BookertyBookingEngine.mount) ──────────────────────── */
.tnb-cal { margin-top: 8px; }
.tnb-cal .cal-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; }
.tnb-cal .cal-title { font-weight: 700; font-size: 15px; }
.tnb-cal .cal-nav { display: inline-flex; gap: 6px; }
.tnb-cal .cal-nav button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong, #dcd6c9);
  background: var(--bg-surface, #fff); cursor: pointer; font-size: 16px; }
.tnb-cal .cal-nav button:hover:not([disabled]) { border-color: var(--accent, #ff7a4d); }
.tnb-cal .cal-nav button[disabled] { opacity: .4; cursor: not-allowed; }
.tnb-cal .dow, .tnb-cal .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tnb-cal .dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted, #8a8fa0); padding: 4px 0; }
.tnb-cal .cal button { min-height: 40px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px;
  color: var(--text-primary, #1f2430); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.tnb-cal .cal button small { font-size: 9px; color: var(--text-muted, #8a8fa0); font-weight: 600; }
.tnb-cal .cal button:hover:not([disabled]):not(.muted) { border: 1px solid var(--accent, #ff7a4d); }
.tnb-cal .cal .muted { opacity: .2; cursor: default; }
.tnb-cal .cal .past, .tnb-cal .cal .blocked { color: var(--text-muted, #b8b4ab); cursor: not-allowed; opacity: .55; }
.tnb-cal .cal .blocked { text-decoration: line-through; }
.tnb-cal .cal .in { background: var(--accent-soft, #ffe9df); border-radius: 0; }
.tnb-cal .cal .end { background: var(--accent, #ff7a4d); color: var(--text-on-accent, #fff); font-weight: 700; }
.tnb-cal .cal button.end small { color: inherit; }
.tnb-cal .cal .s1 { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.tnb-cal .cal .s2 { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
@media (max-height: 820px) {
  .tnb-cal { margin-top: 2px; }
  .tnb-cal .cal-head { margin: 4px 0; }
  .tnb-cal .cal button { min-height: 32px; }
  .tnb-guests { gap: 4px 4px; }
  .tnb-quote { margin-top: 8px; padding-top: 8px; }
  .tnb-book { min-height: 46px; padding: 10px 18px; }
}
