/**
 * Price Match section + Trustpilot reviews popup.
 * Mobile-first: two stacked cards — a green "promise" card and a white "Need
 * Expert Help?" card. A container query joins them into one split card
 * (green | white) when the section is wide. Each half rounds its OWN outer
 * corners, so no overflow:hidden is needed and the "How Price Match works"
 * tooltip is never clipped. Prefix: hdm-pm-.
 */

.hdm-pm {
	container-type: inline-size;
	container-name: hdmpm;
	margin: 16px 0 22px;
}

.hdm-pm *,
.hdm-pm-modal * {
	box-sizing: border-box;
}

/* Mobile: the two halves are separate stacked cards. */
.hdm-pm-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* ── green promise half ───────────────────────────────────────────────── */
.hdm-pm-green {
	position: relative;
	border-radius: 18px;
	color: #fff;
	background: linear-gradient(160deg, #1f8c4e 0%, #155f3d 100%);
	padding: 22px 20px 18px;
}

/* Clipped layer for the decorative watermark — keeps the half overflow:visible
   so the tooltip can escape. Inherits the half's rounded corners. */
.hdm-pm-bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
}

.hdm-pm-wm {
	position: absolute;
	right: -40px;
	top: -30px;
	width: 180px;
	height: 180px;
	opacity: .08;
	fill: #fff;
}

.hdm-pm-green-inner {
	position: relative; /* above the watermark */
	z-index: 1;
}

.hdm-pm-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, .16);
	padding: 4px 9px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .6px;
	text-transform: uppercase;
	margin-bottom: 10px;
	line-height: 1;
}

.hdm-pm-pill svg {
	width: 13px;
	height: 13px;
	display: block;
}

.hdm-pm-headline {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.4px;
	color: #fff;
}

.hdm-pm-tipwrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	margin-top: 6px;
}

.hdm-pm-how {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font: inherit;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .85);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
}

.hdm-pm-how svg {
	width: 12px;
	height: 12px;
	flex: none;
	color: rgba(255, 255, 255, .85);
}

.hdm-pm-tip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 0;
	width: min(280px, 78vw);
	padding: 10px 12px;
	background: #0f1419;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.45;
	letter-spacing: 0;
	text-transform: none;
	text-align: left;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
	opacity: 0;
	transform: translateY(4px);
	pointer-events: none;
	transition: opacity .14s ease, transform .14s ease;
	z-index: 5;
}

.hdm-pm-tipwrap:hover .hdm-pm-tip,
.hdm-pm-tipwrap:focus-within .hdm-pm-tip,
.hdm-pm-tipwrap.is-open .hdm-pm-tip {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* Trustpilot badge — compact (logo above stars | rating + CTA), opens the popup. */
.hdm-pm-tp {
	margin-top: 16px;
	display: flex;
	width: fit-content;
	max-width: 100%;
	align-items: center;
	gap: 14px;
	background: rgba(255, 255, 255, .97);
	border: 0;
	border-radius: 10px;
	padding: 9px 14px;
	cursor: pointer;
	text-align: left;
	font: inherit;
	transition: background .14s ease;
}

.hdm-pm-tp:hover {
	background: #fff;
}

/* Not-eligible products: the green half shows only the Trustpilot badge (no
   price-match promise), so drop the top margin that separated it from the headline. */
.hdm-pm-tp:first-child {
	margin-top: 0;
}

.hdm-pm-tp-brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
}

.hdm-pm-tp-logo {
	height: 20px;
	width: auto;
	display: block;
}

.hdm-pm-tp-stars {
	height: 16px;
	width: auto;
	display: block;
}

.hdm-pm-tp-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.1;
	gap: 1px;
}

.hdm-pm-tp-score {
	font-size: 20px;
	font-weight: 800;
	color: #0f1419;
}

.hdm-pm-tp-cta {
	font-size: 13px;
	font-weight: 600;
	color: #1666ff;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ── white help half ──────────────────────────────────────────────────── */
.hdm-pm-white {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 16px;
	color: #0f1419;
}

.hdm-pm-help-label {
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .4px;
	text-transform: uppercase;
	color: #0f1419;
}

.hdm-pm-help-sub {
	font-size: 11.5px;
	color: #6b7280;
	line-height: 1.4;
	margin-top: 3px;
	margin-bottom: 12px;
}

.hdm-pm-sarah {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.hdm-pm-avatar {
	position: relative;
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	overflow: hidden;
	background: #e8f5ec;
	border: 2px solid #16a34a;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hdm-pm-avatar svg {
	width: 46px;
	height: 46px;
	display: block;
}

.hdm-pm-dot {
	position: absolute;
	bottom: 1px;
	right: 2px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #fff;
}

.hdm-pm-sarah-tx {
	min-width: 0;
}

.hdm-pm-sarah-name {
	display: block;
	font-size: 14.5px;
	font-weight: 800;
	letter-spacing: -.2px;
}

.hdm-pm-sarah-status {
	display: block;
	margin-top: 1px;
	font-size: 11.5px;
	font-weight: 600;
	color: #15803d;
}

/* Radiating "online" beacon (matches the previous design's pulsing dot). */
.hdm-pm-beacon {
	display: inline-block;
	vertical-align: middle;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, .7);
	animation: hdm-pm-pulse 2s infinite;
}

@keyframes hdm-pm-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
	70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hdm-pm-actions {
	display: flex;
	gap: 8px;
}

.hdm-pm-chat-btn {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #16a34a;
	color: #fff;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition: background .14s ease;
}

.hdm-pm-chat-btn:hover {
	background: #15803d;
	color: #fff;
}

.hdm-pm-chat-btn svg {
	width: 18px;
	height: 18px;
	flex: none;
}

.hdm-pm-icon-btn {
	flex: none;
	width: 44px;
	height: 42px;
	border-radius: 10px;
	border: 1.5px solid #e5e7eb;
	color: #15803d;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: background .14s ease, border-color .14s ease;
}

.hdm-pm-icon-btn:hover {
	background: #f9fafb;
	border-color: #16a34a;
}

.hdm-pm-icon-btn svg {
	width: 18px;
	height: 18px;
}

/* Keyboard focus indicators (WCAG 2.4.7). */
.hdm-pm-tp:focus-visible {
	outline: 2px solid #15803d;
	outline-offset: 2px;
}

.hdm-pm-how:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	border-radius: 3px;
}

