/*
 * "Réserver" button + confirmation dialog on ERP vehicle pages.
 * Theme colours: primary #ffa633, text #201F1D (same dark as "Rent Now").
 */

/* The theme's "Option de dépôt" (pay a deposit online) does not apply: an ERP
   booking is a request the agency confirms, paid on site. */
.single-rental .theiaStickySidebar .modalnew:has(.dsrent-deposit) {
	display: none !important;
}

/* ── Button ─────────────────────────────────────────────────────────────── */

.rx-book {
	margin-top: 18px;
}

.rx-book-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 50px;
	padding: 12px 18px;
	border: 0;
	border-radius: 10px;
	background: #201f1d;
	color: #fff !important;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .15s ease, transform .05s ease;
}

.rx-book-btn:hover {
	background: #000;
}

.rx-book-btn:active {
	transform: translateY(1px);
}

.rx-book-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 166, 51, .55);
}

.rx-book-note {
	margin: 8px 0 0;
	color: #8a8a8a;
	font-size: 12px;
	text-align: center;
}

.rx-book-error:not(:empty) {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fdecec;
	color: #b42318;
	font-size: 13px;
}

/* ── Live total ─────────────────────────────────────────────────────────── */

.rx-live {
	margin-bottom: 12px;
	padding: 14px 16px;
	border: 1px solid #ececec;
	border-radius: 12px;
	background: #fcfbfb;
	transition: opacity .15s ease;
}

.rx-live.is-loading {
	opacity: .55;
}

.rx-live-msg {
	margin: 0;
	color: #6b6b6b;
	font-size: 13px;
	text-align: center;
}

.rx-live[data-state="warn"] {
	border-color: #f3c98b;
	background: #fff4e6;
}

.rx-live[data-state="warn"] .rx-live-msg {
	color: #8a5a00;
}

.rx-live-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed #dcdcdc;
}

.rx-live-total span {
	font-size: 14px;
	font-weight: 600;
}

.rx-live-total strong {
	color: #201f1d;
	font-size: 22px;
	font-weight: 700;
}

/* ── Dialog shell ───────────────────────────────────────────────────────── */

html.rx-noscroll {
	overflow: hidden;
}

.rx-dialog {
	width: min(560px, calc(100vw - 24px));
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #fff;
	color: #201f1d;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	overflow: auto;
}

.rx-dialog::backdrop {
	background: rgba(20, 20, 20, .55);
}

/* Browsers without <dialog>: same look, fixed and centred. */
.rx-dialog[open]:not(:modal) {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.rx-dlg-head {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 1px solid #f0f0f0;
	background: #fff;
}

.rx-dlg-head h3 {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
}

.rx-dlg-x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #f4f4f4;
	color: #201f1d;
	font-size: 18px;
	cursor: pointer;
}

.rx-dlg-x:hover {
	background: #e9e9e9;
}

.rx-dlg-body {
	padding: 18px 22px 22px;
}

.rx-small {
	margin: 6px 0 0;
	color: #7a7a7a;
	font-size: 12.5px;
	line-height: 1.45;
}

/* ── Loading / problem ──────────────────────────────────────────────────── */

.rx-dlg-loading {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 28px 4px;
	color: #6b6b6b;
}

.rx-spin {
	width: 22px;
	height: 22px;
	border: 3px solid #ffe0b8;
	border-top-color: #ffa633;
	border-radius: 50%;
	animation: rx-spin .8s linear infinite;
}

@keyframes rx-spin {
	to { transform: rotate(360deg); }
}

.rx-dlg-problem {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 14px 16px;
	border-radius: 12px;
	background: #fff4e6;
}

.rx-dlg-problem i {
	color: #f29418;
	font-size: 20px;
	line-height: 1.2;
}

.rx-dlg-problem p {
	margin: 0;
	font-size: 14.5px;
}

/* ── Trip + price ───────────────────────────────────────────────────────── */

.rx-trip {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 16px;
	margin-bottom: 14px;
}

.rx-trip-car {
	grid-column: 1 / -1;
	font-size: 17px;
	font-weight: 700;
}

.rx-leg {
	display: flex;
	flex-direction: column;
	padding: 10px 12px;
	border-radius: 10px;
	background: #f7f7f7;
	line-height: 1.35;
}

.rx-leg-title {
	color: #8a8a8a;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.rx-leg-place {
	font-size: 14px;
	font-weight: 600;
}

.rx-leg-when {
	color: #4a4a4a;
	font-size: 13px;
}

.rx-price-box {
	padding: 14px 16px;
	border: 1px solid #ececec;
	border-radius: 12px;
}

.rx-lines {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px 16px;
	margin: 0;
}

.rx-lines dt {
	display: flex;
	flex-direction: column;
	font-weight: 500;
}

