/* Update 67/76: official App Store / Google Play badges in the header and footer.
   The homepage strip was removed in Update 76. Artwork is used unchanged
   (no recolour, no stretch, no shadow). Brand teal #067b9d only. */

/* Shared badge row. Apple first, then Google Play when that listing is live. */
.motorit-store-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	/* 10px is 1/4 of the 40px Apple badge height (Apple clear-space rule).
	   The official Google Play web badge already includes equivalent clear
	   space inside the PNG, so a 10px CSS gap plus that padding keeps both
	   marks visually matched and legally spaced. */
	gap: 4px 10px;
	margin: 0;
	padding: 0;
}

.motorit-store-badge {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	text-decoration: none;
	border: 0;
	background: none;
	box-shadow: none;
	filter: none;
}

.motorit-store-badge img {
	display: block;
	height: auto;
	width: auto;
	max-width: none;
	border: 0;
	box-shadow: none;
	filter: none;
}

/* Official Apple SVG is 119.66407 x 40. 40px is the artwork's native height. */
.motorit-store-badge--apple img {
	width: 120px;
	height: 40px;
}

/* Official Google web badge is 646 x 250, including built-in clear space.
   The painted badge inside is 564 x 168. A 60px element height makes the
   painted badge ~40px, so it matches the App Store badge beside it and
   stays above Google's 28px minimum. 646/250*60 = 155.04. */
.motorit-store-badge--google img {
	width: 155px;
	height: 60px;
}

/* Hide every promo when the page is opened inside the native app.
   The class is set by a head script (and, when the UA allows, on the html element)
   so the badges do not flash before the check runs. */
html.is-motorit-native .motorit-app-promo {
	display: none !important;
}

/* ---- Header badges (desktop: beside account buttons; mobile: in the menu) ----
   Header size is 32px tall so App Store + Google Play can sit side by side
   next to Log in / My Account at 1024px and above. That is below Apple's
   stated 40px on-screen minimum (Apple Marketing Guidelines, Graphic
   Standards); Google's 28px minimum is met. Artwork is only scaled, not
   recoloured or stretched. The footer keeps the official 40px Apple size.
   The official Google PNG includes 41px padding on each side of a 564x168
   painted badge; the header crops to the painted mark so the two badges
   match in height, then leaves 8px CSS gap (1/4 of 32px) as clear space. */
.mgh1-header-apps {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	height: 44px;
	margin: 0;
	padding: 0 8px 0 6px;
	white-space: nowrap;
}

.mgh1-header-apps .motorit-store-badges {
	flex-wrap: nowrap;
	gap: 0 8px;
}

.mgh1-header-apps .motorit-store-badge {
	flex: 0 0 auto;
}

/* 119.66407 x 40, scaled uniformly to 32px tall: 95.73 x 32. */
.mgh1-header-apps .motorit-store-badge--apple img {
	width: 95.73px;
	height: 32px;
}

/* Crop the 41px official padding, then scale the 564x168 painted badge
   to 32px tall (107.43 x 32). The img is sized 122.95 x 47.62 and shifted
   so only the painted mark shows. */
.mgh1-header-apps .motorit-store-badge--google {
	width: 107.43px;
	height: 32px;
	overflow: hidden;
}

.mgh1-header-apps .motorit-store-badge--google img {
	width: 122.95px;
	height: 47.62px;
	margin: -7.81px -7.76px;
}

.mgh1-header-apps-label {
	display: none;
	margin: 0;
	color: var(--motorit-header-text, #fff);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
}

/* Extra grid column so the badges sit between the nav and the account
   buttons and do not wrap onto a second header row. Logo-column minimums
   match the logo width at each breakpoint (198px desktop, 180px mid)
   so two 32px badges plus My Account / Logout still fit at 1280 and 1024. */
@media (min-width: 901px) {
	.mgh1-header:has(.mgh1-header-apps) {
		grid-template-columns: minmax(198px, 1fr) auto auto auto !important;
	}
}

@media (min-width: 901px) and (max-width: 1180px) {
	.mgh1-header:has(.mgh1-header-apps) {
		grid-template-columns: minmax(180px, 1fr) auto auto auto !important;
	}
	.mgh1-header:has(.mgh1-header-apps) .mgh1-nav a,
	.mgh1-header:has(.mgh1-header-apps) .mgh1-nav-link {
		padding-left: 6px !important;
		padding-right: 6px !important;
	}
}

/* ---- Footer Get the app row (every page) ---- */
.mgh1-footer-apps {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.mgh1-footer-apps h4 {
	margin: 0;
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
}

@media (max-width: 900px) {
	/* Menu is a column so the app row can sit under Log in. */
	.mgh1-header[data-mgh1-open="true"] .mgh1-menu {
		display: flex !important;
		flex-direction: column !important;
	}
	.mgh1-header-apps {
		order: 1;
		width: 100%;
		height: auto;
		justify-content: flex-start;
		flex-wrap: wrap;
		gap: 10px 14px;
		margin-top: 8px;
		padding: 10px 14px 8px;
		border-top: 1px solid var(--motorit-header-pill-border);
		white-space: normal;
	}
	.mgh1-header-apps-label {
		display: block;
	}
}

@media (max-width: 800px) {
	.mgh1-footer-apps {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}