.hdm-pm-chat-btn:focus-visible,
.hdm-pm-icon-btn:focus-visible {
	outline: 2px solid #15803d;
	outline-offset: 2px;
}

/* ── wide layout: one split card (green | white) ──────────────────────── */
@container hdmpm (min-width: 600px) {
	.hdm-pm-card {
		display: grid;
		grid-template-columns: 1fr 1.25fr;
		gap: 0;
		align-items: stretch;
		border: 1px solid #e5e7eb;
		border-radius: 16px;
	}

	.hdm-pm-green {
		border-radius: 16px 0 0 16px;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 22px 24px;
	}

	.hdm-pm-white {
		border: 0;
		border-radius: 0 16px 16px 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 20px 22px;
	}

	.hdm-pm-wm {
		display: none; /* the split card reads cleaner without the watermark */
	}

	.hdm-pm-headline {
		font-size: clamp(22px, 4cqi, 27px);
		letter-spacing: -.6px;
		line-height: 1.12;
	}

	.hdm-pm-pill {
		font-size: 11px;
	}

	.hdm-pm-how {
		font-size: 13.5px;
	}
}

/* Honour reduced-motion. */
@media (prefers-reduced-motion: reduce) {
	.hdm-pm-tip {
		transition: none;
	}

	.hdm-pm-beacon {
		animation: none;
	}
}

/* ══ reviews popup ════════════════════════════════════════════════════ */
body.hdm-pm-modal-open {
	overflow: hidden; /* lock background scroll while the popup is open */
}

.hdm-pm-modal[hidden] {
	display: none;
}

.hdm-pm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

.hdm-pm-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 20, 25, .6);
	cursor: pointer;
}

.hdm-pm-modal-box {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(92vw, 460px);
	max-height: 84vh;
	background: #fff;
	color: #0f1419;
	border-radius: 16px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
	overflow: hidden; /* clip the hero's top corners; inner scroll handles overflow */
}

.hdm-pm-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	color: #0f1419;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.hdm-pm-modal-close:hover {
	background: #fff;
}

.hdm-pm-modal-close:focus-visible {
	background: #fff;
	outline: 2px solid #0f1419;
	outline-offset: 2px;
}

.hdm-pm-modal-close svg {
	width: 18px;
	height: 18px;
}

/* Scrollable middle: header image + reviews. The footer button stays pinned. */
.hdm-pm-modal-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.hdm-pm-modal-hero {
	display: block;
	width: 100%;
	height: auto;
}

.hdm-pm-modal-foot {
	flex: none;
	border-top: 1px solid #e5e7eb;
	padding: 12px 16px;
	background: #fff;
}

.hdm-pm-modal-cta {
	display: block;
	width: 100%;
	text-align: center;
	padding: 11px 16px;
	background: #1666ff;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 8px;
}

.hdm-pm-modal-cta:hover {
	background: #0b54da;
	color: #fff;
}

.hdm-pm-modal-cta:focus-visible {
	outline: 2px solid #0f1419;
	outline-offset: 2px;
}

.hdm-pm-modal-list {
	padding: 4px 18px 18px;
}

/* Smaller footprint on phones so the overlay stays tappable on all four sides. */
@media (max-width: 600px) {
	.hdm-pm-modal {
		padding: 14px;
	}

	.hdm-pm-modal-box {
		width: 88vw;
		max-height: 80vh;
	}
}

.hdm-pm-rv {
	padding: 16px 0;
	border-bottom: 1px solid #eef0f2;
}

.hdm-pm-rv:last-child {
	border-bottom: 0;
}

.hdm-pm-rv-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.hdm-pm-rv-av {
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #d7e7d9;
	color: #15803d;
	font-size: 13px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	text-transform: uppercase;
}

.hdm-pm-rv-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.hdm-pm-rv-name {
	font-size: 14px;
	font-weight: 700;
}

.hdm-pm-rv-date {
	font-size: 12px;
	color: #6b7280;
}

.hdm-pm-rv-stars {
	display: inline-flex;
	gap: 2px;
	margin: 9px 0 6px;
	color: #00b67a; /* drives the Trustpilot green via currentColor */
}

.hdm-pm-star {
	display: block;
}

.hdm-pm-star.is-dim {
	color: #dcdce6;
}

.hdm-pm-rv-title {
	margin: 0 0 4px;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.35;
	color: #0f1419;
}

.hdm-pm-rv-title,
.hdm-pm-rv-name {
	overflow-wrap: break-word;
}

.hdm-pm-rv-body {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: #374151;
	white-space: pre-line; /* preserve the line breaks in the source review text */
	overflow-wrap: break-word; /* defensively break any long unspaced token */
}
