/* RS Transfer Booking — frontend */

.rstb-wrap {
	--rstb-bg: #f3eee6;
	--rstb-surface: #ffffff;
	--rstb-yellow: #f5c518;
	--rstb-yellow-hover: #e6b800;
	--rstb-text: #1a1a1a;
	--rstb-muted: #6b6b6b;
	--rstb-border: #e5e0d8;
	--rstb-radius: 4px;
	--rstb-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--rstb-shell-h: clamp(85vh, 88vh, 90vh);

	font-family: var(--rstb-font);
	color: var(--rstb-text);
	background: var(--rstb-bg);
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	padding: 20px 0 16px;
	height: var(--rstb-shell-h);
	min-height: 85vh;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.rstb-inner {
	width: 80vw;
	max-width: 80vw;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

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

.rstb-form {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	overflow: hidden;
}

.rstb-panel {
	flex: 0 1 auto;
	min-height: 0;
	display: none;
	flex-direction: column;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.rstb-panel.is-active {
	display: flex;
}

/* Steps */
.rstb-steps {
	flex: 0 0 auto;
	margin-bottom: 16px;
}

.rstb-steps__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	list-style: none;
	margin: 0;
	padding: 0;
	align-items: center;
	justify-content: center;
}

.rstb-steps__item {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--rstb-muted);
	font-size: 13px;
	font-weight: 600;
}

.rstb-steps__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #ddd8cf;
	color: #555;
	font-size: 13px;
	font-weight: 700;
	flex-shrink: 0;
}

.rstb-steps__item.is-active .rstb-steps__num,
.rstb-steps__item.is-done .rstb-steps__num {
	background: var(--rstb-yellow);
	color: #111;
}

.rstb-steps__item.is-active .rstb-steps__label {
	color: var(--rstb-text);
}

.rstb-steps__label {
	white-space: nowrap;
}

/* Layout step 1 */
.rstb-layout {
	display: grid;
	grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.15fr);
	gap: clamp(20px, 2.5vw, 36px);
	align-items: stretch;
	flex: 0 0 auto;
	min-height: 0;
	height: auto;
	width: 100%;
}

.rstb-layout__form {
	min-width: 0;
	height: auto;
	overflow: visible;
	padding-right: 8px;
}

.rstb-layout__map {
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--rstb-surface);
	border: 1px solid var(--rstb-border);
	overflow: hidden;
	height: auto;
	align-self: stretch;
}

.rstb-map-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #faf7f1;
	border-bottom: 1px solid var(--rstb-border);
	flex: 0 0 auto;
}

.rstb-map-tools__hint {
	font-size: 12px;
	font-weight: 600;
	color: var(--rstb-muted);
	margin-right: 4px;
}

.rstb-map-tools__btn {
	height: 32px;
	padding: 0 14px;
	border: 1px solid var(--rstb-border);
	background: #fff;
	color: var(--rstb-text);
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	border-radius: var(--rstb-radius);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.rstb-map-tools__btn:hover {
	border-color: #c9c2b6;
}

.rstb-map-tools__btn.is-active[data-pin-target="pickup"] {
	background: #22a06b;
	border-color: #22a06b;
	color: #fff;
}

.rstb-map-tools__btn.is-active[data-pin-target="dropoff"] {
	background: #d64545;
	border-color: #d64545;
	color: #fff;
}

.rstb-map {
	width: 100%;
	flex: 1 1 auto;
	min-height: 200px;
	height: auto;
	background: #e8e4dc;
	z-index: 0;
	cursor: crosshair;
}

.rstb-pin {
	background: transparent !important;
	border: none !important;
}

.rstb-poi {
	background: transparent !important;
	border: none !important;
}

.rstb-poi__dot {
	display: block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.rstb-poi-tooltip {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	color: #111 !important;
	border: 1px solid #ddd !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.rstb-input.is-locating {
	opacity: 0.7;
	font-style: italic;
}

.rstb-metrics {
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: #fff;
	border-top: 1px solid var(--rstb-border);
	flex: 0 0 auto;
}

.rstb-metric {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
}

.rstb-metric + .rstb-metric {
	border-left: 1px solid var(--rstb-border);
}

.rstb-metric__icon {
	flex-shrink: 0;
	display: flex;
}

.rstb-metric__label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--rstb-text);
	margin-bottom: 2px;
}

.rstb-metric__value {
	display: block;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--rstb-text);
}

/* Fields */
.rstb-section-title {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rstb-text);
}

.rstb-field {
	margin-bottom: 14px;
}

.rstb-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 6px;
	color: var(--rstb-text);
}

.rstb-input,
.rstb-select,
.rstb-textarea {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--rstb-border);
	background: var(--rstb-surface);
	border-radius: var(--rstb-radius);
	font-size: 14px;
	font-family: inherit;
	color: var(--rstb-text);
	outline: none;
	appearance: none;
	-webkit-appearance: none;
}

