/**
 * BusPress public booking experience (search-first).
 * Fully self-contained and scoped under .buspress-booking. Every element is
 * explicitly styled and resets inherited theme/Elementor rules so the widget
 * looks identical on any site.
 */

.buspress-booking {
	--bp-font: 'Onest';
	--bp-primary: #1DB954;
	--bp-primary-dark: #15a049;
	--bp-on-primary: #ffffff;
	--bp-text: #14161a;
	--bp-text-soft: #3f444b;
	--bp-muted: #6b7280;
	--bp-faint: #9aa1ab;
	--bp-border: #e3e6ea;
	--bp-surface: #ffffff;
	--bp-bg: #f3f5f7;
	--bp-radius: 16px;
	--bp-danger: #e23b3b;
	--bp-shadow: 0 10px 30px rgba(20, 22, 26, .10);
	--bp-shadow-sm: 0 2px 10px rgba(20, 22, 26, .06);

	max-width: 1000px;
	margin: 0 auto;
	position: relative;
	color: var(--bp-text);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}

/* ---- Hard reset (defeats theme/Elementor inheritance) -------------------- */
.buspress-booking,
.buspress-booking *,
.buspress-booking *::before,
.buspress-booking *::after {
	box-sizing: border-box;
	font-family: var(--bp-font), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}
.buspress-booking [hidden] { display: none !important; }
.buspress-booking h3 { margin: 0; padding: 0; font-weight: 700; color: var(--bp-text); }
.buspress-booking button,
.buspress-booking input {
	margin: 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	font-weight: 400;
	color: var(--bp-text);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	outline: none;
}
.buspress-booking button { cursor: pointer; text-align: left; width: auto; }
.buspress-booking input::placeholder { color: var(--bp-faint); opacity: 1; }

