/* LPJ Storefront. Written for phones first, then tablets, then desktops. */
:root {
	--lpj-white: #fff;
	--lpj-tile: #f6f6f6;
	--lpj-ink: #000;
	--lpj-soft: #6f6f6f;
	--lpj-line: #e4e4e4;
	--lpj-gutter: 16px;
	--lpj-bar: 69px;
	--lpj-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
	--lpj-top: var(--wp-admin--admin-bar--height, 0px);
}
@media (max-width: 600px) {
	/* WordPress's own admin bar scrolls away at this size */
	:root { --lpj-top: 0px; }
}

html { background: var(--lpj-white); -webkit-text-size-adjust: 100%; }
html.lpj-menu-open { overflow: hidden; }
body.lpj-page {
	margin: 0;
	padding: 0;
	background: var(--lpj-white);
	color: var(--lpj-ink);
	font: 400 14px/1.45 var(--lpj-font);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

/* Anything other plugins print for the pages these replaced stays out of sight */
body.lpj-page > :not(.lpj-root):not(#wpadminbar):not([id*="cookie" i]):not([class*="cookie" i]):not([id*="consent" i]):not([class*="consent" i]) { display: none !important; }

/* Resets carry no weight, so every rule below can override them */
:where(.lpj-root), :where(.lpj-root) * { box-sizing: border-box; }
:where(.lpj-root) a { color: inherit; text-decoration: none; }
:where(.lpj-root) ul { margin: 0; padding: 0; list-style: none; }
:where(.lpj-root) :is(h1, h2, h3, p, dl, dd) { margin: 0; }
:where(.lpj-root) img { display: block; max-width: 100%; }
:where(.lpj-root) button { font: inherit; color: inherit; cursor: pointer; }
.lpj-root :focus-visible, .lpj-pick:focus-within { outline: 1px solid var(--lpj-ink); outline-offset: 2px; }
.lpj-sprite { position: absolute; }

/* Header */
.lpj-header {
	display: grid;
	grid-template-columns: 44px 1fr 44px;
	align-items: center;
	height: 56px;
	padding: 0 var(--lpj-gutter);
	background: var(--lpj-white);
}
.lpj-menu-toggle {
	width: 44px;
	height: 44px;
	margin-left: -10px;
	padding: 0;
	border: 0;
	background: none;
}
.lpj-bars { display: block; }
.lpj-bars span { display: block; width: 22px; height: 1px; margin: 6px auto; background: currentColor; }
.lpj-menu-word, .lpj-header-links, .lpj-tabs, .lpj-actions { display: none; }
.lpj-logo { justify-self: center; }
.lpj-logo img { width: 42px; height: 42px; filter: invert(1); }
.lpj-header-wa {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-right: -10px;
}
.lpj-header-wa svg { width: 21px; height: 21px; fill: currentColor; }
.lpj-product .lpj-header-wa { visibility: hidden; }

/* Slide-out menu */
.lpj-scrim {
	position: fixed;
	inset: 0;
	z-index: 98;
	background: rgba(0, 0, 0, .35);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s, visibility .2s;
}
.lpj-drawer {
	position: fixed;
	top: var(--lpj-top);
	bottom: 0;
	left: 0;
	z-index: 99;
	width: min(86vw, 380px);
	padding: 8px var(--lpj-gutter) 24px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	background: var(--lpj-white);
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform .25s ease, visibility .25s;
}
.lpj-menu-open .lpj-scrim { opacity: 1; visibility: visible; }
/* Shown at once on opening, so the close button can take keyboard focus */
.lpj-menu-open .lpj-drawer { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
.lpj-drawer-close {
	position: relative;
	display: block;
	width: 44px;
	height: 44px;
	margin: 0 0 8px -10px;
	padding: 0;
	border: 0;
	background: none;
}
.lpj-drawer-close::before, .lpj-drawer-close::after {
	content: "";
	position: absolute;
	top: 21px;
	left: 11px;
	width: 22px;
	height: 1px;
	background: currentColor;
	transform: rotate(45deg);
}
.lpj-drawer-close::after { transform: rotate(-45deg); }
.lpj-menu-list > li { border-top: 1px solid var(--lpj-line); }
.lpj-menu-list a { display: block; padding: 13px 0; font-size: 16px; font-weight: 300; }
.lpj-menu-list .sub-menu { padding-bottom: 8px; }
.lpj-menu-list .sub-menu a { padding: 8px 0 8px 14px; color: var(--lpj-soft); font-size: 14px; }
.lpj-menu-list .ast-menu-toggle, .lpj-menu-list .dropdown-menu-toggle, .lpj-menu-list .ast-icon { display: none; }

/* Shop */
.lpj-shop h1 {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}
.lpj-controls {
	position: sticky;
	top: var(--lpj-top);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 44px;
	padding: 0 var(--lpj-gutter);
	background: var(--lpj-white);
	font-weight: 500;
}
.lpj-pick { position: relative; display: block; min-width: 0; }
.lpj-pick-value {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 44px;
	white-space: nowrap;
}
.lpj-pick-value::after {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	margin-top: -3px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
}
/* The phone's own picker opens from an invisible control over the label */
.lpj-pick select {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	font-family: inherit;
	font-size: 16px;
	opacity: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.lpj-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	padding: 0 var(--lpj-gutter);
}
.lpj-tile { background: var(--lpj-tile); }
.lpj-tile a { display: flex; flex-direction: column; height: 100%; }
.lpj-view { display: block; }
.lpj-view img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / .84;
	object-fit: contain;
	filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .14));
}
.lpj-label { display: flex; flex: 1; flex-direction: column; padding: 2px 10px 10px; }
.lpj-family { font-size: 13px; font-weight: 500; line-height: 1.3; }
.lpj-variant { color: var(--lpj-soft); font-size: 12px; line-height: 1.3; }
.lpj-price { margin-top: auto; padding-top: 2px; font-size: 13px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.lpj-empty { padding: 32px var(--lpj-gutter); text-align: center; }
.lpj-empty a { text-decoration: underline !important; text-underline-offset: 2px; }

/* A new watch waiting for its cut-out shows its original photo on black */
.is-photo .lpj-view, .lpj-stage.is-photo { background: #000; }
.is-photo img { filter: none; }

/* Product */
.lpj-stage { position: relative; background: var(--lpj-tile); }
.lpj-back {
	position: absolute;
	top: 2px;
	left: var(--lpj-gutter);
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 4px;
	height: 44px;
	font-size: 13px;
}
.lpj-stage.is-photo .lpj-back { color: var(--lpj-white); }
.lpj-hero { max-width: 372px; margin: 0 auto; }
.lpj-hero img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / .94;
	object-fit: contain;
	filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .16));
	view-transition-name: lpj-watch;
}
.is-photo .lpj-hero img { filter: none; }
.lpj-head { padding: 20px var(--lpj-gutter) 0; text-align: center; }
.lpj-head h1 { font: inherit; }
.lpj-head h1 span { display: block; }
.lpj-maker { color: var(--lpj-soft); font-size: 12px; font-weight: 300; }
.lpj-model {
	padding-left: .16em;
	font-size: 20px;
	font-weight: 300;
	line-height: 1.25;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.lpj-head .lpj-variant { margin-top: 2px; font-size: 14px; font-weight: 300; line-height: 1.4; }
.lpj-head .lpj-price { margin: 0; padding-top: 8px; font-size: 15px; font-weight: 300; }

.lpj-facts { display: flex; justify-content: center; gap: 32px; margin-top: 16px; padding: 0 var(--lpj-gutter); text-align: center; }
.lpj-facts dt { color: var(--lpj-soft); font-size: 12px; }

.lpj-assurance {
	margin: 16px var(--lpj-gutter) 0;
	border-top: 1px solid var(--lpj-line);
	border-bottom: 1px solid var(--lpj-line);
}
.lpj-assurance summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 48px;
	font-size: 12px;
	line-height: 1.3;
	letter-spacing: .12em;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
}
.lpj-assurance summary::-webkit-details-marker { display: none; }
.lpj-assurance summary::after {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	margin: -3px 4px 0 12px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s, margin .2s;
}
.lpj-assurance[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
.lpj-assurance h3 { padding-top: 4px; font-size: 13px; font-weight: 500; }
.lpj-assurance p { padding: 4px 0 12px; color: var(--lpj-soft); font-weight: 300; }

.lpj-related { margin-top: 24px; }
.lpj-related h2 {
	padding: 0 var(--lpj-gutter) 12px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: .12em;
	text-align: center;
	text-transform: uppercase;
}
.lpj-related .lpj-tile:nth-child(n + 3) { display: none; }

.lpj-buybar {
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 10;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
	padding: 10px var(--lpj-gutter) calc(10px + env(safe-area-inset-bottom));
	background: var(--lpj-white);
	box-shadow: 0 -1px 0 var(--lpj-line);
}
.lpj-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	border: 1px solid var(--lpj-ink);
	background: var(--lpj-white);
	font-size: 11.5px;
	letter-spacing: .16em;
	text-transform: uppercase;
	white-space: nowrap;
}
.lpj-root .lpj-cta.is-solid { background: var(--lpj-ink); color: var(--lpj-white); }
.lpj-cta svg { flex: none; width: 16px; height: 16px; fill: currentColor; }