.rstb-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
	cursor: pointer;
}

.rstb-textarea {
	height: auto;
	padding: 12px 14px;
	resize: vertical;
	min-height: 100px;
}

.rstb-input:focus,
.rstb-select:focus,
.rstb-textarea:focus {
	border-color: #c9c2b6;
	box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.25);
}

.rstb-row {
	display: grid;
	gap: 14px;
}

.rstb-row--2 {
	grid-template-columns: 1fr 1fr;
}

.rstb-loc-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.rstb-loc-row .rstb-autocomplete {
	flex: 1;
	min-width: 0;
}

.rstb-add-stop {
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	border: none;
	background: var(--rstb-yellow);
	color: #111;
	font-size: 26px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	border-radius: var(--rstb-radius);
	transition: background 0.15s ease;
}

.rstb-add-stop:hover {
	background: var(--rstb-yellow-hover);
}

.rstb-stop-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
	margin-bottom: 14px;
}

.rstb-stop-row .rstb-autocomplete {
	flex: 1;
}

.rstb-remove-stop {
	width: 46px;
	height: 46px;
	flex-shrink: 0;
	border: 1px solid var(--rstb-border);
	background: #fff;
	color: #888;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	border-radius: var(--rstb-radius);
}

.rstb-remove-stop:hover {
	color: #c00;
	border-color: #c00;
}

/* Autocomplete */
.rstb-autocomplete {
	position: relative;
}

.rstb-suggestions {
	position: absolute;
	z-index: 50;
	left: 0;
	right: 0;
	top: 100%;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--rstb-border);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	max-height: 240px;
	overflow-y: auto;
}

.rstb-suggestions li {
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: #1a1a1a;
	cursor: pointer;
	border-bottom: 1px solid #f0ebe3;
}

.rstb-suggestions li:hover,
.rstb-suggestions li.is-active {
	background: #faf7f1;
	color: #111;
}

.rstb-suggestions li:last-child {
	border-bottom: none;
}

/* Phone */
.rstb-phone {
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 8px;
}

.rstb-contact,
.rstb-summary,
#rstb-vehicles {
	flex: 0 1 auto;
	min-height: 0;
	overflow-y: visible;
}

/* Vehicles */
.rstb-vehicles {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	align-content: start;
	width: 100%;
}

.rstb-vehicle {
	border: 2px solid var(--rstb-border);
	background: #fff;
	padding: 0;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	border-radius: var(--rstb-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 280px;
}

.rstb-vehicle:hover {
	border-color: #d4cdb8;
}

.rstb-vehicle.is-selected {
	border-color: var(--rstb-yellow);
	box-shadow: 0 0 0 1px var(--rstb-yellow);
}

.rstb-vehicle__media {
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #ebe5db;
	overflow: hidden;
	flex: 1 1 auto;
	min-height: 180px;
}

.rstb-vehicle__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	margin: 0;
	background: #ebe5db;
}

.rstb-vehicle__img--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666;
	font-size: 14px;
	font-weight: 600;
	height: 100%;
	min-height: 180px;
}

.rstb-vehicle__name {
	font-size: 17px;
	font-weight: 800;
	margin: 0;
	padding: 16px 12px;
	color: #111;
	flex: 0 0 auto;
}

.rstb-vehicles__empty {
	padding: 24px;
	background: #fff;
	border: 1px dashed var(--rstb-border);
	color: var(--rstb-muted);
	text-align: center;
	grid-column: 1 / -1;
}

@media (max-width: 1100px) {
	.rstb-vehicles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.rstb-vehicles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.rstb-vehicles {
		grid-template-columns: 1fr;
	}
}

/* Summary */
.rstb-summary {
	background: transparent;
	border: none;
	padding: 0;
	max-width: 920px;
}

.rstb-summary__card {
	background: #fff;
	border: 1px solid var(--rstb-border);
	border-radius: var(--rstb-radius);
	overflow: hidden;
}

.rstb-summary__route {
	padding: 14px 16px;
	border-bottom: 1px solid var(--rstb-border);
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #faf7f1;
}

.rstb-summary__point {
	display: grid;
	grid-template-columns: 78px 1fr;
	gap: 10px;
	align-items: start;
}

.rstb-summary__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 22px;
	padding: 0 8px;
	border-radius: 3px;
	background: #e8e2d8;
	color: #333;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.rstb-summary__badge--pickup {
	background: #e6f5ee;
	color: #176b45;
}

.rstb-summary__badge--dropoff {
	background: #fdeced;
	color: #a12b2b;
}

.rstb-summary__addr,
.rstb-summary__stops li {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	color: #1a1a1a;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	word-break: break-word;
}