/* ---- Search bar ---------------------------------------------------------- */
.buspress-booking .bp-search {
	background: var(--bp-surface);
	border: 1px solid var(--bp-border);
	border-radius: var(--bp-radius);
	box-shadow: var(--bp-shadow);
	padding: 18px;
}
.buspress-booking .bp-search__type { display: flex; gap: 8px; margin: 0 0 16px; }
.buspress-booking .bp-pill {
	display: inline-flex; align-items: center; gap: 8px;
	margin: 0; padding: 8px 18px; border-radius: 999px; cursor: pointer;
	font-size: 14px; font-weight: 400; color: var(--bp-muted);
	background: var(--bp-bg); transition: background .15s, color .15s; user-select: none;
}
.buspress-booking .bp-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.buspress-booking .bp-pill.is-active { background: color-mix(in srgb, var(--bp-primary) 15%, #fff); color: var(--bp-primary-dark); font-weight: 600; }

.buspress-booking .bp-search__row { display: flex; flex-direction: column; gap: 10px; }
.buspress-booking .bp-search__od { display: flex; gap: 10px; align-items: stretch; }
.buspress-booking .bp-search__when { display: flex; gap: 10px; align-items: stretch; }
.buspress-booking .bp-search__od .bp-ac { flex: 1 1 0; }
.buspress-booking .bp-search__when .bp-field2 { flex: 1 1 0; }

.buspress-booking .bp-field2 {
	position: relative;
	display: flex; flex-direction: column; justify-content: center;
	min-width: 0; padding: 10px 16px; min-height: 60px;
	background: var(--bp-surface);
	border: 1.5px solid var(--bp-border); border-radius: 12px;
	transition: border-color .15s, box-shadow .15s;
}
.buspress-booking .bp-field2:focus-within { border-color: var(--bp-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-primary) 18%, transparent); }
.buspress-booking .bp-field2.is-disabled { background: var(--bp-bg); border-style: dashed; }
.buspress-booking .bp-field2.is-disabled .bp-field2__btn { color: var(--bp-faint); cursor: default; }

.buspress-booking .bp-field2__label {
	display: block; margin: 0 0 3px; padding: 0;
	font-size: 12px; font-weight: 400; color: var(--bp-muted); line-height: 1.2;
}
.buspress-booking .bp-field2__input,
.buspress-booking .bp-field2__btn {
	width: 100%; padding: 0; border: 0; background: transparent;
	font-size: 15.5px; font-weight: 600; color: var(--bp-text); line-height: 1.3;
}
.buspress-booking .bp-field2__input { cursor: text; }
.buspress-booking .bp-field2__btn { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Swap button — always clearly visible */
.buspress-booking .bp-swap {
	flex: 0 0 auto; align-self: center;
	width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important;
	padding: 0 !important; border-radius: 50% !important;
	border: 1.5px solid var(--bp-border); background: var(--bp-surface);
	color: var(--bp-muted); box-shadow: var(--bp-shadow-sm);
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer; transition: color .18s ease, border-color .18s ease, transform .25s ease;
}
.buspress-booking .bp-swap:hover { color: var(--bp-primary); border-color: var(--bp-primary); transform: rotate(180deg); }
.buspress-booking .bp-swap svg { display: block; width: 18px; height: 18px; }

.buspress-booking .bp-search__btn {
	flex: 0 0 auto; align-self: stretch; min-height: 60px; padding: 0 30px;
	border: 0; border-radius: 12px; background: var(--bp-primary); color: var(--bp-on-primary);
	font-size: 15.5px; font-weight: 600; cursor: pointer; transition: background .15s; text-align: center;
}
.buspress-booking .bp-search__btn:hover { background: var(--bp-primary-dark); }

/* ---- Autocomplete -------------------------------------------------------- */
.buspress-booking .bp-ac__list {
	position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
	background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 12px;
	box-shadow: var(--bp-shadow); max-height: 280px; overflow-y: auto; padding: 6px; margin: 0;
}
.buspress-booking .bp-ac__item {
	display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 12px;
	border-radius: 9px; cursor: pointer; font-size: 15px; font-weight: 400; color: var(--bp-text);
}
.buspress-booking .bp-ac__item:hover { background: var(--bp-bg); }
.buspress-booking .bp-ac__item svg { color: var(--bp-faint); flex: 0 0 auto; }
.buspress-booking .bp-ac__empty { margin: 0; padding: 14px; color: var(--bp-muted); font-size: 14px; text-align: center; }

/* ---- Passengers popover -------------------------------------------------- */
.buspress-booking .bp-pax__pop {
	position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; width: 248px;
	background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 12px;
	box-shadow: var(--bp-shadow); padding: 8px 16px; margin: 0;
}
.buspress-booking .bp-pax__row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.buspress-booking .bp-pax__row + .bp-pax__row { border-top: 1px solid var(--bp-border); }
.buspress-booking .bp-pax__row > span { font-weight: 400; font-size: 15px; }
.buspress-booking .bp-stepper { display: flex; align-items: center; gap: 14px; }
.buspress-booking .bp-stepper button {
	width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important;
	flex: 0 0 auto; padding: 0 !important; border-radius: 50% !important;
	border: 1.5px solid var(--bp-border); background: var(--bp-surface);
	font-size: 19px; font-weight: 600; line-height: 1; color: var(--bp-text);
	display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
	transition: border-color .18s ease, color .18s ease, transform .12s ease;
}
.buspress-booking .bp-stepper button:active:not(:disabled) { transform: scale(.92); }
.buspress-booking .bp-stepper button:hover:not(:disabled) { border-color: var(--bp-primary); color: var(--bp-primary); }
.buspress-booking .bp-stepper button:disabled { opacity: .4; cursor: not-allowed; }
.buspress-booking .bp-stepper > span { min-width: 18px; text-align: center; font-weight: 600; font-size: 16px; }

/* ---- Calendar ------------------------------------------------------------ */
.buspress-booking .bp-cal {
	position: absolute; z-index: 70; width: 320px;
	background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 16px;
	box-shadow: var(--bp-shadow); padding: 16px;
}
.buspress-booking .bp-cal__head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.buspress-booking .bp-cal__title { font-weight: 600; font-size: 16px; color: var(--bp-text); }
.buspress-booking .bp-cal__nav {
	width: 36px; height: 36px; padding: 0; border-radius: 10px; border: 1.5px solid var(--bp-border);
	background: var(--bp-surface); cursor: pointer; color: var(--bp-text); font-size: 18px; line-height: 1;
	display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.buspress-booking .bp-cal__nav:hover:not(:disabled) { border-color: var(--bp-primary); color: var(--bp-primary); }
.buspress-booking .bp-cal__nav:disabled { opacity: .3; cursor: not-allowed; }
.buspress-booking .bp-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.buspress-booking .bp-cal__dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--bp-faint); padding: 2px 0 6px; }
.buspress-booking .bp-cal__day {
	height: 38px; padding: 0; border: 0; background: transparent; border-radius: 10px; cursor: pointer;
	font-size: 14px; font-weight: 400; color: var(--bp-text);
	display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s;
}
.buspress-booking .bp-cal__day:hover:not(:disabled):not(.is-selected) { background: var(--bp-bg); }
.buspress-booking .bp-cal__day:disabled { color: #cdd2d8; cursor: not-allowed; }
.buspress-booking .bp-cal__day.is-today { box-shadow: inset 0 0 0 1.5px var(--bp-border); }
.buspress-booking .bp-cal__day.is-selected { background: var(--bp-primary); color: var(--bp-on-primary); }
.buspress-booking .bp-cal__day.is-empty { visibility: hidden; }

/* ---- Results ------------------------------------------------------------- */
.buspress-booking .bp-results { margin-top: 24px; }
.buspress-booking .bp-leg + .bp-leg { margin-top: 28px; }
.buspress-booking .bp-leg__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 14px; }
.buspress-booking .bp-leg__title { font-size: 19px; font-weight: 700; }
.buspress-booking .bp-leg__sub { color: var(--bp-muted); font-size: 14px; }
.buspress-booking .bp-trips { display: flex; flex-direction: column; gap: 12px; }

.buspress-booking .bp-trip {
	display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center;
	background: var(--bp-surface); border: 1.5px solid var(--bp-border); border-radius: 14px; padding: 18px 22px;
	transition: border-color .15s, box-shadow .15s;
}
.buspress-booking .bp-trip.is-selected { border-color: var(--bp-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-primary) 22%, transparent); }
.buspress-booking .bp-trip.is-soldout { opacity: .55; }

