/**
 * BG Carrier Stack — the couriers' official office maps at checkout.
 * Shared by Classic and Blocks; plain CSS, no build.
 *
 * The map sizes follow the screen rather than fixed pixels: the embedded map
 * takes most of the visible height on any device, the popup takes the screen
 * it opens on, and both follow rotation and window resizing.
 */

/* Button that opens the popup map. */
.bgcs-map-choice {
	margin: 10px 0 0;
}

.bgcs-map-choice[hidden],
.bgcs-map-modal[hidden] {
	display: none !important;
}

.bgcs-map-open,
.bgcs-map-expand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	border: 1px solid #008000;
	border-radius: 8px;
	background: #fff;
	color: #006400;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	touch-action: manipulation;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.bgcs-map-open {
	min-height: 44px;
	padding: 8px 14px;
}

.bgcs-map-expand {
	min-height: 36px;
	padding: 4px 10px;
	border-color: #c3c4c7;
	color: inherit;
	font-size: 0.9em;
	font-weight: 500;
}

.bgcs-map-open:hover,
.bgcs-map-expand:hover {
	background: #f0f8f0;
	color: #006400;
}

.bgcs-map-open:focus-visible,
.bgcs-map-expand:focus-visible,
.bgcs-map-modal__close:focus-visible {
	outline: 2px solid #006400;
	outline-offset: 2px;
}

.bgcs-map-open svg,
.bgcs-map-expand svg {
	flex: none;
	width: 18px;
	height: 18px;
}

/* Embedded map. */
.bgcs-map.bgcs-map--official {
	height: auto;
	min-height: 0;
	margin: 12px 0;
	border: 0;
	border-radius: 0;
	overflow: visible;
	background: none;
}

.bgcs-map-inline__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.bgcs-map-inline__caption {
	font-size: 0.9em;
}

.bgcs-map-inline__frame,
.bgcs-map-modal__frame {
	position: relative;
	overflow: hidden;
	background: #f3f4f3;
}

.bgcs-map-inline__frame {
	height: clamp( 380px, 70vh, 760px );
	height: clamp( 380px, 70dvh, 760px );
	border: 1px solid #e3e3e3;
	border-radius: 10px;
}

.bgcs-map-frame {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.bgcs-map-loading {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 16px;
	color: #50575e;
	text-align: center;
}

/* Popup map. */
body.bgcs-map-modal-open {
	overflow: hidden;
}

.bgcs-map-modal {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 2vh 2vw;
	overscroll-behavior: contain;
}

.bgcs-map-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgb( 15 23 42 / 65% );
}

.bgcs-map-modal__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 96vw;
	max-width: 1400px;
	height: 92vh;
	height: 92dvh;
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	color: #1e1e1e;
	box-shadow: 0 24px 70px rgb( 15 23 42 / 30% );
}

.bgcs-map-modal__header {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 16px;
	border-bottom: 1px solid #e2e8f0;
}

.bgcs-map-modal__header h2 {
	margin: 0;
	font-size: 1.15em;
	line-height: 1.3;
}

.bgcs-map-modal__close {
	display: grid;
	flex: none;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: #f1f5f9;
	color: #0f172a;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
}

.bgcs-map-modal__frame {
	flex: 1 1 auto;
	min-height: 0;
}

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

	.bgcs-map-modal__panel {
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
	}

	.bgcs-map-modal__header {
		padding: 8px 12px;
	}

	.bgcs-map-modal__header h2 {
		font-size: 1em;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.bgcs-map-open,
	.bgcs-map-expand {
		transition: none;
	}
}