.rstb-summary__stops {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.rstb-summary__meta,
.rstb-summary__contact-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	background: var(--rstb-border);
	border-bottom: 1px solid var(--rstb-border);
}

.rstb-summary__chip {
	background: #fff;
	padding: 10px 12px;
	min-height: 56px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
}

.rstb-summary__chip-label {
	display: block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--rstb-muted);
}

.rstb-summary__chip-value {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #111;
	line-height: 1.25;
	word-break: break-word;
}

.rstb-summary__contact {
	padding: 12px 14px 14px;
}

.rstb-summary__heading {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--rstb-text);
}

.rstb-summary__contact .rstb-summary__contact-grid {
	border: 1px solid var(--rstb-border);
	border-bottom: none;
}

.rstb-summary__contact-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	border-radius: var(--rstb-radius) var(--rstb-radius) 0 0;
	overflow: hidden;
}

.rstb-summary__message {
	border: 1px solid var(--rstb-border);
	border-top: none;
	border-radius: 0 0 var(--rstb-radius) var(--rstb-radius);
	padding: 10px 12px;
	background: #fff;
}

.rstb-summary__message p {
	margin: 4px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.4;
}

.rstb-panel[data-panel="4"] .rstb-section-title {
	margin-bottom: 12px;
}

@media (max-width: 900px) {
	.rstb-summary__meta {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.rstb-summary__contact-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.rstb-summary__meta,
	.rstb-summary__contact-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rstb-summary__point {
		grid-template-columns: 1fr;
		gap: 4px;
	}
}

.rstb-success {
	margin-top: 20px;
	padding: 20px;
	background: #eef8e8;
	border: 1px solid #b7dfb0;
	color: #1e5a1a;
	font-weight: 600;
}

/* Footer nav */
.rstb-footer {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
	padding-top: 0;
	flex: 0 0 auto;
}

.rstb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 48px;
	padding: 0 22px;
	border: none;
	border-radius: var(--rstb-radius);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.rstb-btn--primary {
	background: var(--rstb-yellow);
	color: #111;
	min-width: 200px;
}

.rstb-btn--primary:hover {
	background: var(--rstb-yellow-hover);
}

.rstb-btn--primary:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.rstb-btn--ghost {
	background: transparent;
	color: var(--rstb-muted);
	border: 1px solid var(--rstb-border);
}

.rstb-btn--ghost:hover {
	color: var(--rstb-text);
	border-color: #c9c2b6;
}

.rstb-btn__arrow {
	font-size: 18px;
	line-height: 1;
}

.rstb-panel[hidden] {
	display: none !important;
}

.rstb-panel.is-active[hidden] {
	display: none !important;
}

.rstb-field.is-invalid .rstb-input,
.rstb-field.is-invalid .rstb-select {
	border-color: #d64545;
}

/* Flatpickr tweak */
.rstb-wrap .flatpickr-calendar {
	font-family: var(--rstb-font);
}

.rstb-wrap .flatpickr-day.selected,
.rstb-wrap .flatpickr-day.startRange,
.rstb-wrap .flatpickr-day.endRange {
	background: var(--rstb-yellow);
	border-color: var(--rstb-yellow);
	color: #111;
}

/* Responsive */
@media (max-width: 900px) {
	.rstb-wrap {
		width: 100%;
		max-width: 100%;
		left: auto;
		right: auto;
		margin-left: 0;
		margin-right: 0;
		height: auto;
		min-height: 85vh;
		max-height: none;
		overflow: visible;
		padding: 16px 0;
	}

	.rstb-inner {
		width: 100%;
		max-width: 100%;
		padding: 0 12px;
		overflow: visible;
		height: auto;
	}

	.rstb-form,
	.rstb-panel.is-active {
		overflow: visible;
		height: auto;
	}

	.rstb-layout {
		grid-template-columns: 1fr;
		height: auto;
	}

	.rstb-layout__form {
		overflow: visible;
		padding-right: 0;
	}

	.rstb-layout__map {
		height: auto;
		min-height: 0;
	}

	.rstb-map {
		flex: none;
		height: 280px;
		min-height: 280px;
	}

	.rstb-steps__list {
		gap: 12px 16px;
		justify-content: flex-start;
	}

	.rstb-steps__label {
		font-size: 12px;
	}
}

@media (max-width: 600px) {
	.rstb-wrap {
		padding: 14px 0 16px;
		min-height: 85vh;
	}

	.rstb-inner {
		padding: 0 12px;
	}

	.rstb-row--2 {
		grid-template-columns: 1fr;
	}

	.rstb-phone {
		grid-template-columns: 1fr;
	}

	.rstb-metric {
		padding: 14px 12px;
		gap: 10px;
	}

	.rstb-metric__value {
		font-size: 18px;
	}

	.rstb-footer {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.rstb-btn--primary {
		width: 100%;
	}
}
