/* LAFU Shipping: pickup point picker at checkout. Follows the theme's colours. */
.lafu-sh-picker {
	--lafu-sh-line: color-mix(in srgb, currentColor 18%, transparent);
	--lafu-sh-soft: color-mix(in srgb, currentColor 5%, transparent);
	--lafu-sh-accent: var(--wp--preset--color--primary, var(--lamoi-accent, #1d4ed8));
	/* Text on the accent: the theme's readable pair when it has one (Mama Llama), else white. */
	--lafu-sh-on-accent: var(--wp--custom--on-primary, var(--wp--preset--color--primary-contrast, #fff));
	margin: 12px 0 4px;
	font-size: 0.9375em;
	line-height: 1.4;
	text-align: start;
}

.lafu-sh-picker__label {
	display: block;
	margin: 0 0 8px;
	font-weight: 600;
}

.lafu-sh-picker__search {
	display: flex;
	gap: 8px;
	margin: 0 0 10px;
}

.lafu-sh-picker__search input {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 12em;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--lafu-sh-line);
	border-radius: 10px;
	background: transparent;
	color: inherit;
	font: inherit;
}

.lafu-sh-picker__button,
.lafu-sh-view {
	min-height: 44px;
	padding: 8px 16px;
	border: 1px solid var(--lafu-sh-line);
	border-radius: 10px;
	background: var(--lafu-sh-soft);
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.lafu-sh-picker__button:hover,
.lafu-sh-view:hover {
	border-color: currentColor;
}

.lafu-sh-picker :focus-visible {
	outline: 2px solid var(--lafu-sh-accent);
	outline-offset: 2px;
}

.lafu-sh-picker__note {
	margin: 0 0 10px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--lafu-sh-soft);
}

.lafu-sh-picker.is-loading .lafu-sh-picker__ui {
	opacity: 0.55;
}

.lafu-sh-views {
	display: none;
	gap: 6px;
	margin: 0 0 8px;
}

.lafu-sh-view {
	min-height: 36px;
	padding: 4px 14px;
}

.lafu-sh-view[aria-pressed="true"] {
	border-color: currentColor;
	background: color-mix(in srgb, currentColor 12%, transparent);
}

.lafu-sh-body.has-map {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 10px;
}

.lafu-sh-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 320px;
	margin: 0;
	padding: 2px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.lafu-sh-opt {
	position: relative;
	display: grid;
	flex: 0 0 auto;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: start;
	gap: 10px;
	min-height: 64px;
	margin: 0;
	padding: 10px 12px;
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.35;
	border: 1px solid var(--lafu-sh-line);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.lafu-sh-opt:hover {
	border-color: color-mix(in srgb, currentColor 45%, transparent);
}

.lafu-sh-opt.is-picked {
	border-color: var(--lafu-sh-accent);
	background: color-mix(in srgb, var(--lafu-sh-accent) 8%, transparent);
	box-shadow: inset 0 0 0 1px var(--lafu-sh-accent);
}

.lafu-sh-opt input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.lafu-sh-opt:focus-within {
	outline: 2px solid var(--lafu-sh-accent);
	outline-offset: 2px;
}

.lafu-sh-opt::before {
	display: block;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	border: 2px solid color-mix(in srgb, currentColor 55%, transparent);
	border-radius: 50%;
	content: "";
}

.lafu-sh-opt.is-picked::before {
	border-color: var(--lafu-sh-accent);
	background: radial-gradient(circle, var(--lafu-sh-accent) 0 45%, transparent 50%);
}

.lafu-sh-body.has-map .lafu-sh-opt {
	grid-template-columns: auto minmax(0, 1fr) auto;
}

.lafu-sh-body.has-map .lafu-sh-opt::before {
	display: none;
}

.lafu-sh-opt__num {
	display: inline-grid;
	width: 24px;
	height: 24px;
	place-items: center;
	border-radius: 50%;
	background: #1f2937;
	color: #fff;
	font: 700 12px/1 system-ui, sans-serif;
}

.lafu-sh-opt.is-picked .lafu-sh-opt__num {
	background: var(--lafu-sh-accent);
	color: var(--lafu-sh-on-accent);
}

.lafu-sh-opt__body {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.lafu-sh-opt__name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.lafu-sh-opt__addr,
.lafu-sh-opt__hours,
.lafu-sh-opt__dist {
	font-size: 0.875em;
	opacity: 0.8;
}

.lafu-sh-opt__meta {
	display: grid;
	justify-items: end;
	gap: 4px;
	white-space: nowrap;
}

.lafu-sh-opt__tag {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--lafu-sh-soft);
	font-size: 0.75em;
	font-weight: 600;
}

.lafu-sh-mapbox {
	position: relative;
	min-height: 320px;
	overflow: hidden;
	border: 1px solid var(--lafu-sh-line);
	border-radius: 12px;
	background: #e8ecef;
	isolation: isolate;
}

.lafu-sh-map__layer {
	position: absolute;
	inset: 0;
}

.lafu-sh-map__tile {
	position: absolute;
	width: 256px;
	max-width: none;
	height: 256px;
	user-select: none;
	pointer-events: none;
}

.lafu-sh-pin {
	position: absolute;
	z-index: 2;
	display: grid;
	width: 28px;
	height: 28px;
	place-items: center;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #1f2937;
	box-shadow: 0 2px 6px rgb(0 0 0 / 35%);
	color: #fff;
	font: 700 12px/1 system-ui, sans-serif;
	cursor: pointer;
	transform: translate(-50%, -50%);
}

.lafu-sh-pin.is-picked {
	z-index: 3;
	width: 34px;
	height: 34px;
	background: var(--lafu-sh-accent);
	color: var(--lafu-sh-on-accent);
}

.lafu-sh-map__zoom {
	position: absolute;
	z-index: 4;
	top: 8px;
	right: 8px;
	display: grid;
	gap: 4px;
}

.lafu-sh-map__zoom button {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid rgb(0 0 0 / 20%);
	border-radius: 8px;
	background: #fff;
	color: #111827;
	font: 600 18px/1 system-ui, sans-serif;
	cursor: pointer;
}

.lafu-sh-map__credit {
	position: absolute;
	z-index: 4;
	right: 0;
	bottom: 0;
	padding: 2px 6px;
	border-top-left-radius: 6px;
	background: rgb(255 255 255 / 85%);
	color: #1f2937;
	font-size: 11px;
	text-decoration: none;
}

.lafu-sh-point-card {
	margin: 24px 0;
	padding: 16px 20px;
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 12px;
}

.lafu-sh-point-card h2 {
	margin: 0 0 8px;
	font-size: 1.125em;
}

.lafu-sh-point-card address {
	font-style: normal;
}

@media (max-width: 640px) {
	.lafu-sh-views {
		display: flex;
	}

	.lafu-sh-body.has-map {
		display: block;
	}

	.lafu-sh-body.has-map .lafu-sh-mapbox {
		display: none;
	}

	.lafu-sh-body.show-map .lafu-sh-list {
		display: none;
	}

	.lafu-sh-body.show-map .lafu-sh-mapbox {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lafu-sh-opt {
		transition: none;
	}
}

/* Stronger than theme and WooCommerce styles for labels in the shipping list. */
.lafu-sh-picker .lafu-sh-list .lafu-sh-opt {
	display: grid;
	width: auto;
	text-indent: 0;
}

.lafu-sh-picker .lafu-sh-opt__body {
	display: grid;
}

.woocommerce ul#shipping_method li .lafu-sh-opt {
	display: grid;
	margin: 0;
	text-indent: 0;
}

.woocommerce ul#shipping_method li .lafu-sh-opt__body,
.woocommerce ul#shipping_method li .lafu-sh-opt__meta {
	display: grid;
}
