/**
 * QPay store pages (/stores/…).
 *
 * Everything is scoped under body.qpay-stores so these styles stay on these pages.
 * Other plugins' stylesheets still load here, and scoping can't stop their rules
 * matching, so class names must be ones nothing else on qpay.om uses. Its Sharia
 * plugin styles .qpay-badge and .qpay-icon on every page, hence the qpay-store- names.
 * Colours are from the QPay brand palette.
 */

.qpay-stores {
	--qpay-blue: #0088bd;
	--qpay-cyan: #0bd0d4;
	--qpay-ink: #12131a;
	--qpay-grey-70: #706f6f;
	--qpay-grey-30: #c6c6c6;
	--qpay-grey-20: #dadada;
	--qpay-tint: #dcecf5;
	--qpay-raised: 0 3px 4px rgb(0 0 0 / 22%);

	margin: 0;
	background: #fff;
	color: var(--qpay-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

.qpay-stores *,
.qpay-stores *::before,
.qpay-stores *::after {
	box-sizing: border-box;
}

.qpay-page {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	overflow: hidden;
	background: #fff;
}

.qpay-store-icon {
	display: block;
	flex: none;
	width: 20px;
	height: 20px;
}

/* Cover photo, or a brand gradient when there is none. */

.qpay-hero {
	position: relative;
	height: clamp(200px, 64vw, 300px);
	background: linear-gradient(135deg, var(--qpay-blue), var(--qpay-cyan));
}

.qpay-stores .qpay-hero__image {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

/* White sheet over the cover, with the logo straddling its top edge. */

.qpay-sheet {
	position: relative;
	flex: 1;
	margin-top: -40px;
	padding: 50px 0 8px;
	border-radius: 44px 44px 0 0;
	background: #fff;
	text-align: center;
}

.qpay-logo {
	position: absolute;
	top: -80px;
	left: 50%;
	display: grid;
	place-items: center;
	width: 116px;
	height: 116px;
	margin-left: -58px;
	overflow: hidden;
	border: 1px solid var(--qpay-grey-20);
	border-radius: 50%;
	background: #fff;
}

.qpay-stores .qpay-logo img {
	width: 82%;
	height: 82%;
	object-fit: contain;
}

/*
 * A fitted logo (see includes/logo-fit.php): the frame takes the logo's background
 * colour, and the logo is sized and placed so nothing reaches the rim. A thin border
 * left over around the image is clipped off.
 */

.qpay-logo--fitted {
	background: var(--qpay-logo-bg, #fff);
}

.qpay-stores .qpay-logo--fitted img {
	position: absolute;
	top: var(--qpay-logo-y);
	left: var(--qpay-logo-x);
	width: var(--qpay-logo-w);
	max-width: none;
	height: var(--qpay-logo-h);
	object-fit: fill;
	clip-path: inset(var(--qpay-logo-iy, 0%) var(--qpay-logo-ix, 0%));
}

.qpay-logo__monogram {
	font-size: 46px;
	font-weight: 700;
	line-height: 1;
	color: var(--qpay-blue);
}

.qpay-logo .qpay-store-icon {
	width: 48px;
	height: 48px;
	color: var(--qpay-blue);
}

.qpay-stores .qpay-merchant__name {
	margin: 0;
	padding: 0 24px;
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: normal;
	color: var(--qpay-ink);
}

.qpay-stores .qpay-merchant__category,
.qpay-stores .qpay-merchant__message {
	margin: 6px 0 0;
	padding: 0 24px;
	font-size: 11px;
	line-height: 1.45;
	color: var(--qpay-grey-70);
}

.qpay-stores .qpay-merchant__message {
	margin-top: 10px;
	font-size: 14px;
}

/* Shopping type badge. */

.qpay-stores .qpay-store-badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 24px;
	margin: 16px 0 0;
	padding: 0 24px;
	list-style: none;
}

.qpay-store-badge {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	margin: 0;
	padding: 5px 14px;
	border-radius: 999px;
	background: var(--qpay-tint);
	font-size: 11px;
	line-height: 1;
}

/* Action buttons and the location card. */

/* The divider spans the screen; the buttons stay in a column of at most 560px. */
.qpay-actions {
	margin-top: 20px;
	padding: 24px max(12%, calc((100% - 560px) / 2)) 4px;
	border-top: 1px solid var(--qpay-grey-20);
	text-align: left;
}

.qpay-stores .qpay-button {
	display: block;
	margin: 0 0 20px;
	border: 1px solid var(--qpay-grey-30);
	border-radius: 8px;
	background: #fff;
	box-shadow: var(--qpay-raised);
	color: var(--qpay-ink);
	text-decoration: none;
}

.qpay-stores .qpay-row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	color: inherit;
	text-decoration: none;
}

.qpay-stores .qpay-button:focus-visible,
.qpay-stores .qpay-location:focus-within {
	outline: 2px solid var(--qpay-blue);
	outline-offset: 2px;
}

/* Location card: a display-only map of the merchant; one link covers the whole card. */

.qpay-location {
	position: relative;
}

.qpay-stores .qpay-location__link {
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: inherit;
	outline: none;
}

.qpay-map {
	position: relative;
	display: grid;
	place-items: end center; /* Below the pin, which Google centres, and above its credits. */
	box-sizing: border-box;
	margin: 0 14px 16px;
	padding-bottom: 28px;
	overflow: hidden;
	border-radius: 10px;
	background: linear-gradient(135deg, #cfe9f3, #eaf6fa);
	aspect-ratio: 16 / 9;
}

.qpay-stores .qpay-map__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	pointer-events: none;
}

.qpay-map__pill {
	position: relative;
	z-index: 1;
	padding: 9px 22px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
	font-size: 12px;
	color: var(--qpay-ink);
}

/* QPay logo on a light-blue fade at the bottom of every page. */

.qpay-brand {
	margin-top: auto;
	padding: 44px 0 calc(24px + env(safe-area-inset-bottom));
	background: linear-gradient(to bottom, rgb(255 255 255 / 0%), #a9d6ec);
	text-align: center;
}

.qpay-stores .qpay-brand__logo {
	display: inline-block;
	width: 92px;
	height: auto;
}

/* Tablets (iPad) and desktop: edge-to-edge cover and footer, larger type and controls. */

@media (min-width: 600px) {
	/* Landscape screens are short: keep the cover from pushing the buttons below the fold. */
	.qpay-hero {
		height: clamp(240px, min(36vw, 38vh), 380px);
	}

	.qpay-sheet {
		margin-top: -48px;
		padding-top: 64px;
		border-radius: 56px 56px 0 0;
	}

	.qpay-logo {
		top: -100px;
		width: 144px;
		height: 144px;
		margin-left: -72px;
	}

	.qpay-logo__monogram {
		font-size: 58px;
	}

	.qpay-logo .qpay-store-icon {
		width: 58px;
		height: 58px;
	}

	.qpay-stores .qpay-merchant__name {
		font-size: 26px;
	}

	.qpay-stores .qpay-merchant__category {
		font-size: 14px;
	}

	.qpay-stores .qpay-merchant__message {
		font-size: 16px;
	}

	.qpay-stores .qpay-store-badges {
		margin-top: 20px;
	}

	.qpay-store-badge {
		min-height: 30px;
		padding: 7px 18px;
		font-size: 13px;
	}

	.qpay-actions {
		margin-top: 28px;
		padding-top: 32px;
	}

	.qpay-stores .qpay-row {
		gap: 14px;
		min-height: 52px;
		padding: 12px 18px;
		font-size: 15px;
	}

	.qpay-store-icon {
		width: 22px;
		height: 22px;
	}

	.qpay-map {
		margin: 0 18px 18px;
	}

	.qpay-map__pill {
		padding: 10px 26px;
		font-size: 14px;
	}

	.qpay-stores .qpay-brand__logo {
		width: 110px;
	}
}
