/* GSM Booking Bar — self-contained. Everything is scoped under .gsm-bb and the interactive colours
 * use !important so a host theme's button/link styles can't bleed in (calendar days, time list, etc.). */

.gsm-bb,
.gsm-bb *,
.gsm-bb *::before,
.gsm-bb *::after {
	box-sizing: border-box;
}

.gsm-bb {
	--gsm-red: #c8102e;
	--gsm-red-dark: #a50d26;
	--gsm-red-soft: #fbe4e7;
	--gsm-ink: #24303f;
	--gsm-muted: #7a8798;
	--gsm-line: #e6e9ee;

	position: relative;
	width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--gsm-ink);
	line-height: 1.3;
}

/* ── hard reset so the host theme can't style our controls ── */
.gsm-bb button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none !important;
	box-shadow: none !important;
	/* only inherit the family — NOT font-size (the `font` shorthand was clobbering every button's size) */
	font-family: inherit;
	font-style: normal;
	color: inherit;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	line-height: normal;
	text-decoration: none;
	cursor: pointer;
	width: auto;
	min-width: 0;
	min-height: 0;
	-webkit-appearance: none;
	appearance: none;
	transition: none;
}
.gsm-bb button:hover,
.gsm-bb button:focus,
.gsm-bb button:active {
	color: inherit;
	outline: none;
	text-decoration: none;
}
.gsm-bb svg {
	display: block;
	fill: none;
	stroke-width: inherit;
}
.gsm-bb img {
	max-width: 100%;
	height: auto;
	display: block;
	border: 0;
	box-shadow: none;
}

/* ── the white bar: fills its container/column (no viewport breakout), content centred inside ── */
.gsm-bb__bar {
	width: 100%;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.gsm-bb__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap; /* wrap gracefully in a narrow column instead of overflowing */
	gap: 10px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 14px 24px;
	min-height: 78px;
}

.gsm-bb__loading {
	min-height: 78px;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--gsm-muted);
	font-size: 22px;
	letter-spacing: 4px;
	padding: 14px;
}

.gsm-bb__seg {
	display: flex;
	align-items: center;
}
.gsm-bb__seg--grow {
	flex: 0 1 auto; /* size to content, don't hog the row */
	min-width: 0;
}
.gsm-bb__seg--date,
.gsm-bb__seg--time {
	position: relative;
}

.gsm-bb__divider {
	width: 1px;
	align-self: stretch;
	margin: 6px 4px;
	background: var(--gsm-line);
}

/* ── vehicle pills (real PNG icons, same as the app) ── */
.gsm-bb__vehicles {
	display: flex;
	align-items: center;
	gap: 8px;
}
.gsm-bb__veh {
	border: 2px solid transparent !important;
	border-radius: 999px;
	padding: 8px 22px !important;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	color: var(--gsm-muted) !important;
	min-width: 104px;
	transition: border-color 0.15s, color 0.15s !important;
}
.gsm-bb__veh:hover {
	color: var(--gsm-ink) !important;
}
.gsm-bb__veh-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 36px;
}
.gsm-bb__veh-img {
	width: 58px;
	height: 36px;
	object-fit: contain;
}
.gsm-bb__veh-icon svg {
	width: 52px;
	height: 34px;
	stroke: var(--gsm-red);
}
.gsm-bb__veh-label {
	font-size: 14px;
	font-weight: 600;
}
.gsm-bb__veh.is-active {
	border-color: var(--gsm-red) !important;
	color: var(--gsm-red) !important;
}

/* ── date / time triggers ── */
.gsm-bb__trigger {
	display: flex !important;
	align-items: center;
	gap: 10px;
	width: auto !important;
	padding: 8px 14px !important;
	border-radius: 10px;
	color: var(--gsm-ink) !important;
	transition: background 0.15s !important;
}
.gsm-bb__trigger:hover {
	background: #f6f7f9 !important;
}
.gsm-bb__trigger:disabled {
	cursor: not-allowed; /* gated until a date is picked, but keep the label full black */
}
.gsm-bb__trigger:disabled:hover {
	background: transparent !important;
}
.gsm-bb__trigger svg {
	width: 20px;
	height: 20px;
	flex: none;
	stroke: var(--gsm-ink);
}
.gsm-bb__trigger-text {
	font-size: 18px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--gsm-ink);
}
.gsm-bb__trigger.is-placeholder .gsm-bb__trigger-text {
	color: var(--gsm-ink); /* placeholders shown in full black, same as a chosen value */
}
/* desktop: both fields as roomy boxes with the label left and the icon right */
.gsm-bb__seg--date .gsm-bb__trigger,
.gsm-bb__seg--time .gsm-bb__trigger {
	flex-direction: row-reverse;
	justify-content: space-between;
}
.gsm-bb__seg--date .gsm-bb__trigger {
	min-width: 290px;
}
.gsm-bb__seg--time .gsm-bb__trigger {
	min-width: 240px;
}