.lpj-footer {
	margin-top: 24px;
	padding: 16px var(--lpj-gutter);
	border-top: 1px solid var(--lpj-line);
	color: var(--lpj-soft);
	font-size: 12px;
}
.lpj-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; color: var(--lpj-ink); }
.lpj-product .lpj-footer { padding-bottom: calc(var(--lpj-bar) + 16px + env(safe-area-inset-bottom)); }

@media (max-width: 340px) {
	.lpj-pick-value { font-size: 12px; }
	.lpj-cta { font-size: 10.5px; letter-spacing: .1em; }
}

/* Large phones sideways, and tablets upright */
@media (min-width: 600px) {
	:root { --lpj-gutter: 24px; }
	.lpj-shop h1 {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
		padding: 16px 0 8px .16em;
		clip-path: none;
		font-size: 24px;
		font-weight: 300;
		line-height: 1.1;
		letter-spacing: .16em;
		text-align: center;
		text-transform: uppercase;
	}
	.lpj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.lpj-label { padding: 4px 14px 14px; }
	.lpj-family { font-size: 14px; }
	.lpj-variant { font-size: 13px; }
	.lpj-price { padding-top: 4px; font-size: 14px; }
	.lpj-hero { max-width: 520px; }
	.lpj-related .lpj-tile:nth-child(3) { display: block; }
	.lpj-buybar { padding-right: calc(50% - 260px); padding-left: calc(50% - 260px); }
}

