/**
 * Olima Tours & Transfers — overrides for the native CHBS widget.
 *
 * The [olima_tour_booking] shortcode renders the unmodified CHBS widget
 * ([chbs_booking_form widget_mode="1"]) inside a .olima-tour-widget
 * wrapper. Every rule here is scoped to that wrapper so the standalone
 * /booking/ form and any other CHBS instances are unaffected.
 *
 * Colours are managed via the CHBS native Styles tab (Booking Form → Styles).
 * Only field-visibility and interaction overrides specific to the widget live here.
 *
 * @package Olima\ToursTransfers
 */

/* ==========================================================================
   1. Field visibility — utility classes
   ========================================================================== */

/**
 * Each .olima-hide-* class is added to the block wrapper by render.php when
 * the corresponding "Field Visibility" toggle is enabled in the block editor.
 *
 * The default value for hide_transfer_type is true (set in block.json) so
 * the transfer-type field stays hidden unless an editor deliberately shows
 * it — preserving the original always-hidden behaviour for all existing
 * and new blocks without a CSS override.
 *
 * !important is required because CHBS stylesheets target the same elements
 * with equally specific selectors and the cascade order is not reliable
 * across cache states.
 *
 * All rules are harmless when a field is not present in the DOM (e.g.
 * hiding the route selector on an hourly-only booking form has no effect).
 */

.olima-hide-pickup-location .chbs-form-field-pickup-location {
	display: none !important;
}

.olima-hide-dropoff-location .chbs-form-field-dropoff-location {
	display: none !important;
}

.olima-hide-route .chbs-form-field-route {
	display: none !important;
}

.olima-hide-pickup-datetime .chbs-form-field-pickup-date-time {
	display: none !important;
}

.olima-hide-transfer-type .chbs-form-field-transfer-type {
	display: none !important;
}

.olima-hide-return-datetime .chbs-form-field-return-date-time {
	display: none !important;
}

.olima-hide-duration .chbs-form-field-duration {
	display: none !important;
}

.olima-hide-extra-time .chbs-form-field-extra-time {
	display: none !important;
}

.olima-hide-passenger .chbs-form-field-passenger {
	display: none !important;
}

/* ==========================================================================
   2. Route field — read-only (utility class)
   ========================================================================== */

/**
 * Applied when the block attribute lock_route=true (the default).
 * tour-widget.js checks for this class before calling selectmenu('disable'),
 * so both the visual state and interactivity are controlled by one toggle.
 */
.olima-lock-route .chbs-form-field-route .ui-selectmenu-button {
	cursor: default !important;
	pointer-events: none;
	opacity: 0.75;
}
