/**
 * Busly — booking.css
 * Presentation-only skin over the Bus Ticket Booking with Seat Reservation
 * plugin's REAL rendered markup (.wbtm_*, .mp_seat, .wtbm_*). No plugin
 * template is duplicated here — see templates/README.md. Every selector
 * below targets a class name confirmed in the plugin's own PHP/CSS, so
 * this file only ever changes appearance, never behaviour.
 *
 * If a future plugin update renames one of these classes, only this file
 * needs a follow-up patch — booking logic itself is never at risk.
 */

/* ══════════════════════════════════════════════════════════════════
   0. CONTAINER — the plugin's own `.wbtm_container` (wbtm_global.css)
   ══════════════════════════════════════════════════════════════════
   Hard-coded to `width:1340px;max-width:1340px` with NO auto-centering
   by default (centering is only added for `body.single-wbtm_bus`) — wider
   than our own 1180px `.wrap` and left-aligned rather than centered
   wherever it renders inside one (e.g. the homepage search widget),
   producing extra/uneven whitespace and left-edge misalignment. Since our
   own `.wrap` already provides the correct width/centering one level up,
   the plugin's container just needs to fill it edge-to-edge here.
   ══════════════════════════════════════════════════════════════════ */
/* Unqualified (not `.wrap > .wbtm_container`): the plugin's own standalone
   search-form page nests this several levels deeper (.wrap > .busly-content-grid
   > .busly-content-col > .busly-entry-content > .wbtm_container), so a
   direct-child selector silently never matched there and this override only
   ever reached the homepage widget instance. */
.wbtm_style.wbtm_container {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* Defensive full reset of every wrapper between our widget and the actual
   pill bar: the plugin's mp_global framework applies a generic utility rule
   — `.wbtm_style [class*="_dLayout"] { padding: 20px; border: 1px solid …;
   margin-top: -1px; background: #fff; }` — to ANY element whose class
   contains "_dLayout" (matches the search form's own outer wrapper div,
   among others), on top of whatever the .wbtm-bar-redesign inline style
   already does. Rather than keep tracing every utility class one at a
   time, zero out spacing on the whole ancestor chain up to (but not
   including) the pill itself, which manages its own padding correctly. */
.busly-search-widget #wbtm_area,
.busly-search-widget .wbtm_style,
.busly-search-widget [class*="_dLayout"] {
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

/* ══════════════════════════════════════════════════════════════════
   1. SEARCH FORM
   ══════════════════════════════════════════════════════════════════
   IMPORTANT: templates/layout/search_form.php ships its OWN hard-coded,
   !important-heavy inline <style> block, scoped to `.wbtm-bar-redesign`
   (a class it always adds, regardless of the shortcode's `style` attr).
   That block already implements a complete pill-bar layout — flex rows,
   icon+label fields, swap button, dropdown, submit button shape.

   Fighting that with competing layout rules is a losing battle (its rules
   are `!important` and load later in the DOM than our <head>-enqueued
   stylesheet, so equal-specificity rules of ours would always lose).
   Instead we RETINT its existing layout to Busly's palette, using the
   same "#wbtm_area .wbtm-bar-redesign" scope plus one extra `body`
   ancestor to guarantee higher specificity than the plugin's own rules —
   that wins regardless of load order or its use of !important. */
.wbtm_style { font-family: var(--busly-font-primary); }

body #wbtm_area .wbtm-bar-redesign .wbtm_search_input_fields_holder {
	border-radius: 100px !important;
	border-color: var(--busly-s200) !important;
	box-shadow: 0 2px 16px rgba(0,0,0,.08) !important;
}
/* The pill's own OUTER wrapper (._dLayout.wbtm_search_area.wbtm-bar-redesign)
   still carries a leftover rule from the plugin's classic/non-redesign skin
   (assets/frontend/wbtm.css: `.wbtm_style .wbtm_search_area { border-radius:
   12px; box-shadow: 0 4px 12px rgba(0,0,0,.05); }`) — the redesign skin's
   own inline <style> resets this wrapper's background/padding but never
   resets this, so a 12px-radius shadow rendered behind the pill's actual
   100px-radius shadow, poking out at the corners as a faint rectangular
   "echo". Neutralize it here rather than in the plugin file so this
   survives plugin updates. */
body #wbtm_area .wbtm-bar-redesign.wbtm_search_area {
	border-radius: 0 !important;
	box-shadow: none !important;
}
/* The FROM field (.wbtm_start_point) is the first inner element sitting
   right at the pill's rounded left edge. Its own hover background
   (.wtbm_inputList:hover, plugin rule) fills its own square-cornered box,
   which pokes out past the pill's curve at 100px radius — barely visible
   at the plugin's own small default radius, but obvious at this size.
   overflow:hidden on the pill would be the usual fix, but that would also
   clip the absolutely-positioned city dropdown (ul.wbtm_input_select_list)
   that needs to render below it, so match the corner radius on this one
   child directly instead — desktop-only, this field isn't the pill's
   left edge once the plugin's own mobile breakpoint stacks it vertically. */
