/* -----------------------------------------------------------------------
 * Car Rental Search Filter — styles
 * All sizing is box-sizing: border-box so padding/borders never overflow
 * a field and spill into the next one.
 *
 * Structure:
 *   .crsf-bar            outer wrapper
 *     .crsf-fields-row    location + pickup + return, one row on desktop
 *     .crsf-submit-row    the Search button, its own row underneath,
 *                         alignment controlled in Elementor (left/center/right)
 * --------------------------------------------------------------------- */

.crsf-bar,
.crsf-bar *,
.crsf-bar *::before,
.crsf-bar *::after {
	box-sizing: border-box;
}

.crsf-bar {
	display: block;
	width: 100%;
	max-width: 100%;
	background: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 16px;
}

.crsf-fields-row {
	display: grid;
	grid-template-columns: minmax(240px, 1.6fr) minmax(200px, 1fr) minmax(200px, 1fr);
	align-items: stretch;
	gap: 14px;
	width: 100%;
}

.crsf-submit-row {
	display: flex;
	justify-content: flex-start;
	margin-top: 16px;
}

/* Each field is its own self-contained card: one border, no shared
 * divider lines that can drift or get cut off when fields wrap. */
.crsf-field {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0; /* allow grid/flex children to shrink instead of overflow */
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 10px 14px;
}

.crsf-label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 6px;
}

.crsf-label {
	font-weight: 700;
	font-size: 13px;
	color: #1a1a1a;
	display: inline-block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.crsf-field--date .crsf-label {
	margin-bottom: 6px;
}

.crsf-same-location {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #2e7d32;
	cursor: pointer;
	white-space: nowrap;
	background: #eef7ee;
	padding: 4px 10px;
	border-radius: 20px;
	flex-shrink: 0;
}

.crsf-same-location input[type="checkbox"] {
	width: 15px;
	height: 15px;
	margin: 0;
	accent-color: #2e7d32;
	cursor: pointer;
	flex-shrink: 0;
}

.crsf-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
}

.crsf-icon {
	display: inline-flex;
	align-items: center;
	color: #2e7d32;
	flex-shrink: 0;
}

.crsf-input {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	border: none;
	outline: none;
	background: transparent;
	font-size: 14px;
	color: #333;
	width: 100%;
	min-width: 0;
	padding: 4px 0;
}

.crsf-location-input {
	flex: 1 1 auto;
	min-width: 0;
}

/* Custom "type-to-filter" location suggestions dropdown. Positioned
 * relative to .crsf-input-wrap (which already has position:relative) so
 * it spans the full width of the location field, not just the input. */
.crsf-location-suggestions {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	max-height: 240px;
	overflow-y: auto;
	z-index: 100;
}

.crsf-location-suggestions[hidden] {
	display: none;
}

.crsf-location-suggestions li {
	padding: 9px 14px;
	font-size: 14px;
	line-height: 1.3;
	color: #333;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.crsf-location-suggestions li:hover,
.crsf-location-suggestions li.is-active {
	background: #eef7ee;
}

/* Fixed-size, perfectly round clear ("x") button.
 * The old version relied on the browser's default <button> padding,
 * which made it wider than tall (a pill instead of a circle). */
.crsf-clear {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: #ececec;
	color: #777;
	line-height: 1;
	font-size: 13px;
	cursor: pointer;
}

.crsf-clear:hover {
	background: #dcdcdc;
}

.crsf-clear:focus-visible {
	outline: 2px solid #2e7d32;
	outline-offset: 2px;
}

.crsf-datetime {
	flex-wrap: nowrap;
}

.crsf-date {
	flex: 1 1 58%;
	min-width: 0;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.crsf-time {
	flex: 1 1 38%;
	min-width: 0;
	border-left: 1px solid #e2e2e2;
	padding-left: 8px;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Tidy up native date/time input chrome across browsers so it doesn't
 * draw its own extra box/clear-button on top of ours. */
.crsf-date::-webkit-calendar-picker-indicator,
.crsf-time::-webkit-calendar-picker-indicator {
	opacity: 0;
	position: absolute;
	inset: 0;
	width: 100%;
	cursor: pointer;
}

.crsf-date::-webkit-clear-button,
.crsf-time::-webkit-clear-button,
.crsf-date::-webkit-inner-spin-button,
.crsf-time::-webkit-inner-spin-button {
	display: none;
}

.crsf-input-wrap.crsf-datetime {
	position: relative;
}

.crsf-submit {
	border: none;
	background: #2e7d32;
	color: #fff;
	font-weight: 600;
	font-size: 15px;
	padding: 12px 32px;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.15s ease;
	width: 200px;
	max-width: 100%;
	min-height: 48px;
	white-space: nowrap;
}

.crsf-submit:hover {
	background: #245f27;
}

.crsf-submit:focus-visible {
	outline: 2px solid #245f27;
	outline-offset: 2px;
}

/* -----------------------------------------------------------------------
 * Responsive breakpoints
 * Desktop: fields row shows all 3 fields side by side, button row below
 * Tablet:  location spans full width on top, pickup/return share the row
 * Mobile:  everything stacks in one column, button goes full width
 * --------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.crsf-fields-row {
		grid-template-columns: 1fr 1fr;
	}

	.crsf-field--location {
		grid-column: 1 / -1;
	}
}

@media (max-width: 600px) {
	.crsf-bar {
		padding: 14px;
	}

	.crsf-fields-row {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.crsf-field--location,
	.crsf-field--date {
		grid-column: 1 / -1;
	}

	.crsf-submit-row {
		margin-top: 12px;
	}

	.crsf-submit {
		width: 100%;
	}

	.crsf-label {
		white-space: normal;
	}

	/* Keep date + time in a single row even on small screens — shrink
	 * text and spacing instead of wrapping to a new line. */
	.crsf-input-wrap.crsf-datetime {
		gap: 4px;
	}

	.crsf-date,
	.crsf-time {
		font-size: 13px;
	}

	.crsf-time {
		padding-left: 6px;
	}
}
