/* ==========================================================================
   Custom Car Rental Form – horizontal layout

   - Everything is scoped to #bookingForm.
   - Layout-critical properties use !important on purpose: themes often
     style input / select / label / button globally and would otherwise
     push fields up or down and break the alignment.
   - Colours come from CSS variables. The plugin settings page
     (Car Rental Form → Styles) prints them inline, so the values below are
     only the defaults used when a colour is left empty.
   - The layout is chosen by js/script.js from the real width of the form
     (attribute data-ccrf-layout), so it is correct on any screen and in any
     page column.
   ========================================================================== */

#bookingForm {
	/* ---- colours (overridden from the plugin settings) ---- */
	--ccrf-bg: rgba(29, 33, 74, 0.78);
	--ccrf-text: #ffffff;
	--ccrf-field-bg: #ffffff;
	--ccrf-field-text: #1f2333;
	--ccrf-icon: #7a8194;
	--ccrf-btn-bg: #c2a56b;
	--ccrf-btn-text: #ffffff;
	--ccrf-btn-hover-bg: var(--ccrf-btn-bg);
	--ccrf-btn-hover-text: var(--ccrf-btn-text);

	/* ---- sizes ---- */
	--ccrf-h: 50px;          /* height of every field and of the button */
	--ccrf-label-h: 16px;    /* every label has exactly this height      */
	--ccrf-label-gap: 8px;
	--ccrf-radius: 10px;
	--ccrf-gap: 14px;
	--ccrf-pad-l: 42px;      /* text start (after the icon)               */
	--ccrf-font: 15px;

	display: none; /* faded in by js/script.js after the layout is set */
	position: relative;
	z-index: 20;
	box-sizing: border-box !important;
	width: 100%;
	max-width: 1560px;
	margin: 0 auto;
	padding: 22px 24px 24px !important;

	background-color: var(--ccrf-bg);
	color: var(--ccrf-text);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 18px;
	box-shadow: 0 20px 45px rgba(8, 10, 30, 0.3);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);

	font-family: inherit;
	font-size: var(--ccrf-font);
	line-height: 1.3;
	text-align: left;
}

#bookingForm *,
#bookingForm *::before,
#bookingForm *::after {
	box-sizing: border-box !important;
}

/* Remove anything a theme / wpautop may inject between the fields */
#bookingForm br { display: none !important; }
#bookingForm p  { margin: 0 !important; padding: 0 !important; }

#bookingForm .search-inner {
	margin: 0 !important;
	padding: 0 !important;
}

/* --------------------------------------------------------------------------
   Row + field skeleton
   -------------------------------------------------------------------------- */

#bookingForm .ccrf-row {
	display: flex !important;
	flex-wrap: wrap;
	align-items: flex-start !important; /* same-height labels => same baseline */
	gap: var(--ccrf-gap);
	margin: 0 !important;
	padding: 0 !important;
}

#bookingForm .ccrf-field {
	display: block !important;
	flex: 1 1 100%;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	width: auto !important;
}

/* date + hour belong together */
#bookingForm .ccrf-pair {
	display: grid !important;
	grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
	gap: 8px;
	flex: 1 1 100%;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
}

/* --------------------------------------------------------------------------
   Labels – identical box for every field (incl. the empty one above the button)
   -------------------------------------------------------------------------- */

#bookingForm .ccrf-label {
	display: block !important;
	height: var(--ccrf-label-h) !important;
	max-width: 100%;
	margin: 0 0 var(--ccrf-label-gap) 0 !important;
	padding: 0 0 0 2px !important;
	float: none !important;
	position: static !important;
	font-family: inherit;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: var(--ccrf-label-h) !important;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ccrf-text) !important;
	opacity: 0.92;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Control box – fixed height, icon centred inside it
   -------------------------------------------------------------------------- */

