/*
 * Clean Speed Bike Finder
 * Deliberately light: fonts, select styling and the button come from Botiga
 * (the button uses Botiga's own .button class). Override the variables below
 * in Appearance → Customize → Additional CSS if you want to tweak it.
 */

.csbf {
	--csbf-gap: 12px;
	--csbf-padding: 20px;
	--csbf-radius: 0;
	--csbf-border: rgba(33, 33, 33, 0.12);
	--csbf-bg: rgba(33, 33, 33, 0.03);
	--csbf-label: inherit;

	margin: 0 0 30px;
	padding: var(--csbf-padding);
	background: var(--csbf-bg);
	border: 1px solid var(--csbf-border);
	border-radius: var(--csbf-radius);
	box-sizing: border-box;
	width: 100%;
	clear: both;
}

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

.csbf__form {
	margin: 0;
}

.csbf__title {
	margin: 0 0 14px;
	font-weight: 600;
	font-size: 1.1em;
	line-height: 1.3;
}

.csbf__fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	gap: var(--csbf-gap);
	align-items: end;
}

.csbf--has-parts .csbf__fields {
	grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.csbf__field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.csbf__label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--csbf-label);
}

.csbf .csbf__select {
	width: 100%;
	max-width: 100%;
	margin: 0;
	min-height: 46px;
}

.csbf .csbf__select:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.csbf .csbf__submit {
	width: 100%;
	min-height: 46px;
	margin: 0;
	white-space: nowrap;
}

.csbf .csbf__submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.csbf--loading .csbf__submit {
	cursor: progress;
}

.csbf__status:empty {
	display: none;
}

/* Tablets: two columns, button full width. */
@media (max-width: 991px) {
	.csbf__fields,
	.csbf--has-parts .csbf__fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.csbf__field--submit {
		grid-column: 1 / -1;
	}
}

/* Phones and the stacked layout: one column. */
@media (max-width: 575px) {
	.csbf {
		--csbf-padding: 16px;
	}

	.csbf__fields,
	.csbf--has-parts .csbf__fields {
		grid-template-columns: minmax(0, 1fr);
	}
}

.csbf--stacked .csbf__fields,
.csbf--stacked.csbf--has-parts .csbf__fields {
	grid-template-columns: minmax(0, 1fr);
}

.csbf--stacked .csbf__field--submit {
	grid-column: auto;
}

/* Sidebars and footer widget areas are narrow: always stack there. */
.widget .csbf__fields,
.widget .csbf--has-parts .csbf__fields,
.sidebar-wrapper .csbf__fields {
	grid-template-columns: minmax(0, 1fr);
}

.csbf-admin-note {
	padding: 10px 14px;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
}

/* ==========================================================================
   Sticky finder bar
   Colors can be overridden in Additional CSS, e.g.
   .csbf-bar { --csbf-bar-bg: #e85c0d; --csbf-bar-color: #fff; }
   ========================================================================== */

.csbf-bar-wrap {
	position: relative;
	z-index: 998; /* below Botiga's header menus, above page content */
}

/* While open, lift above Botiga's header so the phone sheet and backdrop cover everything. */
.csbf-bar-wrap--open {
	z-index: 100000;
}

.csbf-bar-wrap--pending {
	display: none;
}

.csbf-bar-wrap--float {
	height: 0;
}

.csbf-bar {
	--csbf-bar-bg: #212121;
	--csbf-bar-color: #ffffff;
	--csbf-bar-accent: #ffffff;
	--csbf-bar-accent-text: #212121;
	--csbf-bar-height: 48px;
	--csbf-bar-top: 0px;

	position: relative;
	z-index: 2; /* keeps the bar and its sheet above the backdrop */
	background: var(--csbf-bar-bg);
	color: var(--csbf-bar-color);
	font-size: 15px;
	line-height: 1.3;
	transition: transform 0.25s ease, visibility 0.25s;
}

.csbf-bar--fixed {
	position: fixed;
	top: var(--csbf-bar-top);
	left: 0;
	right: 0;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.csbf-bar--tucked {
	transform: translateY(calc(-100% - var(--csbf-bar-top) - 10px));
	visibility: hidden;
	pointer-events: none;
}

.csbf-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: var(--csbf-bar-height);
}

.csbf-bar .csbf-bar__text {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	min-width: 0;
	color: inherit;
}

.csbf-bar__icon {
	flex: 0 0 auto;
	opacity: 0.85;
}

.csbf-bar__msg {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.csbf-bar__msg strong {
	font-weight: 700;
}

.csbf-bar__actions {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: 0 0 auto;
}

.csbf-bar .csbf-bar__shop {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.csbf-bar .csbf-bar__shop:hover,
.csbf-bar .csbf-bar__shop:focus {
	color: inherit;
	opacity: 0.8;
}

.csbf-bar .csbf-bar__toggle {
	background: var(--csbf-bar-accent);
	color: var(--csbf-bar-accent-text);
	border: 0;
	margin: 0;
	padding: 8px 18px;
	min-height: 34px;
	font-size: 14px;
	line-height: 1.2;
	white-space: nowrap;
}

.csbf-bar .csbf-bar__toggle:hover,
.csbf-bar .csbf-bar__toggle:focus {
	background: var(--csbf-bar-accent);
	color: var(--csbf-bar-accent-text);
	opacity: 0.9;
}

/* Dropdown panel (desktop) */
.csbf-bar__panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	color: #212121;
	border-bottom: 1px solid rgba(33, 33, 33, 0.12);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.15);
	padding: 18px 0 2px;
}

.csbf-bar__panel[hidden],
.csbf-bar__backdrop[hidden] {
	display: none;
}

.csbf-bar__panel-head {
	display: none;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	font-weight: 600;
	font-size: 1.05em;
}

.csbf-bar .csbf-bar__close {
	background: none;
	border: 0;
	padding: 6px;
	margin: -6px;
	color: inherit;
	cursor: pointer;
	line-height: 0;
}

.csbf-bar__panel .csbf {
	margin-bottom: 16px;
	padding: 0;
	background: none;
	border: 0;
}

.csbf-bar__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 1;
}

html.csbf-lock,
html.csbf-lock body {
	overflow: hidden;
}

/* Phones: compact bar, finder opens as a bottom sheet */
@media (max-width: 767px) {
	.csbf-bar {
		--csbf-bar-height: 44px;
		font-size: 14px;
	}

	.csbf-bar__inner {
		gap: 10px;
	}

	.csbf-bar__actions {
		gap: 12px;
	}

	.csbf-bar__icon {
		display: none;
	}

	/* Give the bike name the room: drop the "Your bike:" prefix on phones. */
	.csbf-bar__prefix {
		display: none;
	}

	.csbf-bar .csbf-bar__toggle {
		padding: 7px 14px;
		min-height: 32px;
		font-size: 13px;
	}

	.csbf-bar__panel {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 100001;
		max-height: 88vh;
		overflow-y: auto;
		overscroll-behavior: contain;
		border-radius: 14px 14px 0 0;
		padding: 18px 0 calc(8px + env(safe-area-inset-bottom));
		animation: csbf-sheet 0.22s ease-out;
	}

	.csbf-bar__panel-head {
		display: flex;
	}
}

@keyframes csbf-sheet {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.csbf-bar,
	.csbf-bar__panel {
		transition: none;
		animation: none;
	}
}