/* ── Prenota ── */
.gsm-bb__seg--cta {
	display: flex;
	align-items: center;
}
/* filled theme red by default, darkens to theme ink on hover.
   Prefixed with .gsm-bb so this base rule outranks the .gsm-bb button reset (both use !important on
   background, so specificity decides) — otherwise the fill goes transparent and only the border shows. */
.gsm-bb .gsm-bb__book {
	background: var(--gsm-red) !important;
	color: #fff !important;
	border: 2px solid var(--gsm-red) !important;
	font-size: 18px !important;
	font-weight: 700;
	text-align: center !important;
	border-radius: 999px;
	padding: 11px 40px !important;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s, border-color 0.15s !important;
	width: auto;
}
.gsm-bb__book:hover:not(:disabled) {
	background: var(--gsm-ink) !important;
	color: #fff !important;
	border-color: var(--gsm-ink) !important;
}
.gsm-bb__book:disabled {
	background: #e6a6ae !important;
	color: #fff !important;
	border-color: #e6a6ae !important;
	cursor: not-allowed;
}

/* ── popover ── */
.gsm-bb__pop {
	position: absolute;
	z-index: 2147483000;
	top: calc(100% + 8px);
	left: 0;
	background: #fff;
	border: 1px solid var(--gsm-line);
	border-radius: 14px;
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
	padding: 12px;
	color: var(--gsm-ink);
}
.gsm-bb__pop[hidden] {
	display: none;
}
.gsm-bb__pop--cal {
	width: auto; /* fits one or two months */
}
.gsm-bb__pop--time {
	width: 288px;
	padding: 8px !important;
	overflow: hidden; /* clip the list to the rounded card so the active pill never bleeds past the corners */
}

/* calendar layout — one or two months side by side */
.gsm-bb__cal-months {
	display: flex;
	gap: 26px;
}
.gsm-bb__cal-month {
	width: 300px;
}
.gsm-bb__cal-mhead {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 34px;
	margin-bottom: 8px;
}
.gsm-bb__cal-title {
	font-size: 16px;
	font-weight: 700;
	text-transform: capitalize;
	color: var(--gsm-ink);
}
.gsm-bb__cal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	border: 1px solid var(--gsm-line) !important;
	border-radius: 8px !important;
	width: 34px;
	height: 34px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	color: var(--gsm-ink) !important;
}
.gsm-bb__cal-nav--prev {
	left: 0;
}
.gsm-bb__cal-nav--next {
	right: 0;
}
.gsm-bb__cal-nav svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
}
.gsm-bb__cal-nav:hover:not(:disabled) {
	background: #f6f7f9 !important;
}
.gsm-bb__cal-nav:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* calendar grid */
.gsm-bb__cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}
.gsm-bb__cal-dow {
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	color: var(--gsm-muted);
	text-transform: uppercase;
	padding: 4px 0 6px;
}
.gsm-bb__cal-cell {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1px;
}
.gsm-bb__day {
	width: 100% !important;
	height: 100%;
	border-radius: 8px;
	font-size: 15px !important;
	font-weight: 500;
	color: var(--gsm-ink) !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	text-align: center !important;
	background: transparent !important;
}
.gsm-bb__day:hover:not(:disabled):not(.is-start):not(.is-end) {
	background: var(--gsm-red-soft) !important;
	color: var(--gsm-red) !important;
}
.gsm-bb__day:disabled {
	color: #c7ccd4 !important;
	cursor: not-allowed;
	background: transparent !important;
}
.gsm-bb__day.is-preview {
	background: var(--gsm-red-soft) !important;
	color: var(--gsm-red) !important;
	border-radius: 0;
}
.gsm-bb__day.is-range {
	background: var(--gsm-red-soft) !important;
	color: var(--gsm-red) !important;
	border-radius: 0;
}
.gsm-bb__day.is-start,
.gsm-bb__day.is-end {
	background: var(--gsm-red) !important;
	color: #fff !important;
	font-weight: 700;
}
.gsm-bb__day.is-start {
	border-radius: 8px 0 0 8px;
}
.gsm-bb__day.is-end {
	border-radius: 0 8px 8px 0;
}
.gsm-bb__day.is-start.is-end {
	border-radius: 8px;
}
.gsm-bb__day.is-today:not(.is-start):not(.is-end) {
	box-shadow: inset 0 0 0 1.5px var(--gsm-red);
}

