/*
 * Homepage additions (2026-10): policy cards under the banner, "About us", and the light variant
 * of a product block. All of them are core blocks in the page; this file only controls presentation.
 * Every rule is scoped to its own section class.
 */

/* ---------- Icons an editor picks through the block's "Styles" panel (group block) ---------- */

.is-style-mnn-icon-truck {
	--mnn-icon: url(../icons/policy-truck.svg);
}

.is-style-mnn-icon-card {
	--mnn-icon: url(../icons/policy-payments.svg);
}

.is-style-mnn-icon-shield {
	--mnn-icon: url(../icons/policy-shield.svg);
}

.is-style-mnn-icon-swap {
	--mnn-icon: url(../icons/policy-swap.svg);
}

.is-style-mnn-icon-chat {
	--mnn-icon: url(../icons/support-chat.svg);
}

.is-style-mnn-icon-verified {
	--mnn-icon: url(../icons/verified.svg);
}

.is-style-mnn-icon-wrench {
	--mnn-icon: url(../icons/wrench.svg);
}

.is-style-mnn-icon-headset {
	--mnn-icon: url(../icons/headset.svg);
}

/* ---------- Policy cards overlapping the banner's bottom edge ---------- */

.mnn-main .wp-block-post-content > .alignfull.mnn-policy {
	position: relative;
	z-index: 4;
	margin-block-start: -44px;
}

.mnn-policy__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--preset--color--white);
	box-shadow: 0 12px 32px rgba(16, 24, 40, 0.1), 0 2px 6px rgba(16, 24, 40, 0.05);
}

.mnn-policy .mnn-policy__item {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 88px;
	margin: 0;
	padding: 20px 22px 20px 80px;
	box-sizing: border-box;
	transition: background-color 0.2s ease;
}

.mnn-policy .mnn-policy__item + .mnn-policy__item {
	border-left: 1px solid var(--wp--preset--color--border);
}

.mnn-policy__item:first-child {
	border-radius: var(--wp--custom--radius--lg) 0 0 var(--wp--custom--radius--lg);
}

.mnn-policy__item:last-child {
	border-radius: 0 var(--wp--custom--radius--lg) var(--wp--custom--radius--lg) 0;
}

/* Icon tile + glyph. The glyph is a mask so it can change colour on hover. */
.mnn-policy__item::before,
.mnn-policy__item::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 22px;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	border-radius: 8px;
	transition: background-color 0.2s ease;
}

.mnn-policy__item::before {
	box-sizing: border-box;
	border: 1px solid rgba(139, 18, 40, 0.2);
	background-color: rgba(139, 18, 40, 0.1);
}

.mnn-policy__item::after {
	background-color: var(--wp--preset--color--maroon);
	-webkit-mask: var(--mnn-icon, none) center / 24px 24px no-repeat;
	mask: var(--mnn-icon, none) center / 24px 24px no-repeat;
	pointer-events: none;
}

/* No icon chosen: no tile, text starts at the edge. */
.mnn-policy .mnn-policy__item:not([class*="is-style-mnn-icon-"]) {
	padding-left: 22px;
}

.mnn-policy__item:not([class*="is-style-mnn-icon-"])::before,
.mnn-policy__item:not([class*="is-style-mnn-icon-"])::after {
	display: none;
}

.mnn-policy .mnn-policy__item > * {
	margin: 0;
}