.buspress-booking .bp-trip__route { display: flex; align-items: flex-start; gap: 16px; }
.buspress-booking .bp-trip__pt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.buspress-booking .bp-trip__pt--end { align-items: flex-end; text-align: right; }
.buspress-booking .bp-trip__time { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bp-text); line-height: 1.05; }
.buspress-booking .bp-trip__city { font-size: 15px; font-weight: 400; color: var(--bp-text-soft); }
.buspress-booking .bp-trip__mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 72px; padding-top: 4px; }
.buspress-booking .bp-trip__dur { font-size: 12px; color: var(--bp-muted); white-space: nowrap; }
.buspress-booking .bp-trip__line { width: 100%; height: 2px; background: var(--bp-border); position: relative; }
.buspress-booking .bp-trip__line::before { content: ''; position: absolute; left: -1px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bp-primary); }
.buspress-booking .bp-trip__line::after { content: ''; position: absolute; right: -1px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bp-primary); }
.buspress-booking .bp-trip__company { font-size: 12px; color: var(--bp-muted); white-space: nowrap; }
.buspress-booking .bp-trip__next { color: var(--bp-danger); font-weight: 700; font-size: 12px; vertical-align: super; }

.buspress-booking .bp-trip__buy { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.buspress-booking .bp-trip__price { font-size: 23px; font-weight: 700; color: var(--bp-text); white-space: nowrap; }
.buspress-booking .bp-trip__seats { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.buspress-booking .bp-trip__seats.is-low { color: var(--bp-danger); }
.buspress-booking .bp-trip__seats.is-ok { color: var(--bp-muted); }
.buspress-booking .bp-trip__select {
	border: 1.5px solid var(--bp-primary); background: transparent; color: var(--bp-primary-dark);
	border-radius: 10px; padding: 9px 20px; font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s; text-align: center;
}
.buspress-booking .bp-trip.is-selected .bp-trip__select,
.buspress-booking .bp-trip__select:hover { background: var(--bp-primary); color: var(--bp-on-primary); }
.buspress-booking .bp-trip__select:disabled { opacity: 1; cursor: not-allowed; border-color: var(--bp-border); color: var(--bp-faint); background: transparent; }
.buspress-booking .bp-empty { background: var(--bp-surface); border: 1.5px dashed var(--bp-border); border-radius: 14px; padding: 30px; text-align: center; color: var(--bp-muted); font-weight: 400; }

/* ---- Checkout ------------------------------------------------------------ */
.buspress-booking .bp-checkout { margin-top: 24px; }
.buspress-booking .bp-checkout__title { font-size: 19px; font-weight: 700; margin: 0 0 18px; }
.buspress-booking .bp-checkout__grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.buspress-booking .bp-pax-form { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 16px; padding: 22px; }
.buspress-booking .bp-field3 { margin-bottom: 16px; }
.buspress-booking .bp-field3-row { display: flex; gap: 16px; }
.buspress-booking .bp-field3-row .bp-field3 { flex: 1; }
.buspress-booking .bp-field3 label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 400; color: var(--bp-muted); }
.buspress-booking .bp-field3 input {
	width: 100%; padding: 12px 14px; border: 1.5px solid var(--bp-border); border-radius: 11px;
	font-size: 15px; font-weight: 400; color: var(--bp-text); background: var(--bp-surface); line-height: 1.4;
}
.buspress-booking .bp-field3 input:focus { border-color: var(--bp-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-primary) 18%, transparent); }