/* calendar footer */
.gsm-bb__cal-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--gsm-line);
}
.gsm-bb__cal-summary {
	font-size: 12px;
	color: var(--gsm-muted);
	text-transform: capitalize;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.gsm-bb__cal-note {
	color: var(--gsm-red);
	font-weight: 600;
}
/* .gsm-bb prefix so the fill outranks the .gsm-bb button reset (same reason as .gsm-bb__book) */
.gsm-bb .gsm-bb__cal-done {
	background: var(--gsm-red) !important;
	color: #fff !important;
	font-size: 13px !important;
	font-weight: 700;
	text-align: center !important;
	border-radius: 8px;
	padding: 8px 18px !important;
	flex: none;
}
.gsm-bb__cal-done:hover {
	background: var(--gsm-red-dark) !important;
}
.gsm-bb__cal-done:disabled {
	background: #e6a6ae !important;
	cursor: not-allowed;
}

/* time list */
.gsm-bb__times {
	max-height: 340px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 4px !important;
	scrollbar-width: thin;
	scrollbar-color: #cfd6df transparent;
	overscroll-behavior: contain;
}
.gsm-bb__times::-webkit-scrollbar {
	width: 8px;
}
.gsm-bb__times::-webkit-scrollbar-thumb {
	background: #d7dde4;
	border-radius: 8px;
}
.gsm-bb__time {
	display: flex !important;
	align-items: center;
	flex: none;
	min-height: 60px;
	padding: 0 22px !important;
	border-radius: 12px;
	font-size: 26px !important;
	font-weight: 500;
	line-height: 1;
	color: var(--gsm-ink) !important;
	background: transparent !important;
	white-space: nowrap;
}
.gsm-bb__time:hover:not(.is-active) {
	background: #f4f5f7 !important;
	color: var(--gsm-ink) !important;
}
.gsm-bb__time.is-active {
	background: var(--gsm-red) !important;
	color: #fff !important;
	font-weight: 700;
}

/* ── responsive: stacked mobile layout ── */
@media (max-width: 860px) {
	.gsm-bb__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		padding: 20px 16px;
	}
	.gsm-bb__divider {
		display: none;
	}
	.gsm-bb__seg {
		flex: none;
		width: 100%;
	}
	/* vehicles: centred, natural width (not stretched) */
	.gsm-bb__vehicles {
		justify-content: center;
		gap: 22px;
		margin-bottom: 2px;
	}
	.gsm-bb__veh {
		flex: 0 0 auto;
	}
	/* date + time: full-width bordered boxes, label left / icon right */
	.gsm-bb__seg--date .gsm-bb__trigger,
	.gsm-bb__seg--time .gsm-bb__trigger {
		flex-direction: row-reverse;
		justify-content: space-between;
		width: 100% !important;
		min-width: 0 !important;
		border: 1px solid var(--gsm-line);
		border-radius: 12px;
		padding: 17px 18px !important;
		min-height: 60px;
	}
	/* Prenota: centred pill */
	.gsm-bb__seg--cta {
		justify-content: center;
	}
	.gsm-bb__book {
		width: auto;
		padding: 15px 64px !important;
	}
	/* popovers pinned to BOTH edges of the field so they can never overflow the container/viewport */
	.gsm-bb__pop {
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
	}
	.gsm-bb__pop--cal,
	.gsm-bb__pop--time {
		width: auto;
	}
	.gsm-bb__cal-months {
		gap: 0;
	}
	.gsm-bb__cal-month {
		width: 100%; /* the single month fills the popover (which is the field width) */
	}
	.gsm-bb__times {
		max-height: 44vh;
	}
}