/* First line = title, the rest = description. */
.mnn-policy .mnn-policy__item > :first-child {
	color: var(--wp--preset--color--contrast);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.mnn-policy .mnn-policy__item > :first-child ~ * {
	margin-top: 2px;
	color: var(--wp--preset--color--muted);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
}

.mnn-policy__item > :first-child a {
	color: inherit;
	text-decoration: none;
}

/* The title's link covers the whole card. */
.mnn-policy__item > :first-child a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.mnn-policy__item > :first-child a::after {
	content: "→";
	display: inline-block;
	margin-left: 6px;
	color: var(--wp--preset--color--primary);
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mnn-policy__item:hover {
	background-color: #fcfcfd;
}

.mnn-policy__item:hover::before {
	background-color: var(--wp--preset--color--maroon);
}

.mnn-policy__item:hover::after {
	background-color: var(--wp--preset--color--white);
}

.mnn-policy__item:hover > :first-child a::after,
.mnn-policy__item > :first-child a:focus-visible::after {
	opacity: 1;
	transform: none;
}

.mnn-policy__item > :first-child a:focus-visible {
	outline: none;
}

.mnn-policy__item > :first-child a:focus-visible::before {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: -2px;
}

@media (max-width: 1100px) {
	.mnn-policy__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mnn-policy .mnn-policy__item {
		border-radius: 0;
	}

	.mnn-policy .mnn-policy__item:nth-child(odd) {
		border-left: 0;
	}

	.mnn-policy .mnn-policy__item:nth-child(n + 3) {
		border-top: 1px solid var(--wp--preset--color--border);
	}
}

@media (max-width: 768px) {
	.mnn-main .wp-block-post-content > .alignfull.mnn-policy {
		margin-block-start: 16px;
	}
}

@media (max-width: 640px) {
	.mnn-policy .mnn-policy__item {
		justify-content: flex-start;
		min-height: 0;
		padding: 64px 14px 14px;
	}

	.mnn-policy .mnn-policy__item:not([class*="is-style-mnn-icon-"]) {
		padding: 14px;
	}

	.mnn-policy__item::before,
	.mnn-policy__item::after {
		top: 14px;
		left: 14px;
		width: 40px;
		height: 40px;
		margin-top: 0;
	}

	.mnn-policy__item::after {
		-webkit-mask-size: 20px 20px;
		mask-size: 20px 20px;
	}

	.mnn-policy .mnn-policy__item > :first-child {
		font-size: 14px;
	}

	.mnn-policy .mnn-policy__item > :first-child ~ * {
		font-size: 12px;
	}
}

/* ---------- About us ---------- */

.mnn-section.mnn-about {
	padding-top: 88px;
	padding-bottom: 88px;
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
	background: linear-gradient(180deg, var(--wp--preset--color--white) 0%, #f8fafc 100%);
}

/*
 * "About us" placed right after the policy cards: the cards' lower part and the section share one
 * white ground (the top 44px of the cards still lies on the banner), and the section drops its own
 * top rule and the extra padding. Follows the blocks, so it stops applying if either one is moved.
 */
.mnn-main .wp-block-post-content > .alignfull.mnn-policy:has(+ .mnn-about) {
	background: linear-gradient(180deg, transparent 44px, var(--wp--preset--color--white) 44px);
}

.mnn-policy + .mnn-section.mnn-about {
	padding-top: 64px;
	border-top: 0;
}

@media (max-width: 768px) {
	.mnn-main .wp-block-post-content > .alignfull.mnn-policy:has(+ .mnn-about) {
		margin-block-start: 0;
		padding-top: 16px;
		background: var(--wp--preset--color--white);
	}
}

@media (max-width: 640px) {
	.mnn-policy + .mnn-section.mnn-about {
		padding-top: 40px;
	}
}

.mnn-about__grid {
	display: grid;
	grid-template-columns: 5fr 7fr;
	align-items: center;
	gap: 72px;
}

.mnn-about .mnn-about__grid > *,
.mnn-about .mnn-about__media > *,
.mnn-about .mnn-about__badge > *,
.mnn-about .mnn-about__pillar > *,
.mnn-about .mnn-about__stat > * {
	margin: 0;
}

.mnn-about__media {
	position: relative;
}

/* Dotted decoration behind the photo's top-left corner. */
.mnn-about__media::before {
	content: "";
	position: absolute;
	top: -22px;
	left: -22px;
	z-index: 0;
	width: 130px;
	height: 130px;
	background: radial-gradient(var(--wp--preset--color--gold) 2px, transparent 2.5px) 0 0 / 16px 16px;
	opacity: 0.55;
}

.mnn-about__media > .wp-block-image {
	position: relative;
	z-index: 1;
	aspect-ratio: 7 / 8;
	border-radius: 20px;
	background-color: var(--wp--preset--color--surface-strong);
	overflow: hidden;
}

.mnn-about__media > .wp-block-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mnn-about__badge {
	position: absolute;
	right: -28px;
	bottom: 36px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--preset--color--white);
	box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14);
}

/* First line = the number, second = what it counts. */
.mnn-about .mnn-about__badge > :first-child {
	color: var(--wp--preset--color--primary);
	font-size: 38px;
	font-weight: 800;
	line-height: 1;
}

.mnn-about .mnn-about__badge > :first-child ~ * {
	color: var(--wp--preset--color--muted);
	font-size: 13px;
	line-height: 1.35;
}

.mnn-about .mnn-about__body > * {
	margin-block: 0;
}

/* Small label: the paragraph placed before the title. */
.mnn-about__body > .mnn-about__eyebrow,
.mnn-about__body > p:has(+ .wp-block-heading) {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--wp--preset--color--primary);
	font-size: 13px;
	font-weight: 600;
	line-height: 20px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mnn-about__body > .mnn-about__eyebrow::before,
.mnn-about__body > p:has(+ .wp-block-heading)::before {
	content: "";
	width: 28px;
	height: 2px;
	background-color: currentColor;
}

.mnn-about .mnn-about__body > .wp-block-heading {
	margin-top: 12px;
	color: var(--wp--preset--color--contrast);
	font-size: clamp(28px, 3vw, 40px);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

/* Italic in the editor = the part of the title shown in the brand colour. */
.mnn-about__body > .wp-block-heading em {
	color: var(--wp--preset--color--primary);
	font-style: normal;
}

.mnn-about .mnn-about__body > .wp-block-heading + p {
	margin-top: 16px;
	color: #3d434b;
	font-size: 17px;
	line-height: 1.55;
}

.mnn-about__body > .wp-block-heading + p strong {
	color: var(--wp--preset--color--primary);
}

.mnn-about .mnn-about__pillars {
	display: grid;
	gap: 18px;
	margin-top: 28px;
}

.mnn-about .mnn-about__pillar {
	position: relative;
	min-height: 44px;
	margin: 0;
	padding-left: 60px;
}

.mnn-about__pillar::before,
.mnn-about__pillar::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 44px;
	height: 44px;
	border-radius: 12px;
}

.mnn-about__pillar::before {
	background-color: #fff0f2;
}

.mnn-about__pillar::after {
	background-color: var(--wp--preset--color--primary);
	-webkit-mask: var(--mnn-icon, none) center / 22px 22px no-repeat;
	mask: var(--mnn-icon, none) center / 22px 22px no-repeat;
}

.mnn-about .mnn-about__pillar:not([class*="is-style-mnn-icon-"]) {
	min-height: 0;
	padding-left: 0;
}

.mnn-about__pillar:not([class*="is-style-mnn-icon-"])::before,
.mnn-about__pillar:not([class*="is-style-mnn-icon-"])::after {
	display: none;
}

.mnn-about .mnn-about__pillar > .wp-block-heading {
	color: var(--wp--preset--color--contrast);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}

.mnn-about .mnn-about__pillar > p {
	margin-top: 2px;
	color: var(--wp--preset--color--muted);
	font-size: 14px;
	line-height: 1.55;
}

.mnn-about .mnn-about__body > .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.mnn-about .wp-block-button {
	margin: 0;
}

.mnn-about .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 22px;
	border: 1px solid var(--wp--preset--color--primary);
	border-radius: 10px;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-size: 15px;
	font-weight: 600;
	line-height: 22px;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mnn-about .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--primary-dark);
	background-color: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--white);
}