/* Phone: country flag + dial-code dropdown */
.buspress-booking .bp-phone { position: relative; display: flex; align-items: stretch; border: 1.5px solid var(--bp-border); border-radius: 11px; background: var(--bp-surface); }
.buspress-booking .bp-phone:focus-within { border-color: var(--bp-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-primary) 18%, transparent); }
.buspress-booking .bp-phone__cc { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; background: transparent; border: 0; border-right: 1.5px solid var(--bp-border); border-radius: 11px 0 0 11px; cursor: pointer; color: var(--bp-text); }
.buspress-booking .bp-phone__cc:hover { background: var(--bp-bg); }
.buspress-booking .bp-phone__flag { display: inline-flex; line-height: 0; }
.buspress-booking .bp-phone__flag-img { width: 28px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); display: block; }
.buspress-booking .bp-phone__dial { font-weight: 600; font-size: 14px; }
.buspress-booking .bp-phone__caret { color: var(--bp-muted); font-size: 15px; }
.buspress-booking .bp-phone input#bp-phone { flex: 1 1 auto; width: auto; min-width: 0; border: 0 !important; border-radius: 0 11px 11px 0; box-shadow: none !important; background: transparent; }
/* The dropdown is portaled to <body> in JS (so no theme wrapper / footer can
   cover it). These rules are intentionally UNSCOPED; brand CSS vars are copied
   onto the element in JS so var() still resolves, with literal fallbacks. */
.bp-phone__list { position: fixed; z-index: 2147483000; background: var(--bp-surface, #fff); border: 1px solid var(--bp-border, #e3e6ea); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .2); overflow: hidden; box-sizing: border-box; font-family: var(--bp-font, inherit), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.bp-phone__list[hidden] { display: none !important; }
.bp-phone__search { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--bp-border, #e3e6ea); font-size: 14px; background: var(--bp-bg, #f3f5f7); color: var(--bp-text, #14161a); outline: none; }
.bp-phone__items { max-height: 240px; overflow-y: auto; }
.bp-phone__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--bp-text, #14161a); text-align: left; }
.bp-phone__item:hover { background: var(--bp-bg, #f3f5f7); }
.bp-phone__item .bp-phone__flag-img { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); flex: 0 0 auto; }
.bp-phone__name { flex: 1; text-transform: none; font-weight: 400; }
.bp-phone__code { color: var(--bp-muted, #6b7280); font-weight: 600; }

.buspress-booking .bp-summary { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 16px; padding: 22px; position: sticky; top: 16px; }
.buspress-booking .bp-summary__leg { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--bp-border); }
.buspress-booking .bp-summary__tag { font-size: 12px; font-weight: 600; color: var(--bp-primary-dark); }
.buspress-booking .bp-summary__route { font-weight: 600; font-size: 15.5px; color: var(--bp-text-soft); margin: 5px 0 3px; }
.buspress-booking .bp-summary__when { font-size: 13.5px; color: var(--bp-muted); }
.buspress-booking .bp-summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--bp-muted); margin-top: 8px; }
.buspress-booking .bp-summary__total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--bp-border); }
.buspress-booking .bp-summary__total span:last-child { color: var(--bp-primary-dark); }
/* Avoid a double divider: drop the bottom border on the leg directly before the
   total so the total's own top border is the single separator. */
.buspress-booking .bp-summary__leg:has(+ .bp-summary__total) { border-bottom: 0; padding-bottom: 0; margin-bottom: 2px; }

.buspress-booking .bp-checkout__actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.buspress-booking .bp-btn-primary { border: 0; background: var(--bp-primary); color: var(--bp-on-primary); border-radius: 12px; padding: 14px 28px; font-weight: 600; font-size: 15.5px; cursor: pointer; text-align: center; transition: background .15s; }
.buspress-booking .bp-btn-primary:hover { background: var(--bp-primary-dark); }
.buspress-booking .bp-btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.buspress-booking .bp-btn-ghost { border: 1.5px solid var(--bp-border); background: transparent; color: var(--bp-text-soft); border-radius: 12px; padding: 14px 24px; font-weight: 600; font-size: 15px; cursor: pointer; }
.buspress-booking .bp-btn-ghost:hover { border-color: var(--bp-muted); }

/* ---- Alert / overlay ----------------------------------------------------- */
.buspress-booking .bp-alert {
	margin-top: 16px; padding: 13px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
	background: color-mix(in srgb, var(--bp-danger) 9%, #fff);
	border: 1px solid color-mix(in srgb, var(--bp-danger) 30%, transparent); color: var(--bp-danger);
}
.buspress-booking .bp-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, .55); display: flex; align-items: center; justify-content: center; z-index: 100; }
.buspress-booking .bp-spinner { width: 42px; height: 42px; border: 4px solid var(--bp-border); border-top-color: var(--bp-primary); border-radius: 50%; animation: bp-spin .7s linear infinite; }
@keyframes bp-spin { to { transform: rotate(360deg); } }