#bookingForm .ccrf-control {
	position: relative !important;
	display: block !important;
	height: var(--ccrf-h) !important;
	margin: 0 !important;
	padding: 0 !important;
}

#bookingForm .ccrf-icon {
	position: absolute !important;
	top: 0 !important;
	bottom: 0 !important;
	left: 14px;
	z-index: 3;
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	margin: auto 0 !important;
	padding: 0 !important;
	color: var(--ccrf-icon);
	stroke: currentColor;
	fill: none;
	pointer-events: none;
}

/* inputs and bootstrap-select buttons share one look */
#bookingForm .ccrf-control .form-control,
#bookingForm .ccrf-control .bootstrap-select > .dropdown-toggle {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: block !important;
	float: none !important;
	position: relative !important;
	width: 100% !important;
	max-width: none !important;
	height: var(--ccrf-h) !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 34px 0 var(--ccrf-pad-l) !important;
	font-family: inherit !important;
	font-size: var(--ccrf-font) !important;
	font-weight: 500 !important;
	line-height: calc(var(--ccrf-h) - 2px) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-align: left !important;
	text-shadow: none !important;
	color: var(--ccrf-field-text) !important;
	background: var(--ccrf-field-bg) !important;
	background-image: none !important;
	border: 1px solid transparent !important;
	border-radius: var(--ccrf-radius) !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
	outline: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#bookingForm .ccrf-control .form-control {
	padding-right: 12px !important;
}

#bookingForm .form-control::placeholder {
	color: var(--ccrf-field-text);
	opacity: 0.5;
}

#bookingForm .form-control[readonly] {
	cursor: pointer;
	opacity: 1;
}

#bookingForm .ccrf-control .form-control:hover,
#bookingForm .ccrf-control .bootstrap-select > .dropdown-toggle:hover {
	border-color: var(--ccrf-btn-bg) !important;
}

#bookingForm .ccrf-control .form-control:focus,
#bookingForm .ccrf-control .bootstrap-select > .dropdown-toggle:focus,
#bookingForm .ccrf-control .bootstrap-select.open > .dropdown-toggle {
	border-color: var(--ccrf-btn-bg) !important;
	box-shadow: 0 0 0 3px rgba(194, 165, 107, 0.35) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ccrf-btn-bg) 35%, transparent) !important;
}

/* bootstrap-select internals */
#bookingForm .bootstrap-select,
#bookingForm .bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn) {
	display: block !important;
	float: none !important;
	width: 100% !important;
	height: var(--ccrf-h) !important;
	margin: 0 !important;
	padding: 0 !important;
}

#bookingForm .bootstrap-select > select {
	display: none !important;
}

#bookingForm .bootstrap-select > .dropdown-toggle .filter-option {
	display: block !important;
	float: none !important;
	width: 100% !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-align: left !important;
	font: inherit !important;
	line-height: inherit !important;
	color: inherit !important;
}

#bookingForm .bootstrap-select > .dropdown-toggle .caret {
	position: absolute !important;
	top: 50% !important;
	right: 14px !important;
	left: auto !important;
	margin: -2px 0 0 0 !important;
	border-top: 5px solid var(--ccrf-icon) !important;
	border-right: 5px solid transparent !important;
	border-left: 5px solid transparent !important;
	border-bottom: 0 !important;
}

/* dropdown list */
#bookingForm .bootstrap-select .dropdown-menu.open {
	margin-top: 6px !important;
	padding: 6px 0 !important;
	min-width: 100% !important;
	border: 0 !important;
	border-radius: var(--ccrf-radius) !important;
	background: #ffffff;
	box-shadow: 0 14px 34px rgba(8, 10, 30, 0.28) !important;
	overflow: hidden;
	z-index: 1000;
}

#bookingForm .bootstrap-select .dropdown-menu.inner {
	position: static !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	list-style: none !important;
}

#bookingForm .bootstrap-select .dropdown-menu li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

