/**
 * InPost locker picker.
 *
 * Deliberately quiet: the picker sits inside someone else's checkout, so it borrows the theme's
 * type and spacing and spends its one piece of colour on the InPost yellow action button.
 * Override any of the custom properties below from your theme.
 */

.wilo-picker {
	--wilo-accent: #ffcc00;
	--wilo-accent-ink: #1a1a1a;
	--wilo-border: rgba(0, 0, 0, 0.14);
	--wilo-muted: rgba(0, 0, 0, 0.6);
	--wilo-radius: 6px;
	--wilo-gap: 12px;

	font-size: 0.9375em;
	line-height: 1.45;
	text-align: left;
}

/* Rendered as a block inside a stepped checkout's delivery step, rather than as a table row. */
.wilo-picker--block:not(:empty) {
	margin: 16px 0;
}

/* Prompt state */

.wilo-prompt {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wilo-gap);
	padding: 14px;
	border: 1px solid var(--wilo-border);
	border-radius: var(--wilo-radius);
}

.wilo-prompt__text {
	flex: 1 1 220px;
	margin: 0;
}

/* Shown once someone has tried to move on without picking. */
.wilo-prompt--required {
	border-color: #b3261e;
	border-left: 4px solid #b3261e;
}

.wilo-prompt--required .wilo-prompt__text {
	color: #b3261e;
	font-weight: 600;
}

/* Chosen state */

.wilo-chosen {
	border: 1px solid var(--wilo-border);
	border-left: 4px solid var(--wilo-accent);
	border-radius: var(--wilo-radius);
	overflow: hidden;
}

.wilo-chosen__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--wilo-gap);
	padding: 14px;
}

.wilo-chosen__body {
	flex: 1 1 220px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wilo-chosen__eyebrow {
	font-size: 0.75em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wilo-muted);
}

.wilo-chosen__address,
.wilo-chosen__hours {
	color: var(--wilo-muted);
}

/* Buttons */

.wilo-button {
	appearance: none;
	border: 1px solid transparent;
	background: var(--wilo-accent);
	color: var(--wilo-accent-ink);
	font: inherit;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: var(--wilo-radius);
	cursor: pointer;
	transition: filter 0.15s ease;
}

.wilo-button:hover {
	filter: brightness(0.94);
}

.wilo-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.wilo-button--quiet {
	background: transparent;
	border-color: var(--wilo-border);
	color: inherit;
	font-weight: 500;
}

.wilo-button--small {
	padding: 6px 12px;
	font-size: 0.875em;
	white-space: nowrap;
}

/* Modal */

body.wilo-modal-open {
	overflow: hidden;
}

.wilo-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wilo-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.wilo-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(760px, 100%);
	max-height: min(760px, 90vh);
	background: #fff;
	color: #1a1a1a;
	border-radius: 10px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	animation: wilo-rise 0.18s ease-out;
}

@keyframes wilo-rise {
	from {
		transform: translateY(8px);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wilo-modal__panel {
		animation: none;
	}

	.wilo-button {
		transition: none;
	}
}

.wilo-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--wilo-border, rgba(0, 0, 0, 0.14));
}

.wilo-modal__title {
	margin: 0;
	font-size: 1.125rem;
}

.wilo-modal__close {
	appearance: none;
	background: none;
	border: 0;
	font-size: 1.75rem;
	line-height: 1;
	padding: 0 4px;
	cursor: pointer;
	color: inherit;
}

.wilo-modal__body {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 18px;
}

/* Search */

.wilo-search__label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}

.wilo-search__row {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.wilo-search__input {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid var(--wilo-border, rgba(0, 0, 0, 0.14));
	border-radius: var(--wilo-radius, 6px);
	font: inherit;
	text-transform: uppercase;
}

.wilo-results {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wilo-results__status {
	margin: 0;
	color: rgba(0, 0, 0, 0.6);
}

.wilo-result {
	border: 1px solid var(--wilo-border, rgba(0, 0, 0, 0.14));
	border-radius: var(--wilo-radius, 6px);
	overflow: hidden;
}

.wilo-result__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
}

.wilo-result--mappable {
	cursor: pointer;
}

.wilo-result--mappable:hover {
	background: rgba(0, 0, 0, 0.02);
}

.wilo-result__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.wilo-result__photo {
	flex: 0 0 auto;
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.05);
}

.wilo-result__warning {
	font-size: 0.85em;
	font-weight: 600;
	color: #8a5a00;
}

.wilo-result__address,
.wilo-result__hint,
.wilo-result__meta {
	color: rgba(0, 0, 0, 0.6);
	font-size: 0.9em;
}

.wilo-error {
	margin: 0;
	color: #b3261e;
}

/* Map */

.wilo-map-toggle {
	align-self: flex-start;
	margin-top: 4px;
	padding: 0;
	background: none;
	border: 0;
	font: inherit;
	font-size: 0.875em;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.wilo-map-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.wilo-map {
	border-top: 1px solid var(--wilo-border, rgba(0, 0, 0, 0.14));
	background: rgba(0, 0, 0, 0.03);
}

/* Holds the loading and failure messages until the map takes the box over. */
.wilo-map__canvas {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 220px;
	padding: 0 12px;
	font-size: 0.9em;
	color: rgba(0, 0, 0, 0.6);
	text-align: center;
}

/* Leaflet needs the container to be a plain block once it takes over. */
.wilo-map__canvas.leaflet-container {
	display: block;
	padding: 0;
	background: #ddd;
}

.wilo-map__frame {
	display: block;
	width: 100%;
	height: 220px;
	border: 0;
}

/* A CSS pin, so no marker images are fetched and nothing breaks if Leaflet is self-hosted. */
.wilo-map__pin span {
	display: block;
	width: 18px;
	height: 18px;
	margin: 2px;
	border-radius: 50%;
	background: var(--wilo-accent, #ffcc00);
	border: 3px solid #1a1a1a;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.wilo-map__actions {
	padding: 8px 12px;
	border-top: 1px solid var(--wilo-border, rgba(0, 0, 0, 0.14));
}

.wilo-map__link {
	font-size: 0.9em;
}

/* Geowidget */

.wilo-geowidget {
	display: block;
	width: 100%;
	height: min(520px, 65vh);
}

/* Order confirmation */

.wilo-order-locker {
	margin-top: 28px;
}

@media (max-width: 600px) {
	.wilo-modal {
		padding: 0;
	}

	.wilo-modal__panel {
		width: 100%;
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
	}

	.wilo-result__row {
		align-items: flex-start;
		flex-wrap: wrap;
	}

	.wilo-map__canvas,
	.wilo-map__frame {
		height: 180px;
	}

	.wilo-result__photo {
		width: 56px;
		height: 56px;
	}

	.wilo-result__row .wilo-button--small {
		width: 100%;
	}
}