/* ---- Motion -------------------------------------------------------------- */
@keyframes bp-pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes bp-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bp-fade { from { opacity: 0; } to { opacity: 1; } }

.buspress-booking .bp-cal,
.buspress-booking .bp-pax__pop,
.buspress-booking .bp-ac__list { animation: bp-pop .17s cubic-bezier(.22, 1, .36, 1) both; transform-origin: top center; }
.buspress-booking .bp-results,
.buspress-booking .bp-checkout { animation: bp-fade-up .26s cubic-bezier(.22, 1, .36, 1) both; }
.buspress-booking .bp-trip { animation: bp-fade-up .28s cubic-bezier(.22, 1, .36, 1) both; }
.buspress-booking .bp-trips .bp-trip:nth-child(2) { animation-delay: .04s; }
.buspress-booking .bp-trips .bp-trip:nth-child(3) { animation-delay: .08s; }
.buspress-booking .bp-trips .bp-trip:nth-child(4) { animation-delay: .12s; }
.buspress-booking .bp-trips .bp-trip:nth-child(n+5) { animation-delay: .16s; }
.buspress-booking .bp-alert { animation: bp-fade .2s ease both; }

.buspress-booking .bp-trip { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.buspress-booking .bp-trip:hover { border-color: color-mix(in srgb, var(--bp-primary) 45%, var(--bp-border)); transform: translateY(-2px); box-shadow: var(--bp-shadow-sm); }
.buspress-booking .bp-search__btn, .buspress-booking .bp-btn-primary { transition: background .18s ease, transform .12s ease, box-shadow .18s ease; }
.buspress-booking .bp-search__btn:hover, .buspress-booking .bp-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px color-mix(in srgb, var(--bp-primary) 35%, transparent); }
.buspress-booking .bp-search__btn:active, .buspress-booking .bp-btn-primary:active { transform: translateY(0); }
.buspress-booking .bp-trip__select { transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease; }
.buspress-booking .bp-trip__select:active:not(:disabled) { transform: scale(.96); }
.buspress-booking .bp-pill { transition: background .18s ease, color .18s ease; }
.buspress-booking .bp-ac__item { transition: background .12s ease; }
.buspress-booking .bp-cal__day { transition: background .12s ease, color .12s ease; }