@media (min-width: 768px) {
	body #wbtm_area .wbtm-bar-redesign .wbtm_start_point {
		border-radius: 100px 0 0 100px !important;
	}
}
/* The pill radius above only suits the wide desktop row layout. The
   plugin's own mobile breakpoint (search_form.php, @media max-width:767px)
   already switches this container to flex-direction:column and reduces its
   own radius back to 10px for the stacked layout — but our unconditional
   !important above has higher specificity than that plugin rule, so it was
   winning even on mobile and leaving a huge pill corner on a tall, narrow
   card. Match the plugin's own breakpoint and radius value here so mobile
   goes back to looking intentional instead of broken. */
@media (max-width: 767px) {
	body #wbtm_area .wbtm-bar-redesign .wbtm_search_input_fields_holder {
		border-radius: 10px !important;
	}
}
body #wbtm_area .wbtm-bar-redesign .wtbm_inputList { border-right-color: var(--busly-s200) !important; }
body #wbtm_area .wbtm-bar-redesign .wtbm_inputList:hover { background: #f7f8ff !important; }
body #wbtm_area .wbtm-bar-redesign label.wtbm_fdColumn { color: var(--busly-s500) !important; }
body #wbtm_area .wbtm-bar-redesign .marker > i,
body #wbtm_area .wbtm-bar-redesign .calendar > i { color: var(--busly-s400) !important; }
body #wbtm_area .wbtm-bar-redesign .formControl { caret-color: var(--busly-primary-3) !important; }

/* Swap button */
body #wbtm_area .wbtm-bar-redesign .wbtm_search_location_toggle { border-color: #d1d5db !important; }
body #wbtm_area .wbtm-bar-redesign .wbtm_search_location_toggle:hover {
	background: #fff !important;
	border-color: var(--busly-primary) !important;
}
body #wbtm_area .wbtm-bar-redesign .wbtm_search_location_toggle:hover i { color: var(--busly-primary) !important; }

/* Location dropdown */
body #wbtm_area .wbtm-bar-redesign ul.wbtm_input_select_list li:hover { background: var(--busly-i50) !important; }
body #wbtm_area .wbtm-bar-redesign ul.wbtm_input_select_list li.wbtm_city_selected::before {
	background: var(--busly-primary) !important;
	border-color: var(--busly-primary) !important;
}
body #wbtm_area .wbtm-bar-redesign ul.wbtm_input_select_list li.wbtm_city_selected::after {
	background: var(--busly-i50) !important;
	color: var(--busly-primary) !important;
}

/* Submit button — the redesign's own stylesheet shapes it but never sets a
   color, so it inherits whatever the plugin's global button theme is;
   force Busly's accent orange to match the reference exactly. */
body #wbtm_area .wbtm-bar-redesign .wbtm_search_action_button {
	background: var(--busly-accent) !important;
	color: #fff !important;
	box-shadow: 0 3px 14px rgba(240,90,40,.35) !important;
}
body #wbtm_area .wbtm-bar-redesign .wbtm_search_action_button:hover { background: var(--busly-accent-hover) !important; }

/* Generic fallback for any OTHER context that renders the plugin's search
   form WITHOUT the `.wbtm-bar-redesign` treatment (defensive only — every
   known call path in this plugin version always adds that class). */
.wbtm_input_select_list {
	background: #fff; border: 1px solid var(--busly-s200); border-radius: var(--busly-r16);
	box-shadow: 0 16px 40px rgba(0,0,0,.14);
}

/* ══════════════════════════════════════════════════════════════════
   2. SEARCH RESULTS — bus cards
   ══════════════════════════════════════════════════════════════════
   Like search_form.php, templates/layout/search_result.php ALSO ships
   its own complete, !important-heavy inline <style> block — a full
   FlixBus-style card/filter/popup redesign (times+duration grid, operator
   info, price panel, sticky filter sidebar, member-promo card). Same
   strategy as Section 1: retint it to Busly's palette instead of
   fighting its layout.

   Its accent color is driven by the CSS custom property
   `--wbtm_color_theme` (default #e8510f) almost everywhere, so redefining
   that single variable on the result container retints most of it in one
   move; the handful of spots that hard-code a literal color instead of
   the variable are overridden individually below with boosted specificity
   (see Section 1's comment for why `body …` + !important is needed). */