/* Phones sideways: four watches to a row, and the watch beside its details */
@media (min-width: 600px) and (max-width: 899px) and (max-height: 500px) {
	.lpj-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.lpj-related .lpj-tile:nth-child(4) { display: block; }
	.lpj-shop h1 { padding: 4px 0 0 .16em; font-size: 18px; }
	.lpj-watch { --lpj-stage: max(240px, calc(100vh - 56px - var(--lpj-bar))); }
	.lpj-hero { height: calc(var(--lpj-stage) * .92); max-width: none; }
	.lpj-hero img { width: auto; height: 100%; aspect-ratio: 1; }
}

/* Desktops */
@media (min-width: 900px) {
	:root {
		--lpj-pad: max(8%, calc((100% - 1560px) / 2));
		--lpj-side: max(8vw, calc((100vw - 1560px) / 2));
	}
	.lpj-watch { --lpj-stage: clamp(560px, calc(100vh - 72px - var(--lpj-top)), 860px); }

	.lpj-header { grid-template-columns: 1fr auto 1fr; height: 72px; padding: 0 var(--lpj-pad); }
	.lpj-menu-toggle { display: flex; align-items: center; gap: 10px; width: auto; margin-left: 0; font-size: 14px; justify-self: start; }
	.lpj-menu-word { display: block; font-weight: 400; }
	.lpj-logo img { width: 50px; height: 50px; }
	.lpj-header-wa { display: none; }
	.lpj-header-links { display: flex; align-items: center; justify-self: end; gap: 32px; font-size: 14px; }
	.lpj-header-links a { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
	.lpj-header-links svg { width: 16px; height: 16px; fill: currentColor; }

	.lpj-shop h1 { padding: 28px 0 20px .16em; font-size: 28px; }
	.lpj-controls { height: 56px; margin-bottom: 8px; padding: 0 var(--lpj-pad); }
	.lpj-pick-value { height: 56px; font-size: 14px; }

	.lpj-grid { padding: 0 var(--lpj-pad); }
	.lpj-label { padding: 6px 16px 16px; }
	.lpj-family { font-size: 15px; }
	.lpj-price { padding-top: 6px; }

	.lpj-head .lpj-maker { font-size: 13px; }
	.lpj-model { font-size: 28px; }
	.lpj-head .lpj-variant { margin-top: 4px; font-size: 16px; }
	.lpj-head .lpj-price { padding-top: 12px; font-size: 18px; }
	.lpj-actions { display: grid; gap: 8px; margin-top: 24px; }
	.lpj-buybar { display: none; }
	.lpj-back { top: 12px; left: var(--lpj-side); font-size: 14px; }
	.lpj-hero { height: calc(var(--lpj-stage) * .86); max-width: none; margin: 0; }
	.lpj-hero img { width: auto; height: 100%; aspect-ratio: 1; filter: drop-shadow(0 18px 16px rgba(0, 0, 0, .18)); }
	.lpj-facts dd { font-size: 15px; }
	.lpj-assurance summary { min-height: 52px; }
	.lpj-related { margin-top: 48px; }
	.lpj-related h2 { padding: 0 0 20px; }

	.lpj-footer { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; padding: 24px var(--lpj-pad); }
	.lpj-footer nav { margin: 0; }
	.lpj-product .lpj-footer { padding-bottom: 24px; }
}

/* Split product page, on desktops and on phones held sideways */
@media (min-width: 900px), (min-width: 600px) and (max-height: 500px) {
	.lpj-watch {
		display: grid;
		grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
		grid-template-rows: 1fr auto auto auto 1fr auto;
	}
	.lpj-stage {
		display: flex;
		grid-column: 1;
		grid-row: 1 / 6;
		align-items: center;
		justify-content: center;
		min-height: var(--lpj-stage);
	}
	.lpj-head, .lpj-facts, .lpj-assurance { grid-column: 2; justify-self: center; }
	.lpj-head { grid-row: 2; width: min(100% - 48px, 400px); padding: 16px 0 0; }
	.lpj-facts { grid-row: 3; }
	.lpj-assurance { grid-row: 4; width: min(100% - 48px, 400px); margin: 16px 0; }
	.lpj-related { grid-column: 1 / -1; grid-row: 6; }
}

/* Brand links once they all fit on one line */
@media (min-width: 1100px) {
	.lpj-pick-brand { display: none; }
	.lpj-tabs { display: flex; gap: 28px; }
	.lpj-tabs a { display: flex; align-items: center; height: 56px; font-size: 14px; font-weight: 400; white-space: nowrap; }
	.lpj-tabs [aria-current="page"] { font-weight: 500; box-shadow: inset 0 -1px 0 var(--lpj-ink); }
}

/* Four across */
@media (min-width: 1180px) {
	.lpj-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.lpj-related .lpj-tile:nth-child(4) { display: block; }
	.lpj-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mouse and trackpad only, so taps never leave a stuck hover state */
@media (hover: hover) {
	.lpj-view img { transition: transform .4s ease; }
	.lpj-tile a:hover .lpj-view img { transform: scale(1.03); }
	.lpj-cta { transition: background-color .2s, color .2s; }
	.lpj-cta:hover { background: var(--lpj-ink); color: var(--lpj-white); }
	.lpj-root .lpj-cta.is-solid:hover { background: var(--lpj-white); color: var(--lpj-ink); }
	.lpj-tabs a:hover, .lpj-header-links a:hover, .lpj-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
}

@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
	::view-transition-group(lpj-watch) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
}
@media (prefers-reduced-motion: reduce) {
	.lpj-drawer, .lpj-scrim, .lpj-assurance summary::after, .lpj-view img, .lpj-cta { transition: none; }
}
