/**
 * Barra de búsqueda de la flota — ver includes/fleet-search-shortcode.php.
 * Teko y Poppins ya las carga el theme (Google Fonts), no se agregan acá.
 * Los colores viven en variables para poder ajustarlos en un solo lugar.
 */

.ireca-fleet-bar {
	--ifb-bg: #2b2b2b;
	--ifb-divider: rgba(255, 255, 255, 0.08);
	--ifb-text: #ffffff;
	--ifb-muted: #9a9a9a;
	--ifb-accent: #7b9be0;
	--ifb-button: #3563c4;
	--ifb-button-hover: #2a52a8;
	--ifb-error: #ff8a80;

	width: 100%;
	font-family: Poppins, sans-serif;
	text-align: left;
}

.ireca-fleet-bar__form {
	display: flex;
	align-items: stretch;
	margin: 0;
	background: var(--ifb-bg);
	color: var(--ifb-text);
}

/* Selectores reforzados: en "Our Fleet" la barra queda dentro de
   .ireca_wd_search, y el theme (custom.css) le pone a
   ".ireca_wd_search form .wrap_content" display:inline-block y a sus
   inputs height:40px + bordes. */
.ireca-fleet-bar form .wrap_content.ireca-fleet-bar__fields {
	display: flex;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
}

.ireca-fleet-bar__cell {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	padding: 22px 28px;
	border-right: 1px solid var(--ifb-divider);
}

/* ---- Bloques de fecha ---- */

.ireca-fleet-bar__date {
	display: flex;
	align-items: center;
	gap: 16px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.ireca-fleet-bar__date:hover,
.ireca-fleet-bar__date:focus-within {
	background: rgba(255, 255, 255, 0.04);
}

.ireca-fleet-bar__day {
	flex: 0 0 auto;
	font-family: Teko, sans-serif;
	font-size: 64px;
	font-weight: 600;
	line-height: 0.8;
	padding-top: 6px;
	color: var(--ifb-text);
	letter-spacing: -1px;
}

.ireca-fleet-bar__date:not(.is-set) .ireca-fleet-bar__day {
	color: var(--ifb-muted);
}

.ireca-fleet-bar__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ireca-fleet-bar__label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ifb-accent);
	margin-bottom: 4px;
}

.ireca-fleet-bar__month {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ifb-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ireca-fleet-bar__weekday,
.ireca-fleet-bar__hours {
	font-size: 13px;
	line-height: 1.4;
	color: var(--ifb-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* El input real cubre todo el bloque, invisible: tocar el bloque abre el
   datetimepicker del theme y el valor se envía tal cual a ova-crs. */
.ireca-fleet-bar form .wrap_content input.ireca-fleet-bar__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	opacity: 0;
	cursor: pointer;
	font-size: 16px; /* evita el zoom automático de iOS */
}

.ireca-fleet-bar__error {
	position: absolute;
	left: 28px;
	bottom: 4px;
	font-size: 11px;
	color: var(--ifb-error);
	pointer-events: none;
}

.ireca-fleet-bar__error label.error {
	margin: 0;
	font-size: inherit;
	color: inherit;
}

.ireca-fleet-bar__date:has(label.error) .ireca-fleet-bar__day {
	color: var(--ifb-error);
}

/* ---- Duración ---- */

.ireca-fleet-bar__length {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.ireca-fleet-bar__duration {
	font-family: Teko, sans-serif;
	font-size: 34px;
	font-weight: 600;
	line-height: 0.95;
	color: var(--ifb-text);
}

/* ---- Botón ---- */

.ireca-fleet-bar__submit {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 220px;
	padding: 0 32px;
	border: 0;
	border-radius: 0;
	background: var(--ifb-button);
	color: #fff;
	font-family: Poppins, sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.ireca-fleet-bar__submit:hover,
.ireca-fleet-bar__submit:focus-visible {
	background: var(--ifb-button-hover);
	color: #fff;
}

.ireca-fleet-bar__submit:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

/* ---- Tablet: fechas arriba, duración + botón abajo ---- */

@media (max-width: 991.98px) {
	.ireca-fleet-bar__form {
		flex-direction: column;
	}

	.ireca-fleet-bar form .wrap_content.ireca-fleet-bar__fields {
		flex-wrap: wrap;
	}

	.ireca-fleet-bar__date {
		flex: 1 1 50%;
	}

	.ireca-fleet-bar__length {
		flex: 1 1 100%;
		flex-direction: row;
		align-items: baseline;
		gap: 12px;
		flex-wrap: wrap;
		border-right: 0;
		border-top: 1px solid var(--ifb-divider);
		padding-top: 14px;
		padding-bottom: 14px;
	}

	.ireca-fleet-bar__length .ireca-fleet-bar__label {
		margin-bottom: 0;
	}

	.ireca-fleet-bar__date[data-role="dropoff"] {
		border-right: 0;
	}

	.ireca-fleet-bar__submit {
		min-height: 56px;
	}
}

/* ---- Móvil ---- */

@media (max-width: 575.98px) {
	.ireca-fleet-bar__cell {
		padding: 16px;
	}

	.ireca-fleet-bar__date {
		gap: 10px;
	}

	.ireca-fleet-bar__day {
		font-size: 48px;
	}

	.ireca-fleet-bar__month {
		font-size: 13px;
	}

	.ireca-fleet-bar__weekday,
	.ireca-fleet-bar__hours {
		font-size: 12px;
	}

	.ireca-fleet-bar__error {
		left: 16px;
	}
}