#bookingForm .bootstrap-select .dropdown-menu li::before {
	display: none !important;
}

#bookingForm .bootstrap-select .dropdown-menu li a {
	display: block !important;
	padding: 9px 16px !important;
	font-family: inherit;
	font-size: 14px !important;
	line-height: 1.4 !important;
	color: #1f2333 !important;
	text-decoration: none !important;
	white-space: nowrap;
	background: transparent;
}

#bookingForm .bootstrap-select .dropdown-menu li a:hover,
#bookingForm .bootstrap-select .dropdown-menu li a:focus {
	background: rgba(0, 0, 0, 0.05) !important;
}

#bookingForm .bootstrap-select .dropdown-menu li.selected a,
#bookingForm .bootstrap-select .dropdown-menu li.active a {
	background: var(--ccrf-btn-bg) !important;
	color: var(--ccrf-btn-text) !important;
}

#bookingForm .bootstrap-select .dropdown-menu li a .check-mark {
	display: none !important;
}

/* the live-search box was hidden in the original design – keep it hidden */
#bookingForm .bs-searchbox {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Submit button
   -------------------------------------------------------------------------- */

#bookingForm #formSearchSubmit {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 10px;
	float: none !important;
	position: relative !important;
	width: 100% !important;
	max-width: none !important;
	height: var(--ccrf-h) !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 26px !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: 0.06em !important;
	text-transform: uppercase !important;
	text-decoration: none !important;
	text-shadow: none !important;
	white-space: nowrap !important;
	color: var(--ccrf-btn-text) !important;
	background: var(--ccrf-btn-bg) !important;
	border: 0 !important;
	border-radius: var(--ccrf-radius) !important;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

#bookingForm #formSearchSubmit .ccrf-btn-text {
	display: block;
	line-height: 1 !important;
}

#bookingForm #formSearchSubmit .ccrf-icon {
	position: static !important;
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	margin: 0 !important;
	color: currentColor;
	flex: 0 0 auto;
	transition: transform 0.15s ease;
}

#bookingForm #formSearchSubmit:hover {
	color: var(--ccrf-btn-hover-text) !important;
	background: var(--ccrf-btn-hover-bg) !important;
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26) !important;
}

#bookingForm #formSearchSubmit:hover .ccrf-icon {
	transform: translateX(3px);
}

#bookingForm #formSearchSubmit:active {
	transform: translateY(0);
}

#bookingForm #formSearchSubmit:focus-visible {
	outline: none !important;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

/* --------------------------------------------------------------------------
   Layouts (data-ccrf-layout is set by js/script.js from the form width)
   -------------------------------------------------------------------------- */

/* stack (narrow / phone) – default: one field per line */
#bookingForm .ccrf-label--spacer {
	display: none !important;
}

/* grid2 (tablet / narrow column) – two columns, button full width */
#bookingForm[data-ccrf-layout="grid2"] .ccrf-field--location,
#bookingForm[data-ccrf-layout="grid2"] .ccrf-pair {
	flex: 1 1 calc(50% - var(--ccrf-gap));
}
#bookingForm[data-ccrf-layout="grid2"] .ccrf-field--extra {
	flex: 1 1 calc(33.333% - var(--ccrf-gap));
	min-width: 150px;
}

/* row – everything on one horizontal line */
#bookingForm[data-ccrf-layout="row"] .ccrf-row {
	flex-wrap: nowrap !important;
}
#bookingForm[data-ccrf-layout="row"] .ccrf-field--location { flex: 1.4 1 0; }
#bookingForm[data-ccrf-layout="row"] .ccrf-pair            { flex: 2 1 0; }
#bookingForm[data-ccrf-layout="row"] .ccrf-field--submit   { flex: 0 0 auto; }
#bookingForm[data-ccrf-layout="row"] .ccrf-label--spacer,
#bookingForm[data-ccrf-layout="row2"] .ccrf-label--spacer {
	display: block !important;
}