.rx-line-label {
	font-size: 14px;
}

.rx-line-detail {
	color: #8a8a8a;
	font-size: 12px;
	font-weight: 400;
}

.rx-lines dd {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	text-align: right;
}

.rx-lines dd.is-discount {
	color: #1f8a4c;
}

.rx-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed #dcdcdc;
	font-size: 15px;
}

.rx-total strong {
	font-size: 22px;
}

.rx-deposit i {
	color: #ffa633;
}

.rx-warn {
	color: #9a6700;
}

/* ── Details form ───────────────────────────────────────────────────────── */

.rx-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px 14px;
	margin-top: 18px;
}

.rx-form h4,
.rx-form .rx-consent,
.rx-form .rx-form-error,
.rx-form .rx-dlg-actions,
.rx-form .rx-field:nth-of-type(5) {
	grid-column: 1 / -1;
}

.rx-form h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
}

.rx-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.rx-field label {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
}

.rx-req {
	color: #d14343;
}

.rx-opt {
	color: #9a9a9a;
	font-weight: 400;
}

.rx-field input,
.rx-field textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid #e2e2e2;
	border-radius: 9px;
	background: #fcfbfb;
	color: #201f1d;
	font-size: 15px;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.rx-field textarea {
	resize: vertical;
}

.rx-field input:focus,
.rx-field textarea:focus {
	border-color: #ffa633;
	box-shadow: 0 0 0 3px rgba(255, 166, 51, .2);
	background: #fff;
}

.rx-field .is-invalid {
	border-color: #d14343;
	box-shadow: 0 0 0 3px rgba(209, 67, 67, .15);
}

.rx-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.rx-form-error:not(:empty) {
	padding: 10px 12px;
	border-radius: 8px;
	background: #fdecec;
	color: #b42318;
	font-size: 13px;
}

/* ── Actions ────────────────────────────────────────────────────────────── */

.rx-dlg-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 16px;
}

.rx-btn {
	min-height: 46px;
	padding: 10px 18px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.rx-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 166, 51, .55);
}

.rx-btn-primary {
	border: 0;
	background: #ffa633;
	color: #fff !important;
}

.rx-btn-primary:hover {
	background: #f29418;
}

.rx-btn-primary:disabled {
	opacity: .7;
	cursor: progress;
}

.rx-btn-ghost {
	border: 1px solid #dcdcdc;
	background: #fff;
	color: #201f1d !important;
}

.rx-btn-ghost:hover {
	border-color: #201f1d;
}

/* Total + buttons, always visible at the bottom of the dialog. */
.rx-dlg-bar {
	position: sticky;
	bottom: 0;
	z-index: 1;
	align-items: center;
	margin: 4px -22px -22px;
	padding: 12px 22px;
	border-top: 1px solid #f0f0f0;
	background: #fff;
}

.rx-bar-total {
	display: flex;
	flex-direction: column;
	margin-right: auto;
	line-height: 1.2;
}

.rx-bar-total span {
	color: #8a8a8a;
	font-size: 12px;
}

.rx-bar-total strong {
	font-size: 20px;
	white-space: nowrap;
}

/* ── Done ───────────────────────────────────────────────────────────────── */

.rx-done {
	text-align: center;
}

.rx-done-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 4px 0 14px;
	border-radius: 50%;
	background: #e7f6ec;
	color: #1f8a4c;
	font-size: 30px;
}

.rx-done p {
	margin: 6px 0 0;
	font-size: 14.5px;
}

.rx-done-ref {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-bottom: 10px !important;
}

.rx-done-ref span {
	color: #8a8a8a;
	font-size: 12px;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.rx-done-ref strong {
	font-size: 26px;
	letter-spacing: .02em;
}

.rx-dry {
	display: inline-block;
	margin-top: 14px !important;
	padding: 6px 12px;
	border-radius: 999px;
	background: #fff4e6;
	color: #9a6700;
	font-size: 12.5px !important;
	font-weight: 600;
}

.rx-done + .rx-dlg-actions {
	justify-content: center;
}

@media (max-width: 575.98px) {
	.rx-trip,
	.rx-form {
		grid-template-columns: 1fr;
	}

	.rx-dlg-actions {
		flex-direction: column-reverse;
	}

	.rx-btn {
		width: 100%;
	}

	/* Phone: total on its own line, the two buttons side by side under it. */
	.rx-dlg-bar {
		flex-flow: row wrap;
	}

	.rx-dlg-bar .rx-bar-total {
		flex: 1 0 100%;
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
	}

	.rx-dlg-bar .rx-btn {
		flex: 1 1 0;
		width: auto;
		padding: 10px 12px;
		font-size: 14px;
	}

	.rx-dlg-bar .rx-submit {
		flex-grow: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rx-spin {
		animation-duration: 2s;
	}
}