#wbtm_area, .wbtm_search_result_holder, .wbtm_bus_list_area {
	--wbtm_color_theme: var(--busly-accent);
}

/* Each bus result is TWO nested "card" boxes with their own competing
   border/shadow/radius: the outer .wbtm-bus-list (16px radius, the one
   with overflow:hidden that actually clips the photo) and an inner
   .wbtm-card-wrap grid wrapper (its own 24px radius + border + shadow +
   background, entirely redundant since it's already fully clipped by the
   outer box). The mismatched radii don't line up at the corners — the
   photo's own 24px curve cuts in more aggressively than the outer 16px
   border, leaving a visible seam at the top/bottom corners. Strip the
   inner box's own decoration so the outer .wbtm-bus-list is the only
   visible card boundary. */
body .wbtm-card-wrap {
	border-radius: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

body .wbtm_selbus_date_badge,
body .wbtm_bus_tab_wrapper .wbtm_tab_active::before { background: var(--busly-primary) !important; }
body .wbtm_selbus_change_btn,
body .wbtm_selbus_price { color: var(--busly-primary) !important; }

body .wbtm-bus-list.in_cart {
	border-color: var(--busly-primary) !important;
	box-shadow: 0 0 0 2px var(--busly-i50) !important;
}
body .wbtm-price-value { color: var(--busly-primary) !important; }
body .wbtm-operator-name,
body .wbtm-list-count,
body .wbtm-sort-label-text { font-family: var(--busly-font-primary); }

/* Force the plugin's own intended vertical-centering for the "N buses
   available… / Sort by" row — its own CSS already declares
   `display:flex; align-items:center` on .wbtm-list-header, but something
   in the surrounding page context was winning over it, making the two
   sides sit at different vertical positions. */
body .wbtm-list-header {
	display: flex !important;
	align-items: center !important;
}
body .wbtm-list-sort {
	display: flex !important;
	align-items: center !important;
}

body .wbtm-card-price .wbtm-seat-book._themeButton_xs,
body .wbtm-card-price ._themeButton_xs,
body .wbtm-card-price #get_wbtm_bus_details {
	background: var(--busly-accent) !important;
	box-shadow: 0 3px 10px rgba(240,90,40,.3) !important;
}
body .wbtm-card-price .wbtm-seat-book._themeButton_xs:hover,
body .wbtm-card-price #get_wbtm_bus_details:hover { opacity: .92; }

body .wbtm-member-promo { background: linear-gradient(140deg, var(--busly-navy) 0%, var(--busly-primary-3) 100%) !important; }
body .wbtm-member-promo-btn { background: var(--busly-accent) !important; }
body .wbtm-member-promo-btn:hover { background: var(--busly-accent-hover) !important; }

body .wbtm-filter-section-label,
body .wbtm-filter-reset-btn:hover,
body .wbtm-filter-header-title { color: var(--busly-primary) !important; }
body .wbtm-filter-cb-row input[type="checkbox"] { accent-color: var(--busly-accent) !important; }

/* Reset now renders at the bottom of the filter list (after Boarding
   Point) in the markup for every viewport, not just mobile — give it a
   sensible default look everywhere: a divider above it, right-aligned. */
body .wbtm-filter-reset-row {
	display: flex;
	justify-content: flex-end;
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--busly-s200, #e2e8f0);
}
/* The mobile slide-in drawer + desktop collapse toggle (and its button)
   were removed — the filter list now just renders normally/expanded on
   every viewport, no JS-driven show/hide involved. But the plugin's own
   mobile CSS (wtbm_search.css) still hides every child of the holder by
   default except ones carrying .wbtm-mobile-filter-toggle — with that
   button gone, nothing would ever except .wbtm-filter-card from that
   rule, so it'd stay permanently hidden. Force it visible unconditionally
   instead of leaving that plugin behavior in place with no way to
   reverse it. */
body .wbtm_bus_left_filter_holder .wbtm-filter-card {
	display: block !important;
}