.mnn-about .wp-block-button + .wp-block-button .wp-block-button__link,
.mnn-about .wp-block-button.is-style-outline .wp-block-button__link {
	border-color: #e3c3ca;
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
}

.mnn-about .wp-block-button + .wp-block-button .wp-block-button__link:hover,
.mnn-about .wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: #e3c3ca;
	background-color: #fff0f2;
	color: var(--wp--preset--color--primary);
}

.mnn-section.mnn-about > .mnn-about__stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-block-start: 64px;
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--preset--color--surface);
}

.mnn-about .mnn-about__stat {
	margin: 0;
	padding: 24px 20px;
	text-align: center;
}

.mnn-about .mnn-about__stat + .mnn-about__stat {
	border-left: 1px solid var(--wp--preset--color--border);
}

.mnn-about .mnn-about__stat > :first-child {
	color: var(--wp--preset--color--primary);
	font-size: 30px;
	font-weight: 800;
	line-height: 1.15;
}

.mnn-about .mnn-about__stat > :first-child ~ * {
	color: var(--wp--preset--color--muted);
	font-size: 14px;
	line-height: 1.55;
}

@media (max-width: 960px) {
	.mnn-about__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 44px;
	}

	.mnn-about__media {
		max-width: 480px;
	}

	.mnn-about__badge {
		right: 16px;
	}

	.mnn-section.mnn-about > .mnn-about__stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mnn-about .mnn-about__stat:nth-child(odd) {
		border-left: 0;
	}

	.mnn-about .mnn-about__stat:nth-child(n + 3) {
		border-top: 1px solid var(--wp--preset--color--border);
	}
}