/* row with the extra fields: widths tuned so no text gets cut */
#bookingForm.ccrf-has-extras[data-ccrf-layout="row"] .ccrf-row             { gap: 10px; }
#bookingForm.ccrf-has-extras[data-ccrf-layout="row"] .ccrf-field--location { flex: 1.4 1 130px; }
#bookingForm.ccrf-has-extras[data-ccrf-layout="row"] .ccrf-pair            { flex: 1 0 252px; gap: 6px; grid-template-columns: minmax(118px, 1.35fr) minmax(124px, 1fr); }
#bookingForm.ccrf-has-extras[data-ccrf-layout="row"] .ccrf-field--extra    { flex: 0.5 0 130px; }
#bookingForm.ccrf-has-extras[data-ccrf-layout="row"] .ccrf-field--age      { flex: 0.5 0 170px; }
#bookingForm.ccrf-has-extras.ccrf-compact[data-ccrf-layout="row"] .ccrf-pair { flex: 1 0 220px; grid-template-columns: minmax(118px, 1.3fr) minmax(96px, 1fr); }
#bookingForm.ccrf-has-extras.ccrf-compact[data-ccrf-layout="row"] .ccrf-field--age { flex-basis: 165px; }

/* row2 – extras present but not enough width: two horizontal lines
   (line 1: locations + dates, line 2: extras + button) */
#bookingForm[data-ccrf-layout="row2"] .ccrf-field--location { flex: 1 1 calc(20% - var(--ccrf-gap)); }
#bookingForm[data-ccrf-layout="row2"] .ccrf-pair            { flex: 1 1 calc(30% - var(--ccrf-gap)); }
#bookingForm[data-ccrf-layout="row2"] .ccrf-field--extra    { flex: 1 1 15%; }
#bookingForm[data-ccrf-layout="row2"] .ccrf-field--submit   { flex: 0 0 auto; }

/* compact – single line on a smaller desktop: tighter metrics */
#bookingForm.ccrf-compact {
	--ccrf-pad-l: 36px;
	--ccrf-font: 14px;
	--ccrf-gap: 10px;
}
#bookingForm.ccrf-compact .ccrf-label { font-size: 11px !important; letter-spacing: 0.04em; }
#bookingForm.ccrf-compact .ccrf-icon  { left: 12px; width: 16px !important; height: 16px !important; }
#bookingForm.ccrf-compact .ccrf-pair  { gap: 6px; }
#bookingForm.ccrf-compact .ccrf-control .bootstrap-select > .dropdown-toggle { padding-right: 26px !important; }
#bookingForm.ccrf-compact .bootstrap-select > .dropdown-toggle .caret { right: 10px !important; }
/* hour boxes drop their clock icon whenever they are narrow (set by script.js) */
#bookingForm.ccrf-compact .ccrf-field--time .ccrf-icon,
#bookingForm.ccrf-time-tight .ccrf-field--time .ccrf-icon { display: none !important; }
#bookingForm.ccrf-compact .ccrf-field--time .bootstrap-select > .dropdown-toggle,
#bookingForm.ccrf-time-tight .ccrf-field--time .bootstrap-select > .dropdown-toggle { padding-left: 14px !important; }
#bookingForm.ccrf-compact #formSearchSubmit { padding: 0 20px !important; }
#bookingForm.ccrf-compact #formSearchSubmit .ccrf-icon { display: none !important; }

/* phone */
@media (max-width: 600px) {
	#bookingForm {
		padding: 18px 16px 20px !important;
		border-radius: 16px;
		--ccrf-gap: 12px;
	}
}

/* --------------------------------------------------------------------------
   Flatpickr calendar (lives in <body>, outside the form)
   -------------------------------------------------------------------------- */

.flatpickr-calendar {
	border-radius: 12px;
	box-shadow: 0 14px 34px rgba(8, 10, 30, 0.28);
}