@media (prefers-reduced-motion: reduce) {
	.buspress-booking *, .buspress-booking *::before, .buspress-booking *::after { animation: none !important; transition: none !important; }
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 820px) {
	.buspress-booking .bp-search__when { flex-wrap: wrap; }
	.buspress-booking .bp-search__when .bp-field2 { flex: 1 1 calc(50% - 5px); }
	.buspress-booking .bp-search__btn { flex: 1 1 100%; }
	.buspress-booking .bp-checkout__grid { grid-template-columns: 1fr; }
	.buspress-booking .bp-summary { position: static; }
}
@media (max-width: 560px) {
	.buspress-booking .bp-search__od { flex-direction: column; }
	.buspress-booking .bp-swap { transform: rotate(90deg); margin: -3px auto; }
	.buspress-booking .bp-swap:hover { transform: rotate(270deg); }
	.buspress-booking .bp-search__when .bp-field2 { flex: 1 1 100%; }
	.buspress-booking .bp-trip { grid-template-columns: 1fr; gap: 14px; }
	.buspress-booking .bp-trip__buy { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
	.buspress-booking .bp-trip__select { padding: 9px 16px; }
}

/* ---- Step indicator (return trips) -------------------------------------- */
.buspress-booking .bp-steps { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; }
.buspress-booking .bp-step {
	display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px;
	background: var(--bp-bg); border: 1.5px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.buspress-booking .bp-step:disabled { opacity: .5; cursor: default; }
.buspress-booking .bp-step__num {
	width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: var(--bp-faint); color: #fff;
	font-size: 12.5px; font-weight: 700; line-height: 1; text-align: center;
	display: inline-flex; align-items: center; justify-content: center; transition: background .15s;
}
.buspress-booking .bp-step__txt { font-size: 14.5px; font-weight: 400; color: var(--bp-muted); }
.buspress-booking .bp-step.is-active { background: color-mix(in srgb, var(--bp-primary) 14%, #fff); border-color: color-mix(in srgb, var(--bp-primary) 35%, transparent); }
.buspress-booking .bp-step.is-active .bp-step__num { background: var(--bp-primary); }
.buspress-booking .bp-step.is-active .bp-step__txt { color: var(--bp-primary-dark); font-weight: 600; }
/* Completed step: swap the digit for a slightly smaller, balanced check. */
.buspress-booking .bp-step.is-done .bp-step__num { background: var(--bp-primary); font-size: 0; line-height: 0; }
.buspress-booking .bp-step.is-done .bp-step__num::after {
	content: '✓'; font-size: 11px; line-height: 1; font-weight: 700;
	display: block; transform: translateY(.5px);
}
.buspress-booking .bp-steps__sep { flex: 1 1 auto; max-width: 60px; height: 2px; background: var(--bp-border); border-radius: 2px; }

.buspress-booking .bp-leg__back {
	order: -1; flex: 1 1 100%; display: inline-flex; align-items: center; gap: 5px; margin: 0 0 4px; padding: 0;
	background: transparent; border: 0; color: var(--bp-primary-dark); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.buspress-booking .bp-leg__back:hover { text-decoration: underline; }
.buspress-booking .bp-leg__back svg { display: block; }

/* Chosen-outbound recap above the return list */
.buspress-booking .bp-recap {
	display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 16px;
	background: color-mix(in srgb, var(--bp-primary) 8%, #fff);
	border: 1.5px solid color-mix(in srgb, var(--bp-primary) 28%, transparent); border-radius: 12px;
}
.buspress-booking .bp-recap__ico { color: var(--bp-primary-dark); flex: 0 0 auto; }
.buspress-booking .bp-recap__body { flex: 1 1 auto; min-width: 0; }
.buspress-booking .bp-recap__tag { font-size: 12px; font-weight: 600; color: var(--bp-primary-dark); text-transform: uppercase; letter-spacing: .02em; }
.buspress-booking .bp-recap__route { font-size: 15px; font-weight: 400; color: var(--bp-text-soft); margin-top: 1px; }
.buspress-booking .bp-recap__route strong { font-weight: 600; color: var(--bp-text); }
.buspress-booking .bp-recap__price { font-size: 17px; font-weight: 700; color: var(--bp-text); white-space: nowrap; }

/* Clickable result cards open the detail panel */
.buspress-booking .bp-trip { cursor: pointer; }

/* ---- Trip detail panel (portaled to <body>, so styles are UNSCOPED) ----- */
.bp-detail-backdrop {
	position: fixed; inset: 0; z-index: 2147483200; background: rgba(20, 22, 26, .42);
	opacity: 0; transition: opacity .24s ease; -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.bp-detail-backdrop.is-open { opacity: 1; }
.bp-detail-backdrop[hidden] { display: none !important; }

.bp-detail {
	position: fixed; top: 0; right: 0; z-index: 2147483201; height: 100%; width: 420px; max-width: 92vw;
	display: flex; flex-direction: column; background: var(--bp-surface, #fff); color: var(--bp-text, #14161a);
	box-shadow: -16px 0 40px rgba(0, 0, 0, .22); transform: translateX(100%); transition: transform .26s cubic-bezier(.22, 1, .36, 1);
	font-family: var(--bp-font, inherit), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.bp-detail.is-open { transform: translateX(0); }
.bp-detail[hidden] { display: none !important; }
.bp-detail *, .bp-detail *::before, .bp-detail *::after { box-sizing: border-box; }
/* The panel is portaled to <body>, outside the scoped reset, so neutralise any
   theme button styling that would otherwise bleed in. */
.bp-detail button {
	margin: 0; -webkit-appearance: none; -moz-appearance: none; appearance: none;
	font-family: inherit; line-height: 1.4; letter-spacing: normal; text-transform: none;
	box-shadow: none; outline: none; text-decoration: none;
}

.bp-detail__head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--bp-border, #e3e6ea); }
.bp-detail__title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; font-weight: 400; line-height: 1.3; color: var(--bp-text-soft, #3f444b); }
.bp-detail__title strong { font-weight: 700; color: var(--bp-text, #14161a); }
.bp-detail__arrow { color: var(--bp-muted, #6b7280); margin: 0 2px; }
/* Circular close button, mirroring the search "swap destinations" control. */
.bp-detail__close {
	flex: 0 0 auto; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0;
	border-radius: 50%; border: 1.5px solid var(--bp-border, #e3e6ea);
	background: var(--bp-surface, #fff); color: var(--bp-muted, #6b7280); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	box-shadow: 0 2px 10px rgba(20, 22, 26, .06); transition: color .18s ease, border-color .18s ease, transform .25s ease;
}
.bp-detail__close:hover { color: var(--bp-danger, #e23b3b); border-color: var(--bp-danger, #e23b3b); transform: rotate(90deg); }
.bp-detail__close svg { display: block; width: 20px; height: 20px; }

.bp-detail__body { flex: 1 1 auto; overflow-y: auto; padding: 20px 22px; }
.bp-detail__meta { display: flex; flex-direction: column; gap: 0; }
.bp-detail__row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--bp-border, #e3e6ea); }
.bp-detail__row:last-child { border-bottom: 0; }
.bp-detail__k { font-size: 13.5px; font-weight: 400; color: var(--bp-muted, #6b7280); }
.bp-detail__v { font-size: 14.5px; font-weight: 600; color: var(--bp-text, #14161a); text-align: right; }
.bp-detail__next { color: var(--bp-danger, #e23b3b); font-weight: 700; font-size: 12px; vertical-align: super; }

.bp-detail__section { margin: 22px 0 12px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bp-muted, #6b7280); }
.bp-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.bp-timeline::before { content: ''; position: absolute; left: 52px; top: 12px; bottom: 12px; width: 2px; background: var(--bp-border, #e3e6ea); }
.bp-timeline__row { display: flex; align-items: center; gap: 12px; padding: 7px 0; position: relative; }
.bp-timeline__time { flex: 0 0 42px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bp-text, #14161a); text-align: right; }
.bp-timeline__row::after { content: ''; position: absolute; left: 48px; width: 10px; height: 10px; border-radius: 50%; background: var(--bp-surface, #fff); border: 2px solid var(--bp-faint, #9aa1ab); }
.bp-timeline__row.is-end::after { border-color: var(--bp-primary, #1DB954); background: var(--bp-primary, #1DB954); }
.bp-timeline__name { flex: 1 1 auto; margin-left: 20px; font-size: 14.5px; font-weight: 400; color: var(--bp-text-soft, #3f444b); }
.bp-timeline__row.is-end .bp-timeline__name { font-weight: 600; color: var(--bp-text, #14161a); }
.bp-timeline__pin {
	flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
	color: var(--bp-primary-dark, #15a049); background: color-mix(in srgb, var(--bp-primary, #1DB954) 12%, #fff); text-decoration: none; transition: background .15s;
}
.bp-timeline__pin:hover { background: color-mix(in srgb, var(--bp-primary, #1DB954) 22%, #fff); }

.bp-detail__foot { flex: 0 0 auto; display: flex; align-items: center; gap: 20px; padding: 16px 22px; border-top: 1px solid var(--bp-border, #e3e6ea); }
.bp-detail__price { display: flex; flex-direction: column; line-height: 1.15; }
.bp-detail__price span { font-size: 12px; font-weight: 400; color: var(--bp-muted, #6b7280); }
.bp-detail__price strong { font-size: 22px; font-weight: 700; color: var(--bp-text, #14161a); }
.bp-detail__select {
	flex: 1 1 auto; border: 0; border-radius: 12px; padding: 14px 24px; background: var(--bp-primary, #1DB954); color: var(--bp-on-primary, #fff);
	font-size: 15.5px; font-weight: 600; cursor: pointer; text-align: center; font-family: inherit;
	transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.bp-detail__select:hover:not(:disabled) {
	background: var(--bp-primary-dark, #15a049); color: var(--bp-on-primary, #fff);
	transform: translateY(-1px); box-shadow: 0 8px 20px color-mix(in srgb, var(--bp-primary, #1DB954) 35%, transparent);
}
.bp-detail__select:active:not(:disabled) { transform: translateY(0) scale(.99); box-shadow: none; }
.bp-detail__select:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 560px) {
	.bp-detail { width: 100%; max-width: 100%; }
	.buspress-booking .bp-steps__sep { max-width: 28px; }
	.buspress-booking .bp-step { padding: 7px 11px; }
}

/* ---- Responsive refinements (checkout + results, phones) ----------------- */
@media (max-width: 820px) {
	/* Form spans full width once the summary drops below it. */
	.buspress-booking .bp-checkout__grid { gap: 16px; }
}

@media (max-width: 560px) {
	/* Search + results breathing room */
	.buspress-booking .bp-search { padding: 14px; }
	.buspress-booking .bp-results { margin-top: 18px; }
	.buspress-booking .bp-trip { padding: 16px; }
	.buspress-booking .bp-trip__price { font-size: 21px; }

	/* Checkout: stop cramming the two-up fields + action buttons */
	.buspress-booking .bp-checkout { margin-top: 18px; }
	.buspress-booking .bp-checkout__title { font-size: 18px; margin-bottom: 14px; }
	.buspress-booking .bp-pax-form,
	.buspress-booking .bp-summary { padding: 16px; }
	.buspress-booking .bp-field3-row { flex-direction: column; gap: 0; }
	.buspress-booking .bp-field3-row .bp-field3 { margin-bottom: 16px; }
	.buspress-booking .bp-field3-row .bp-field3:last-child { margin-bottom: 0; }

	/* Stack actions; primary on top, both full width and easy to tap */
	.buspress-booking .bp-checkout__actions { flex-direction: column-reverse; gap: 10px; margin-top: 16px; }
	.buspress-booking .bp-checkout__actions .bp-btn-primary,
	.buspress-booking .bp-checkout__actions .bp-btn-ghost { width: 100%; padding: 14px 20px; text-align: center; }

	/* Summary: slightly tighter type */
	.buspress-booking .bp-summary__total { font-size: 18px; }
	.buspress-booking .bp-recap__price { font-size: 16px; }

	/* Trip card route connector a touch tighter so cities keep room */
	.buspress-booking .bp-trip__route { gap: 10px; }
	.buspress-booking .bp-trip__mid { min-width: 56px; }
}

@media (max-width: 400px) {
	.buspress-booking .bp-pax-form,
	.buspress-booking .bp-summary { padding: 14px; }
	.buspress-booking .bp-trip { padding: 14px; }
	.buspress-booking .bp-trip__time { font-size: 18px; }
	.buspress-booking .bp-trip__price { font-size: 20px; }
	.buspress-booking .bp-trip__buy { gap: 10px; }
	/* If price + seats + Select get too tight, let the Select drop to its own row */
	.buspress-booking .bp-trip__buy { flex-wrap: wrap; row-gap: 10px; }
	.buspress-booking .bp-trip__select { flex: 1 1 100%; }
	.buspress-booking .bp-step__txt { font-size: 13.5px; }
	.bp-detail__head { padding: 16px; }
	.bp-detail__body { padding: 16px; }
	.bp-detail__foot { padding: 14px 16px; gap: 10px; }
}