@media (max-width: 640px) {
	.mnn-section.mnn-about {
		padding-top: 56px;
		padding-bottom: 56px;
	}

	.mnn-about__media::before {
		left: -8px;
	}

	.mnn-about__media > .wp-block-image {
		aspect-ratio: 4 / 3;
	}

	.mnn-about__badge {
		right: 12px;
		bottom: 16px;
		padding: 12px 14px;
	}

	.mnn-about .mnn-about__badge > :first-child {
		font-size: 30px;
	}

	.mnn-about .mnn-about__stat {
		padding: 18px 10px;
	}

	.mnn-about .mnn-about__stat > :first-child {
		font-size: 24px;
	}
}

/* ---------- Product block, light variant (colours read from the 2026 homepage SVG) ---------- */

.mnn-section.mnn-product-block--light {
	background-color: var(--wp--preset--color--white);
}

.mnn-product-block--light .mnn-product-panel {
	border-color: var(--wp--preset--color--border);
	background: #f8f9fa;
	box-shadow: var(--wp--preset--shadow--sm);
	color: var(--wp--preset--color--contrast);
}

.mnn-product-block--light .mnn-product-panel__heading > .wp-block-heading {
	color: var(--wp--preset--color--contrast);
}

.mnn-section.mnn-product-block--light .mnn-product-panel__heading > p {
	color: var(--wp--preset--color--muted);
	opacity: 1;
}

/* Tabs: 36px pills; the selected one is maroon with a thin gold outline. */
.mnn-product-block--light .mnn-product-tabs {
	border-bottom-color: var(--wp--preset--color--border);
}

.mnn-product-block--light .mnn-product-tab {
	padding: 8px 16px;
	border-color: var(--wp--preset--color--border);
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

/* Hover and focus are not drawn in the SVG; proposed. */
.mnn-product-block--light .mnn-product-tab:hover {
	border-color: var(--wp--preset--color--maroon);
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--maroon);
}

.mnn-product-block--light .mnn-product-tab:focus-visible {
	outline-color: var(--wp--preset--color--maroon);
}

.mnn-product-block--light .mnn-product-tab.is-active,
.mnn-product-block--light .mnn-product-tab.is-active:hover {
	padding: 8px 16px;
	border-color: rgba(212, 175, 90, 0.4);
	background-color: var(--wp--preset--color--maroon);
	color: var(--wp--preset--color--white);
}

.mnn-product-block--light .mnn-product-tab--all::before {
	width: 16px;
	height: 16px;
	background-image: url(../icons/tab-all-tune.svg);
}

/* Group icon tile: a 10% tint of the icon's own colour. */
.mnn-product-block--light .mnn-product-group__header::before {
	border-color: rgba(139, 18, 40, 0.2);
	background-color: rgba(139, 18, 40, 0.1);
	background-size: 20px 20px;
	box-shadow: none;
}

.mnn-product-block--light .mnn-product-group__header--best::before {
	background-image: url(../icons/group-best-flame.svg);
}

.mnn-product-block--light .mnn-product-group__header--new::before {
	border-color: #e5e7eb;
	background-color: rgba(0, 68, 40, 0.1);
	background-image: url(../icons/group-new-verified.svg);
}

.mnn-product-block--light .mnn-product-group__header > .wp-block-heading {
	color: var(--wp--preset--color--contrast);
}

/* Tags: 22px pills, dark text on a pale ground of the same hue. */
.mnn-product-block--light .mnn-product-group__header > .mnn-product-group__tag {
	padding-block: 2px;
	border-color: rgba(185, 28, 28, 0.2);
	background-color: rgba(185, 28, 28, 0.1);
	box-shadow: none;
	color: #b91c1c;
}

.mnn-product-block--light .mnn-product-group__header--new > .mnn-product-group__tag {
	border-color: #e5e7eb;
	background-color: #dcfce7;
	color: #004428;
}

.mnn-product-block--light .mnn-product-group__header > .mnn-product-group__desc {
	color: var(--wp--preset--color--muted);
	opacity: 1;
}

.mnn-product-block--light .mnn-product-grid__empty,
.mnn-product-block--light .mnn-product-grid__note {
	border-color: var(--wp--preset--color--border);
	color: var(--wp--preset--color--muted);
}