/* Flix / legacy compact layout (older style param, no known template redesign) */
.wbtm-bus-flix-style {
	background: #fff; border: 1px solid var(--busly-s200); border-radius: var(--busly-r16);
	padding: 18px 22px; margin-bottom: 12px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.wbtm-bus-flix-style .price { font-weight: 800; color: var(--busly-primary); }

/* Popup modal (bus details tabs) */
.wbtm-bus-popup { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.wbtm-bus-popup-inner { background: #fff; border-radius: var(--busly-r20); max-width: 640px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 32px; position: relative; }
.wbtm-popup-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--busly-s100); display: flex; align-items: center; justify-content: center; }

/* Journey leg badges (cart) */
.wbtm-journey-leg-badge { display: inline-flex; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 100px; text-transform: uppercase; letter-spacing: .03em; }
.wbtm-journey-leg-badge.wbtm-journey-leg-outbound { background: var(--busly-i50); color: var(--busly-primary); }
.wbtm-journey-leg-badge.wbtm-journey-leg-return { background: #fef3c7; color: #b45309; }

/* ══════════════════════════════════════════════════════════════════
   3. SEAT MAP
   ══════════════════════════════════════════════════════════════════ */
.wbtm_seat_plan_area { background: #fff; border: 1px solid var(--busly-s200); border-radius: var(--busly-r20); padding: 24px; }
.wbtm_seat_plan_lower, .wbtm_seat_plan_upper { display: inline-flex; flex-direction: column; gap: 8px; }
.wbtm_cabin_section { border: 1px solid var(--busly-s200); border-radius: var(--busly-r16); margin-bottom: 12px; overflow: hidden; }
.wbtm_cabin_header { padding: 12px 18px; background: var(--busly-s50); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.wbtm_cabin_section.collapsed .wbtm_cabin_seat_plan { display: none; }
.wbtm_cabin_seat_plan { padding: 18px; }

.mp_seat_item { display: inline-flex; }
.mp_seat {
	width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
	position: relative; cursor: pointer; transition: transform .1s;
}
.mp_seat .seat_visual { width: 100%; height: 100%; border-radius: 9px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--busly-s200); background: var(--busly-s50); transition: background .15s, border-color .15s; }
.mp_seat .seat_number { font-size: 10.5px; font-weight: 700; color: var(--busly-s600); }
.mp_seat.seat_available .seat_visual { background: #fff; border-color: #cbd5e1; }
.mp_seat.seat_available:hover .seat_visual { border-color: var(--busly-primary); }
.mp_seat.seat_selected.seat_available .seat_visual { background: var(--busly-primary); border-color: var(--busly-primary); }
.mp_seat.seat_selected.seat_available .seat_number { color: #fff; }
.mp_seat.seat_booked, .mp_seat.seat_in_cart { cursor: not-allowed; }
.mp_seat.seat_booked .seat_visual { background: var(--busly-s200); border-color: var(--busly-s200); }
.mp_seat.seat_booked .seat_number { color: var(--busly-s400); }
.mp_seat.seat_in_cart .seat_visual { background: #fde68a; border-color: #fde68a; }

.wbtm_non_seat_item { width: 38px; height: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--busly-s400); }
.wbtm_non_seat_icon { font-size: 14px; }
.wbtm_non_seat_label { font-size: 8px; font-weight: 700; text-transform: uppercase; }
.wbtm_aisle_blank { width: 20px; height: 38px; }

.wbtm_seat_legend { display: flex; gap: 18px; margin-top: 20px; flex-wrap: wrap; border-top: 1px solid var(--busly-s200); padding-top: 18px; }
.wbtm_seat_legend_item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--busly-s600); }
.wbtm_seat_legend_swatch { width: 16px; height: 16px; border-radius: 5px; display: inline-block; border: 1.5px solid var(--busly-s200); background: #fff; }
.wbtm_seat_legend_swatch.is_available { border-color: #cbd5e1; }
.wbtm_seat_legend_swatch.is_selected { background: var(--busly-primary); border-color: var(--busly-primary); }
.wbtm_seat_legend_swatch.is_booked { background: var(--busly-s200); border-color: var(--busly-s200); }

.wbtm_seat_item_list ul.mp_list li.justifyBetween { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--busly-s100); }

/* ══════════════════════════════════════════════════════════════════
   4. SELECTED SEATS + BOOKING SUMMARY + TOTALS
   ══════════════════════════════════════════════════════════════════ */
.wbtm_selected_seat_details { width: 100%; margin-top: 18px; }
.wbtm_selected_seat_details th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--busly-s400); padding-bottom: 8px; }
.wbtm_selected_seat_details td { padding: 10px 0; font-size: 13.5px; border-top: 1px solid var(--busly-s100); }
.wbtm_remove_area { color: #dc2626; cursor: pointer; }

.wbtm_booking_summary_preview {
	background: #fff; border: 1px solid var(--busly-s200); border-radius: var(--busly-r20); padding: 24px; position: sticky; top: 90px;
}
.wbtm_booking_summary_title { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.wbtm_booking_summary_route { font-size: 12.5px; color: var(--busly-s500); margin-bottom: 16px; }
.wbtm_booking_summary_table { width: 100%; }
.wbtm_booking_summary_table td { padding: 6px 0; font-size: 13px; }
.wbtm_booking_summary_subtotal, .wbtm_booking_summary_total { border-top: 1px solid var(--busly-s200); padding-top: 12px; margin-top: 8px; font-weight: 700; }
.wbtm_booking_summary_total, .wbtm_summary_preview_total { color: var(--busly-primary); font-size: 16px; }
.wbtm_summary_preview_book_now { width: 100%; margin-top: 16px; padding: 13px; border-radius: 100px; background: var(--busly-primary); color: #fff; font-weight: 700; }

table.wbtm_totals h5.wbtm_sub_total, h5 span.wbtm_total { color: var(--busly-primary); font-weight: 800; }

/* ══════════════════════════════════════════════════════════════════
   5. SINGLE BUS PAGE (single_bus_details.php)
   ══════════════════════════════════════════════════════════════════ */
.wbtm_single_modern_card { background: #fff; border-radius: var(--busly-r20); border: 1px solid var(--busly-s200); overflow: hidden; margin-bottom: 32px; }
.wbtm_sm_top { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.wbtm_sm_slider img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.wbtm_sm_info { padding: 32px; }
.wbtm_sm_header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wbtm_sm_name { font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.wbtm_sm_code { font-size: 12px; color: var(--busly-s400); font-weight: 700; }
.wbtm_sm_tags { display: flex; gap: 8px; margin: 12px 0 20px; flex-wrap: wrap; }
.wbtm_sm_tag { font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 100px; }
.wbtm_sm_tag._gray { background: var(--busly-s100); color: var(--busly-s600); }
.wbtm_sm_tag._blue { background: var(--busly-i50); color: var(--busly-primary); }
.wbtm_sm_tag._green { background: #dcfce7; color: #15803d; }
.wbtm_sm_routes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.wbtm_sm_route_box { background: var(--busly-s50); border-radius: var(--busly-r16); padding: 16px; }
.wbtm_sm_stop { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.wbtm_sm_pin { color: var(--busly-primary); flex-shrink: 0; }
.wbtm_sm_stop_time { color: var(--busly-s400); font-size: 11.5px; margin-left: auto; }
.wbtm_sm_return_toggle { font-size: 13px; font-weight: 700; color: var(--busly-primary); cursor: pointer; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 6px; }
.wbtm_sm_description { font-size: 13.5px; color: var(--busly-s600); line-height: 1.75; padding: 0 32px 32px; }
.wtbm_term_wrapper { border-top: 1px solid var(--busly-s200); padding: 20px 32px 32px; }
.wtbm_term_item { border-bottom: 1px solid var(--busly-s100); padding: 12px 0; }
.wtbm_term_title { font-weight: 700; font-size: 13.5px; cursor: pointer; }

@media (max-width: 760px) {
	.wbtm_sm_top, .wbtm_sm_routes { grid-template-columns: 1fr; }
	.wbtm_sm_slider img { min-height: 220px; }
}

/* ══════════════════════════════════════════════════════════════════
   6. MY ACCOUNT — Bus Booking Dashboard
   ══════════════════════════════════════════════════════════════════ */
.wbtm-my-account-dashboard { display: flex; flex-direction: column; gap: 24px; }
.wbtm-dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.wbtm-stat-card { background: #fff; border: 1px solid var(--busly-s200); border-radius: var(--busly-r16); padding: 20px; text-align: center; }
.wbtm-stat-card strong { display: block; font-size: 24px; font-weight: 900; color: var(--busly-primary); }
.wbtm-dashboard-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.wbtm-bookings-container { background: #fff; border: 1px solid var(--busly-s200); border-radius: var(--busly-r16); overflow: hidden; }
.wbtm-bookings-header { display: flex; background: var(--busly-s50); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--busly-s500); }
.wbtm-header-cell { padding: 12px 16px; flex: 1; }

@media (max-width: 760px) {
	.wbtm-dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════════
   7. WooCommerce cart-page booking-item display
   ══════════════════════════════════════════════════════════════════ */
.woocommerce-cart .wbtm_style { font-size: 13px; color: var(--busly-s600); }
.woocommerce-cart .wbtm_style table { font-size: 13px; }
