/* ── BOOKING WIDGETS ────────────────────────────────────────
   Pricing table · Flights · Room type · Board type · Summary
   Adapted for the redesign design system (--purple, --green-booking, etc.)
──────────────────────────────────────────────────────────── */

/* ── SECTION WRAPPER ──────────────────────────────────────── */
.bw-step {
  margin-bottom: 36px;
}
.bw-step-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-light);
  font-weight: 500;
  margin-bottom: 6px;
}
.bw-step-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.3;
}
.bw-step-title em { font-style: italic; }

/* ── PRICING TABLE ────────────────────────────────────────── */
.bw-months-wrap {
  background: var(--bg-secondary, #f6f4ef);
  border-radius: var(--radius);
  padding: 14px 12px 10px;
  margin-bottom: 18px;
}
.bw-months-header {
  display: flex;
  gap: 6px;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bw-months-header::-webkit-scrollbar { display: none; }

.bw-month-col {
  flex: 1 0 0;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px 2px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.bw-month-col.unavailable { cursor: default; }
.bw-month-col:not(.unavailable):hover { background: rgba(255,255,255,0.6); }

.bw-month-year,
.bw-month-year-spacer {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  align-self: flex-start;
  height: 16px;
  margin-bottom: 12px;
}
.bw-month-year-spacer { visibility: hidden; }

.bw-month-bar-area {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 6px;
  padding-top: 20px;
}
.bw-month-bar {
  width: 100%;
  max-width: 64px;
  background: var(--green-booking, #2ec47a);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: background 0.15s;
}
.bw-month-bar-price {
  position: absolute;
  top: -18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.bw-month-col.unavailable .bw-month-bar {
  background: #cfcfcf;
}
.bw-month-col.active .bw-month-bar {
  background: var(--purple);
}
.bw-month-name {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
}
.bw-month-col.active .bw-month-name {
  background: var(--purple);
  color: #fff;
}

.bw-table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.bw-pricing-table {
  width: max-content;
  border-collapse: separate; /* required for sticky inner month labels */
  border-spacing: 0;
  font-size: 12px;
  background: transparent;
  table-layout: auto;
  color: #6b6b6b;
}
.bw-pricing-table th,
.bw-pricing-table td { min-width: 52px; }
.bw-pricing-table thead th.bw-pt-corner,
.bw-pricing-table tbody th { min-width: 90px; position: sticky; left: 0; background: #fff; z-index: 2; }
.bw-pricing-table tbody tr:nth-child(odd) th { background: #fbfaf7; }

/* Month label row: each month spans its days; the inner label sticks at the
   left edge of the scrollport (after the duration corner) until that month
   scrolls out and the next month's label takes over. */
.bw-month-label-row th {
  background: #fff;
  vertical-align: middle;
}
.bw-pricing-table thead th.bw-month-label-th {
  position: relative;
  text-align: left;
  padding: 0;
  height: 28px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card, #fff);
  overflow: visible;
  vertical-align: middle;
}
.bw-month-label-text {
  position: sticky;
  left: 90px; /* match sticky duration corner width */
  z-index: 4;
  display: inline-block;
  padding: 6px 10px 4px 4px;
  background: var(--bg-card, #fff);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  white-space: nowrap;
}
.bw-month-label-row .bw-pt-corner {
  z-index: 5;
  border-bottom: 1px solid var(--border);
}

.bw-pricing-table th,
.bw-pricing-table td {
  padding: 0;
  white-space: nowrap;
  border: none;
}
.bw-pricing-table thead th.bw-month-start {
  border-left: 1px solid var(--border);
}

.bw-pricing-table thead th {
  background: #fff;
  color: var(--text-muted);
  font-weight: 400;
  text-align: center;
  padding: 4px 6px 10px;
  vertical-align: bottom;
}
.bw-pricing-table thead th.bw-pt-corner {
  text-align: left;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  padding-left: 4px;
  width: 80px;
  position: sticky;
  left: 0;
  background: var(--bg-card, #fff);
  z-index: 3;
}
.bw-pricing-table thead th .bw-th-date {
  font-size: 11px;
  font-weight: 400;
  color: #6b6b6b;
  display: block;
  line-height: 1.3;
}
.bw-pricing-table thead th .bw-th-day {
  font-size: 10px;
  color: #9a9a9a;
  display: block;
  line-height: 1.2;
}

.bw-pricing-table tbody th {
  text-align: left;
  padding: 8px 4px;
  font-weight: 400;
  font-size: 12px;
  color: #6b6b6b;
  width: 80px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-card, #fff);
}

.bw-pricing-table tbody tr:nth-child(odd) td { background: #fbfaf7; }
.bw-pricing-table tbody tr:nth-child(odd) th { background: #fbfaf7; }

/* Row + column highlight when a cell is selected.
   Specificity bumped above the :nth-child(odd) zebra rule. */
.bw-pricing-table tbody tr.bw-row-active td,
.bw-pricing-table tbody tr.bw-row-active th,
.bw-pricing-table tbody tr:nth-child(odd).bw-row-active td,
.bw-pricing-table tbody tr:nth-child(odd).bw-row-active th {
  background: #f5f1fb;
}
.bw-pricing-table thead th.bw-col-active,
.bw-pricing-table tbody tr td.bw-col-active,
.bw-pricing-table tbody tr:nth-child(odd) td.bw-col-active {
  background: #f5f1fb;
}
.bw-pricing-table tbody tr.bw-row-active td.bw-col-active,
.bw-pricing-table tbody tr:nth-child(odd).bw-row-active td.bw-col-active {
  background: #ebe3f7;
}

/* Selected cell wins over row/column highlight */
.bw-pricing-table tbody tr td.selected,
.bw-pricing-table tbody tr.bw-row-active td.selected {
  background: var(--purple);
  color: #fff;
}
.bw-pricing-table tbody tr td.selected .bw-price-pp,
.bw-pricing-table tbody tr.bw-row-active td.selected .bw-price-pp {
  color: #fff;
}

.bw-pricing-table td {
  text-align: center;
  padding: 8px 4px;
  cursor: pointer;
  color: #6b6b6b;
  transition: background 0.1s, color 0.1s;
  font-variant-numeric: tabular-nums;
}
.bw-pricing-table td:empty { cursor: default; }
.bw-pricing-table td .bw-price-pp {
  font-weight: 400;
  color: #6b6b6b;
}
.bw-pricing-table td:not(:empty):hover {
  background: var(--purple-pale);
}
.bw-pricing-table td.selected {
  background: var(--purple);
  color: #fff;
}
.bw-pricing-table td.selected .bw-price-pp {
  color: #fff;
}
.bw-pricing-table td.bw-cheapest .bw-price-pp {
  color: var(--text-primary);
  font-weight: 500;
}

.bw-scroll-btns {
  display: flex;
  justify-content: space-between;
  padding: 14px 0 0;
}
.bw-scroll-btn {
  background: var(--purple);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.12s, transform 0.12s;
}
.bw-scroll-btn:hover { opacity: 0.92; }
.bw-scroll-btn:active { transform: translateY(1px); }

.bw-price-pp-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.bw-pricing-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.bw-pricing-legend__swatch {
  display: inline-block;
  width: 12px; height: 12px;
  background: #f0fff7;
  border: 1px solid var(--border);
  border-radius: 2px;
}

/* ── FLIGHTS ──────────────────────────────────────────────── */
.bw-flight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.bw-flight-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color 0.12s, box-shadow 0.12s;
  user-select: none;
}
.bw-flight-card:hover {
  border-color: var(--purple-light);
  box-shadow: 0 2px 12px rgba(61,31,140,0.08);
}
.bw-flight-card.selected {
  border-color: var(--purple);
  box-shadow: 0 2px 16px rgba(61,31,140,0.14);
}

.bw-flight-price-bar {
  background: var(--bg-secondary);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.bw-flight-card.selected .bw-flight-price-bar {
  background: var(--purple);
  border-bottom-color: transparent;
}
.bw-flight-price-tag {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.bw-flight-card.selected .bw-flight-price-tag {
  color: #fff;
}
.bw-flight-price-note {
  font-size: 11px;
  color: var(--text-muted);
}
.bw-flight-card.selected .bw-flight-price-note {
  color: rgba(255,255,255,0.75);
}

.bw-flight-legs {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  padding: 8px 12px 10px;
  gap: 0;
  align-items: stretch;
}
.bw-flight-divider {
  position: relative;
  align-self: stretch;
  justify-self: center;
  width: 1px;
  background: var(--border-strong);
}
.bw-flight-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  transform: translate(-50%, -50%);
}
.bw-flight-divider::after {
  content: '⇄';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: var(--purple-light);
  line-height: 1;
}
.bw-flight-card.selected .bw-flight-divider { background: var(--purple-pale); }
.bw-flight-leg {
  padding: 0 4px;
  min-width: 0;
}
.bw-flight-leg-label,
.bw-flight-leg-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bw-flight-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 1.15fr) minmax(0, 1fr);
  /* One row, three columns: the airline/path column centres against the
     departure and arrival blocks rather than hanging below them. */
  align-items: center;
  gap: 4px;
}
.bw-flight-endpoint {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bw-flight-endpoint--arr {
  align-items: flex-end;
  text-align: right;
}
.bw-flight-airline {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin-bottom: 2px;
}
.bw-flight-airline-logo {
  /* Wordmarks are served on a fixed 70x20 canvas; render them at their native size. */
  display: block;
  height: 20px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.bw-flight-airline-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bw-flight-time {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
}
.bw-flight-path {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.bw-flight-path-line-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 4px;
}
.bw-flight-path-line {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
  min-width: 8px;
}
.bw-flight-airport {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.25;
  min-width: 0;
}
.bw-flight-direct {
  flex: 0 0 auto;
  border: 1px solid var(--purple-light, var(--purple));
  border-radius: 20px;
  padding: 0 7px;
  font-size: 10px;
  line-height: 16px;
  color: var(--purple);
  background: #fff;
  white-space: nowrap;
}
.bw-flight-duration {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
}

.bw-show-more {
  text-align: center;
  padding: 8px 0 0;
}
.bw-show-more-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.12s, color 0.12s;
}
.bw-show-more-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
}

/* ── ROOM TYPE GRID ───────────────────────────────────────── */
.bw-room-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bw-room-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  transition: border-color 0.12s, box-shadow 0.12s;
  user-select: none;
  display: flex;
  flex-direction: column;
}
.bw-room-card:hover {
  border-color: var(--purple-light);
  box-shadow: 0 2px 12px rgba(61,31,140,0.08);
}
.bw-room-card.selected {
  border-color: var(--purple);
  box-shadow: 0 2px 16px rgba(61,31,140,0.14);
}

.bw-room-price-bar {
  background: var(--bg-secondary);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.bw-room-card.selected .bw-room-price-bar {
  background: var(--purple);
  border-bottom-color: transparent;
}
.bw-room-price-tag {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.bw-room-price-tag.included {
  color: var(--green-booking);
}
.bw-room-card.selected .bw-room-price-tag,
.bw-room-card.selected .bw-room-price-tag.included {
  color: #fff;
}
.bw-room-price-note {
  font-size: 11px;
  color: var(--text-muted);
}
.bw-room-card.selected .bw-room-price-note {
  color: rgba(255,255,255,0.75);
}

.bw-room-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.bw-room-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}
.bw-room-pax {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.bw-room-pax svg { color: var(--text-muted); }
.bw-room-features {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
.bw-room-feature {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.bw-room-feature svg { color: var(--green-booking); }

.bw-board-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
}
.bw-board-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.bw-board-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.bw-board-option:last-child { border-bottom: none; }
.bw-board-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0;
}
.bw-board-label input[type="radio"] {
  accent-color: var(--purple);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.bw-room-card:not(.selected) .bw-board-label input[type="radio"] {
  display: none;
}
.bw-board-price {
  font-size: 12px;
  color: var(--text-muted);
}
.bw-board-price.included { color: var(--green-booking); }

/* ── SUMMARY ──────────────────────────────────────────────── */
.bw-summary-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.bw-summary-hotel {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.bw-summary-hotel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.bw-summary-hotel-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.bw-summary-stars {
  font-size: 12px;
  color: var(--orange);
  letter-spacing: 1px;
}
.bw-summary-dates {
  font-size: 13px;
  color: var(--text-muted);
}

.bw-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.bw-summary-col {
  padding: 0 20px;
}
.bw-summary-col:first-child {
  border-right: 1px solid var(--border);
}
.bw-summary-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.bw-summary-row:last-child { border-bottom: none; }
.bw-summary-row:nth-child(even) {
  background: var(--bg-secondary);
  margin: 0 -20px;
  padding: 8px 20px;
}
.bw-summary-key {
  color: var(--text-muted);
  font-size: 12px;
}
.bw-summary-val {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.bw-price-rows {
  padding: 0;
}
.bw-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.bw-price-row:last-child { border-bottom: none; }
.bw-price-row-label { color: var(--text-muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.bw-price-row-val { font-weight: 500; color: var(--text-primary); }
.bw-price-row-val.discount { color: var(--green-booking); }
.bw-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--purple-pale);
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.bw-price-row--package {
  background: var(--bg-secondary);
  margin: 0 -20px;
  padding: 8px 20px;
  cursor: pointer;
  user-select: none;
  border-bottom: none;
}
.bw-price-row--package .bw-price-row-label { color: var(--text-primary); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.bw-price-expand-icon { display: inline-flex; align-items: center; color: var(--purple); transition: transform 0.2s; }
.bw-price-expand-icon.open { transform: rotate(180deg); }
.bw-price-breakdown { background: var(--bg-secondary); margin: 0 -20px; padding: 2px 20px 8px; }
.bw-price-row--sub { padding: 3px 0; background: none; border-bottom: none; }
.bw-price-row--sub .bw-price-row-label,
.bw-price-row--sub .bw-price-row-val { color: var(--text-muted); font-size: 12px; }
.bw-price-row--fee .bw-price-row-label,
.bw-price-row--fee .bw-price-row-val { color: var(--text-primary); font-size: 12px; }
.bw-price-row--fee {
  border-bottom: none;
  border-top: none;
}
.bw-price-row--fee + .bw-price-row--fee {
  border-top: 1px solid var(--border);
}
.bw-price-row--bonus {
  display: none !important;
  border-bottom: none;
  border-top: none;
}
.bw-price-row--bonus.is-visible {
  display: flex !important;
  border-top: 1px solid var(--border);
}
.bw-price-row--total { margin-top: 4px; padding-top: 8px; background: none; }
.bw-price-row--total .bw-price-row-label,
.bw-price-row--total .bw-price-row-val { color: var(--text-primary); font-size: 14px; }
.bw-deposit-note {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.bw-price-calc { font-weight: 500; }

.bw-summary-total {
  margin-top: 0;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.bw-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.bw-total-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.bw-total-amount {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--green-booking);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.bw-summary-cta {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bw-book-btn {
  width: 100%;
  padding: 15px;
  background: var(--green-booking);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}
.bw-book-btn:hover { background: var(--green-booking-dark); }
.bw-book-btn svg { flex-shrink: 0; }
.bw-book-trust {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bw-trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
}
.bw-trust-item svg { color: var(--green-booking); flex-shrink: 0; }

/* ── STEP CONNECTOR ───────────────────────────────────────── */
.bw-steps-wrap {
  position: relative;
}
.bw-step-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── ENGINE STATES & FILTER BAR (Phase 4b) ───────────────── */
.bw-hidden { display: none !important; }

.bw-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 28px;
}
.bw-filter-field { min-width: 150px; flex: 1 1 150px; }
.bw-filter-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 5px;
}
.bw-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
/* Native <select> — match custom trigger chevron (airport / date) */
select.bw-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 13px 13px;
}
select.bw-select::-ms-expand { display: none; }
.bw-select:focus { outline: none; border-color: var(--purple); }
.bw-reset-btn {
  background: none;
  border: none;
  padding: 10px 4px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.bw-reset-btn:hover { color: var(--purple); }

.bw-filters--sidebar {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px 18px 14px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg-card);
}
.bw-filters--sidebar .bw-filter-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(92px, 0.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.bw-filters--sidebar .bw-filter-label {
  margin: 0;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.bw-filters--sidebar .bw-select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
}
.bw-filters--sidebar select.bw-select {
  padding-right: 36px;
  background-position: right 12px center;
}
.bw-filters--sidebar .bw-reset-btn {
  justify-self: start;
  padding: 4px 0;
  font-size: 13px;
}
.bw-filters--sidebar .bw-filter-field--reset {
  margin-top: -4px;
}
.bw-filters--sidebar .bw-filter-field--reset .bw-filter-label {
  visibility: hidden;
}
.bw-date-range {
  position: relative;
}
.booking-card:has(.bw-date-calendar:not([hidden])),
.booking-card:has(.bw-airport-menu:not([hidden])) {
  overflow: visible;
  position: relative;
  z-index: 5;
}
/* Only lift sidebar overflow on desktop. On mobile the sidebar is a
   scrollable bottom sheet — overflow:visible would freeze scrolling
   because .bw-date-calendar is always present in the DOM. */
@media (min-width: 769px) {
  .pdp-sidebar:has(.bw-date-calendar:not([hidden])),
  .pdp-sidebar:has(.bw-airport-menu:not([hidden])) {
    overflow: visible;
    z-index: 5;
  }
}
.bw-date-range-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}
.bw-date-range-trigger svg {
  flex-shrink: 0;
  color: var(--text-muted);
}
.bw-date-calendar {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 300;
  width: min(340px, calc(100vw - 40px));
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(22, 26, 41, 0.18);
}
.bw-date-calendar-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}
.bw-date-nav {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.bw-date-nav:hover {
  background: var(--purple-pale);
  color: var(--purple);
}
.bw-date-hint {
  min-height: 18px;
  margin: -4px 0 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.bw-date-weekdays,
.bw-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.bw-date-weekdays {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}
.bw-date-day {
  min-width: 0;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
}
.bw-date-day.is-muted {
  color: #b6b6b6;
}
.bw-date-day[disabled] {
  color: #c7c7c7;
  cursor: not-allowed;
}
.bw-date-day.is-range {
  background: var(--purple-pale);
  color: var(--purple);
}
.bw-date-day.is-valid-end {
  background: #f0eaff;
  color: var(--purple);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--purple);
}
.bw-date-day.is-start,
.bw-date-day.is-end {
  background: var(--purple);
  color: #fff;
}
.bw-date-day:not([disabled]):hover {
  background: #f7f4fd;
  color: var(--purple);
}
.bw-date-day.is-start:hover,
.bw-date-day.is-end:hover {
  background: var(--purple);
  color: #fff;
}

.bw-airport-dropdown { position: relative; }
.bw-airport-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}
.bw-airport-trigger svg { flex-shrink: 0; color: var(--text-muted); transition: transform 0.15s; }
.bw-airport-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.bw-airport-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 6px 0 0;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
}
.bw-airport-menu[hidden] { display: none; }
.bw-airport-options {
  overflow-y: auto;
  max-height: 220px;
  min-height: 0;
  padding-bottom: 2px;
  overscroll-behavior: contain;
}
.bw-airport-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  margin: 0;
}
.bw-airport-option:hover { background: var(--bg-secondary); }
.bw-airport-option input { cursor: pointer; accent-color: var(--purple); flex-shrink: 0; }
.bw-airport-menu-footer {
  flex-shrink: 0;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.bw-airport-ok {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--purple);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s;
}
.bw-airport-ok:hover { background: var(--purple-mid); }
.bw-filters--sidebar .bw-airport-menu {
  left: auto;
  right: 0;
  width: min(320px, calc(100vw - 40px));
}
@media (min-width: 769px) {
  /* Grow to the full airport list (over the help CTA). Only scroll if
     the list would run off the viewport; OK stays pinned at the bottom. */
  .bw-filters--sidebar .bw-airport-menu {
    max-height: calc(100vh - 120px);
  }
  .bw-filters--sidebar .bw-airport-options {
    max-height: none;
  }
}

@media (max-width: 1024px) {
  .bw-filters--sidebar .bw-filter-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.bw-table-area { position: relative; min-height: 120px; }
/* The `hidden` attribute must win over these display rules — an author
   `display` declaration otherwise overrides the UA `[hidden]{display:none}`,
   which left the spinner + "no results" cover permanently painted over the
   table even when packages loaded fine. */
.bw-loading[hidden],
.bw-refresh-cover[hidden] { display: none !important; }
.bw-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  z-index: 5;
  border-radius: var(--radius-sm);
}
.bw-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--purple-pale);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: bw-spin 0.8s linear infinite;
}
@keyframes bw-spin { to { transform: rotate(360deg); } }

.bw-refresh-cover {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  text-align: center;
}
.bw-refresh-cover p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

/* Summary quirks for the legacy populateSummary() output */
.bw-price-row-val.price span,
.bw-price-row-val.price-hotel span,
.bw-price-row-val.price-flight span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 11px;
  margin-right: 8px;
}
.bw-price-row--bonus { border-bottom: none; padding: 0; }
.bw-price-row--bonus .bw-price-row-label,
.bw-price-row--bonus .bw-price-row-val { padding: 5px 0; }
.negative-price { color: var(--green-booking) !important; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .bw-room-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .bw-room-grid {
    grid-template-columns: 1fr;
  }
  .bw-flight-legs {
    grid-template-columns: 1fr;
    padding: 8px 12px 10px;
  }
  .bw-flight-divider {
    width: 100%;
    height: 1px;
    margin: 8px 0;
  }
  .bw-flight-divider::before,
  .bw-flight-divider::after {
    display: none;
  }
  .bw-flight-leg {
    padding: 0;
  }
  .bw-summary-grid {
    grid-template-columns: 1fr;
  }
  /* Stacked, the details half and the price half both end/start on a grey
     striped row, so they read as one block. Split them with a white gap and
     drop the grey off the price header so the second half starts clean. */
  .bw-summary-col:first-child {
    border-right: none;
    border-bottom: 6px solid var(--bg-card);
  }
  .bw-price-row--package {
    background: none;
    border-bottom: 1px solid var(--border);
  }
  .bw-price-breakdown {
    background: none;
  }
}


/* ─────────────────────────────────────────────────────────────
   MOBILE FULL-SCREEN BOOKING OVERLAY (Phase 4c)

   Desktop: hidden — the inline #booking widget and the sidebar filters
   render unchanged. Mobile: the sticky CTA opens this panel and
   hotel_pdp_shared.js portals [data-bw-filters] + #bw-root (+ help CTA)
   into #bwOverlayBody, giving filters -> prices -> flights -> rooms ->
   summary in one focused screen with a pinned Book bar.
   ───────────────────────────────────────────────────────────── */
.bw-overlay { display: none; }

@media (max-width: 768px) {
  /* Height is 100dvh, NOT inset:0 / 100vh. On iOS, `vh` and the layout
     viewport are always the LARGE viewport (browser toolbars hidden), so a
     fixed inset:0 box is ~one toolbar too tall while the toolbars are
     showing: the overlay header scrolls off the top and the book bar sits
     below the fold. `dvh` tracks the visible area and is updated by the
     browser itself as the toolbars collapse and expand — no JS pinning, and
     nothing to lag a frame behind the toolbar animation. */
  .bw-overlay {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh; /* fallback: pre-iOS 15.4 */
    height: 100dvh;
    z-index: 1002;
    background: var(--bg-card, #fff);
    box-sizing: border-box;
    transform: translate3d(0, 100%, 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s ease, visibility .28s;
  }
  .bw-overlay.is-open {
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }

  .bw-overlay-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card, #fff);
  }
  .bw-overlay-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 6px 4px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
  }
  .bw-overlay-back svg { flex: 0 0 auto; }
  .bw-overlay-title {
    margin-left: auto;
    font-family: var(--font-serif, inherit);
    font-size: 16px;
    color: var(--text-primary);
  }

  .bw-overlay-body {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 14px 16px 20px;
  }
  /* Filters read as a self-contained card at the top of the panel.
     Date + travellers share a row; airport and reset stay full width. */
  .bw-overlay-body .bw-filters--sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
    gap: 10px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
  }
  .bw-overlay-body .bw-filters--sidebar .bw-filter-field {
    grid-template-columns: 1fr;
    gap: 5px;
    min-width: 0;
  }
  .bw-overlay-body .bw-filter-field--airport,
  .bw-overlay-body .bw-filter-field--reset {
    grid-column: 1 / -1;
  }
  .bw-overlay-body .bw-filters--sidebar .bw-select {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .bw-overlay-body .bw-filters--sidebar select.bw-select {
    padding-right: 30px;
    background-position: right 8px center;
  }
  .bw-overlay-body .bw-date-range-trigger [data-bw-date-label] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Date field is half-width; keep the calendar as wide as the overlay. */
  .bw-overlay-body .bw-date-calendar {
    left: 0;
    right: auto;
    width: min(340px, calc(100vw - 48px));
  }

  /* Duration column: shrink to “19 dagen”, keep sticky month labels aligned. */
  .bw-overlay-body .bw-pricing-table {
    --bw-duration-col-w: 3.25rem;
  }
  .bw-overlay-body .bw-pricing-table thead th.bw-pt-corner,
  .bw-overlay-body .bw-pricing-table tbody th {
    min-width: var(--bw-duration-col-w);
    width: var(--bw-duration-col-w);
    max-width: var(--bw-duration-col-w);
    box-sizing: border-box;
    padding-left: 2px;
    padding-right: 6px;
  }
  .bw-overlay-body .bw-month-label-text {
    left: var(--bw-duration-col-w);
    padding-left: 2px;
  }

  .bw-overlay-book {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--bg-card, #fff);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
  }
  .bw-overlay-book-price { display: flex; flex-direction: column; line-height: 1.15; }
  .bw-overlay-book-from {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
  }
  .bw-overlay-book-amount {
    font-family: var(--font-serif, inherit);
    font-size: 20px;
    color: var(--text-primary);
    white-space: nowrap;
  }
  /* Scroll lock while the overlay is open. Deliberately `overflow: hidden`
     only — NOT the page CSS's `body.has-sheet-open`, which also sets
     `position: fixed` and so resets the document to 0. Keeping the document
     in place means closing needs no scroll restore at all (and avoids the
     smooth-scroll / history-scroll-restoration fight that caused). The overlay
     itself is fixed and opaque, and its body uses overscroll-behavior:contain,
     so the page behind cannot scroll or chain. */
  html.has-bw-overlay-open,
  body.has-bw-overlay-open { overflow: hidden; }
  body.has-bw-overlay-open .pdp-mobile-cta { display: none !important; }

  .bw-overlay-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--purple);
    color: #fff;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    padding: 13px 22px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(61, 31, 140, .35);
  }

  /* The booking widget now lives only inside the overlay on mobile — hide the
     inline section and the old bottom-sheet sidebar so nothing double-renders.
     Gated on body.has-bw-overlay (added by hotel_pdp_shared.js only after a
     successful init) so that (a) pages without the priced widget — the
     roundtrip "request a quote" case — keep their inline #booking + sidebar,
     and (b) if the script fails, the page degrades to the inline widget rather
     than trapping it inside a hidden section. */
  body.has-bw-overlay #booking { display: none !important; }
  body.has-bw-overlay .pdp-sidebar { display: none !important; }
}
