/**
 * "Ask for a better price" button and modal.
 *
 * Sits next to Add to Bag, so it borrows the theme's button metrics and stays
 * visually secondary: this is the quieter of the two actions, not a competing CTA.
 */

.rrc-offer-trigger {
	margin-left: .5em;
	background: transparent;
	border: 1px solid currentColor;
	opacity: .9;
}

.rrc-offer-trigger:hover,
.rrc-offer-trigger:focus {
	opacity: 1;
}

.rrc-offer-staff-flag {
	display: inline-block;
	margin-left: .5em;
	padding: .1em .45em;
	border-radius: 3px;
	background: #b32d2e;
	color: #fff;
	font-size: .7em;
	text-transform: uppercase;
	letter-spacing: .04em;
	vertical-align: middle;
}

.rrc-offer-overlay {
	position: fixed;
	inset: 0;
	/* Above the theme's own overlays (search, mobile menu) which sit at 100000. */
	z-index: 100010;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, .55);
}

.rrc-offer-overlay[hidden] {
	display: none;
}

body.rrc-offer-open {
	overflow: hidden;
}

/*
 * The LeadConnector chat bubble renders inside a shadow root and pins itself to the
 * bottom-right, so it lands on top of the modal's consent text and submit button on a
 * phone. z-index cannot reach into a shadow root, so hide the whole element while the
 * dialog is open and give it straight back on close.
 */
body.rrc-offer-open chat-widget,
body.rrc-offer-open #leadconnector-chat-widget-js {
	display: none !important;
}

.rrc-offer-panel {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 28px 24px;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

.rrc-offer-panel h2 {
	margin: 0 0 .5em;
	padding-right: 44px;
	font-size: 1.35em;
}

/*
 * Hard reset. This is a <button>, so the theme's global button rules land on it and
 * were giving it a dark pill background, its own padding and a min-height, which is
 * what made it look squashed with the glyph off-centre. Specificity plus !important
 * on the layout properties is the only reliable way to opt out of that.
 */
.rrc-offer-overlay .rrc-offer-panel .rrc-offer-close {
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	/* 44px, WCAG 2.5.8, and square so the icon cannot be stretched. */
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-indent: 0 !important;
	text-shadow: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	cursor: pointer;
	opacity: .65;
	transition: opacity .12s ease, background-color .12s ease;
}

.rrc-offer-overlay .rrc-offer-panel .rrc-offer-close:hover,
.rrc-offer-overlay .rrc-offer-panel .rrc-offer-close:focus-visible {
	opacity: 1;
	background: rgba(0, 0, 0, .06) !important;
}

.rrc-offer-overlay .rrc-offer-panel .rrc-offer-close svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.rrc-offer-intro {
	margin: 0 0 1.25em;
	opacity: .8;
}

.rrc-offer-field {
	margin: 0 0 .9em;
}

.rrc-offer-field label {
	display: block;
	margin-bottom: .25em;
	font-weight: 600;
	font-size: .9em;
}

.rrc-offer-field input {
	width: 100%;
	/* 16px minimum, or iOS Safari zooms the whole page on focus. */
	font-size: 16px;
	padding: 10px 12px;
	border: 1px solid #b9b9b9;
	border-radius: 4px;
}

/* Hidden from people and assistive tech, still submitted by a naive bot. */
.rrc-offer-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.rrc-offer-consent {
	margin: 1.1em 0;
	font-size: .9em;
}

.rrc-offer-consent label {
	display: flex;
	gap: .5em;
	align-items: flex-start;
	font-weight: 600;
	/* 44px tap target, WCAG 2.5.8. */
	min-height: 44px;
	cursor: pointer;
}

.rrc-offer-consent input {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	flex: 0 0 auto;
}

.rrc-offer-consent-text {
	display: block;
	margin-top: .5em;
	opacity: .7;
	font-size: .85em;
	line-height: 1.45;
}

.rrc-offer-turnstile {
	margin: 1em 0;
}

.rrc-offer-status {
	margin: .75em 0 0;
	font-size: .9em;
}

.rrc-offer-status.is-error {
	color: #b32d2e;
	font-weight: 600;
}

.rrc-offer-status.is-success {
	color: #1a7f37;
	font-weight: 600;
	font-size: 1.05em;
}

.rrc-offer-actions {
	margin: 1.1em 0 0;
}

.rrc-offer-submit {
	width: 100%;
	min-height: 48px;
}

.rrc-offer-submit[disabled] {
	opacity: .6;
	cursor: default;
}

.rrc-offer-preview-flag {
	margin: 0 0 1em;
	/* Right padding clears the absolutely positioned close button. */
	padding: .5em 44px .5em .75em;
	border-left: 3px solid #b32d2e;
	background: #fdf0f0;
	font-size: .85em;
}

@media screen and (max-width: 480px) {
	.rrc-offer-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.rrc-offer-panel {
		max-width: none;
		max-height: 92vh;
		border-radius: 12px 12px 0 0;
	}

	.rrc-offer-trigger {
		display: block;
		width: 100%;
		margin: .6em 0 0;
	}
}