.mnn-product-block--light .mnn-product-panel > .mnn-product-panel__more {
	border-top-color: var(--wp--preset--color--border);
}

.mnn-product-block--light .mnn-product-panel__more a {
	border: 1px solid var(--wp--preset--color--maroon);
	background-color: var(--wp--preset--color--base);
	box-shadow: none;
	color: var(--wp--preset--color--maroon);
}

.mnn-product-block--light .mnn-product-panel__more a::after {
	background-image: url(../icons/arrow-right-maroon.svg);
}

.mnn-product-block--light .mnn-product-panel__more a:hover {
	background-color: #fff0f2;
}

/* Product card in these blocks only (Figma B2C_THN: name 204:240, button 204:244). The shared card
   elsewhere keeps its red button. Three classes so it outranks the block's :hover/:visited rules. */
.mnn-product-block--light .mnn-product-card .mnn-product-card__title {
	min-height: 38.5px;
	font-size: 14px;
	line-height: 19.25px;
}

.mnn-product-block--light .mnn-product-card .mnn-product-card__button {
	gap: 6px;
	height: 36px;
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
}

.mnn-product-block--light .mnn-product-card .mnn-product-card__button:not(.is-details),
.mnn-product-block--light .mnn-product-card .mnn-product-card__button:not(.is-details):visited {
	border: 1px solid var(--wp--preset--color--border);
	background-color: var(--wp--preset--color--surface-strong);
	color: var(--wp--preset--color--maroon);
}

.mnn-product-block--light .mnn-product-card .mnn-product-card__button:not(.is-details)::before {
	width: 13.32px;
	height: 13.33px;
	background-image: url(../icons/cart-maroon.svg);
}

/* Hover/focus/added are not in Figma: the card's existing states, white on a solid fill. */
.mnn-product-block--light .mnn-product-card .mnn-product-card__button:not(.is-details):hover,
.mnn-product-block--light .mnn-product-card .mnn-product-card__button:not(.is-details):focus-visible {
	border-color: var(--wp--preset--color--primary-dark);
	background-color: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--white);
}

.mnn-product-block--light .mnn-product-card .mnn-product-card__button.is-added,
.mnn-product-block--light .mnn-product-card .mnn-product-card__button.is-added:hover {
	border-color: #15803d;
	background-color: #15803d;
	color: var(--wp--preset--color--white);
}

.mnn-product-block--light .mnn-product-card .mnn-product-card__button:not(.is-details):hover::before,
.mnn-product-block--light .mnn-product-card .mnn-product-card__button:not(.is-details):focus-visible::before,
.mnn-product-block--light .mnn-product-card .mnn-product-card__button.is-added::before {
	background-image: url(../icons/cart-white.svg);
}

/* ---------- Testimonials: section ground (the cards are styled by the block) ---------- */

.mnn-section.mnn-testimonials {
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
	background-color: var(--wp--preset--color--surface);
}

/* The block prints nothing when it is switched off; the empty section must not leave a gap. */
.mnn-section.mnn-testimonials:empty {
	display: none;
}

/* ---------- Brands: heading and logos inside one white card ---------- */

.mnn-brands .mnn-brands__card {
	padding: 40px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--lg);
	background-color: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--sm);
}

.mnn-brands .mnn-brands__card > * {
	margin-block: 0;
}

.mnn-brands .mnn-brands__card > .mnn-section__heading {
	padding-bottom: 32px;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.mnn-brands .mnn-brands__card > .mnn-section__heading + * {
	margin-top: 32px;
}

@media (max-width: 599px) {
	.mnn-brands .mnn-brands__card {
		padding: 20px;
		border-radius: var(--wp--custom--radius--md);
	}

	.mnn-brands .mnn-brands__card > .mnn-section__heading {
		padding-bottom: 20px;
	}

	.mnn-brands .mnn-brands__card > .mnn-section__heading + * {
		margin-top: 20px;
	}
}

/* ---------- Parts finder: white card ---------- */

.mnn-parts .mnn-parts__panel {
	border-color: var(--wp--preset--color--border);
	background: var(--wp--preset--color--white);
}

@media (prefers-reduced-motion: reduce) {
	.mnn-policy__item,
	.mnn-policy__item::before,
	.mnn-policy__item::after,
	.mnn-policy__item > :first-child a::after,
	.mnn-about .wp-block-button__link {
		transition: none;
	}
}
