/* ---------------------------------------------------------------------------
   Ace Glove — Section: Shipping & Delivery coverage (About Us)

   A centred heading over a faint dotted world map, then one card per region.
   Same soft green ground as the Products section; cards are near-white so the
   map still shows through around and faintly behind them.
--------------------------------------------------------------------------- */

.ags-coverage {
	--ags-coverage-gap: 24px;

	position: relative;
	width: 100%;
	background-color: var(--ags-white);
	background-image: linear-gradient(var(--ags-wash), var(--ags-wash));
}

.ags-coverage__inner {
	width: 100%;
	max-width: var(--ags-max);
	margin: 0 auto;
	padding: var(--ags-pad-y) var(--ags-pad-x);
}

/* --- Heading ------------------------------------------------------------- */

.ags-coverage__head {
	text-align: center;
}

.ags-coverage .ags-coverage__eyebrow {
	margin: 0 0 16px;
	font-size: var(--ags-eyebrow-size);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ags-primary);
}

.ags-coverage .ags-coverage__heading {
	margin: 0;
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--ags-secondary);
}

.ags-coverage .ags-coverage__lede {
	max-width: 62ch;
	margin: 20px auto 0;
	font-size: var(--ags-text-size);
	font-weight: 400;
	line-height: 1.8;
	color: rgba(19, 31, 40, 0.68);
}

/* --- World map ----------------------------------------------------------- */

.ags-coverage {
	--ags-coverage-pin: 11px;
	--ags-coverage-hq: 18px;
	--ags-coverage-route: 1.6;
}

.ags-coverage__map {
	max-width: 1120px;
	margin: 36px auto 0;
}

/* The stage is exactly the picture's box, so a pin placed at a percentage
   lands on the same spot of the map at every width. */
.ags-coverage__stage {
	position: relative;
}

.ags-coverage__img {
	display: block;
	width: 100%;
	height: auto;
	opacity: 0.85;
}

/* Shipping routes: same viewBox as the picture, drawn under the pins. */
.ags-coverage__routes {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

.ags-coverage__route {
	fill: none;
	stroke: var(--ags-primary);
	stroke-width: var(--ags-coverage-route);
	stroke-linecap: round;
	opacity: 0.3;
	transition: opacity var(--ags-speed) var(--ags-ease),
	            stroke-width var(--ags-speed) var(--ags-ease);
}

/* Pins are real buttons so they take focus and work by keyboard and touch. */
.ags-coverage__pin {
	position: absolute;
	z-index: 2;
	width: var(--ags-coverage-pin);
	height: var(--ags-coverage-pin);
	padding: 0;
	box-sizing: border-box;
	/* Centred with margins, not translate: GSAP takes over translate while it
	   animates the pins and leaves them half a pin out afterwards. */
	margin: calc(var(--ags-coverage-pin) / -2) 0 0 calc(var(--ags-coverage-pin) / -2);
	border: 2px solid var(--ags-white);
	border-radius: 50%;
	background-color: var(--ags-primary);
	box-shadow: 0 2px 6px rgba(19, 31, 40, 0.3);
	cursor: pointer;
	transition: opacity var(--ags-speed) var(--ags-ease),
	            transform var(--ags-speed) var(--ags-ease),
	            box-shadow var(--ags-speed) var(--ags-ease);
}

/* A larger invisible target, so a small pin is still easy to hit with a thumb. */
.ags-coverage__pin::after {
	content: "";
	position: absolute;
	inset: -9px;
	border-radius: 50%;
}

.ags-coverage__pin--hq {
	z-index: 3;
	width: var(--ags-coverage-hq);
	height: var(--ags-coverage-hq);
	margin: calc(var(--ags-coverage-hq) / -2) 0 0 calc(var(--ags-coverage-hq) / -2);
	background-color: var(--ags-secondary);
	border-color: var(--ags-white);
}

.ags-coverage__pin--hq::before {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: 50%;
	border: 2px solid var(--ags-primary);
	animation: ags-coverage-pulse 2.4s ease-out infinite;
	pointer-events: none;
}

@keyframes ags-coverage-pulse {
	0%   { transform: scale(1);   opacity: 0.9; }
	100% { transform: scale(2.8); opacity: 0; }
}

/* Tooltip: dark chip with a pointer, above the pin. --ags-tip-shift is set by
   the script when the chip would otherwise run off the edge of the section. */
.ags-coverage__tip {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 10px);
	z-index: 4;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 7px 12px 8px;
	border-radius: 8px;
	background-color: var(--ags-secondary);
	color: var(--ags-white);
	font-size: 12px;
	line-height: 1.25;
	white-space: nowrap;
	text-align: center;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translate(calc(-50% + var(--ags-tip-shift, 0px)), 6px);
	transition: opacity var(--ags-speed) var(--ags-ease),
	            transform var(--ags-speed) var(--ags-ease),
	            visibility 0s linear var(--ags-speed);
}

.ags-coverage__tip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: calc(50% - var(--ags-tip-shift, 0px));
	margin-left: -5px;
	border: 5px solid transparent;
	border-top-color: var(--ags-secondary);
}

.ags-coverage__tip strong {
	font-weight: 700;
	letter-spacing: 0.02em;
}

.ags-coverage__tip em {
	font-style: normal;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.7);
}

.ags-coverage__pin:hover .ags-coverage__tip,
.ags-coverage__pin:focus-visible .ags-coverage__tip,
.ags-coverage__pin.is-tip .ags-coverage__tip {
	opacity: 1;
	visibility: visible;
	transform: translate(calc(-50% + var(--ags-tip-shift, 0px)), 0);
	transition-delay: 0s;
}

.ags-coverage__pin:focus-visible {
	outline: 2px solid var(--ags-secondary);
	outline-offset: 3px;
}

/* Something is hovered or pinned: everything not in it steps back, and its
   own routes switch from a static line to a moving dash, like a shipment. */
.ags-coverage.has-focus .ags-coverage__pin:not(.is-on):not(.ags-coverage__pin--hq) {
	opacity: 0.28;
}

.ags-coverage.has-focus .ags-coverage__route:not(.is-on) {
	opacity: 0.08;
}

/* A halo rather than a scale: scaling the pin would scale its tooltip with it. */
.ags-coverage__pin.is-on {
	z-index: 5;
	box-shadow: 0 0 0 5px rgba(0, 127, 62, 0.25), 0 2px 8px rgba(19, 31, 40, 0.35);
}

/* The tooltip lives inside its pin, so the pin itself has to sit above every
   other pin, halo and route or their circles show through the chip. */
.ags-coverage__pin:hover,
.ags-coverage__pin:focus-visible,
.ags-coverage__pin.is-tip {
	z-index: 30;
}

.ags-coverage__pin--hq:hover,
.ags-coverage__pin--hq:focus-visible,
.ags-coverage__pin--hq.is-tip {
	z-index: 31;
}

.ags-coverage__route.is-on {
	opacity: 1;
	stroke-width: calc(var(--ags-coverage-route) * 1.7);
	stroke-dasharray: 9 11;
	animation: ags-coverage-flow 1.1s linear infinite;
}

@keyframes ags-coverage-flow {
	to { stroke-dashoffset: -20; }
}

/* Legend */
.ags-coverage__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 28px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.ags-coverage__legend-item {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(19, 31, 40, 0.7);
}

.ags-coverage__dot {
	display: block;
	flex: none;
	width: 11px;
	height: 11px;
	border: 2px solid var(--ags-white);
	border-radius: 50%;
	background-color: var(--ags-primary);
	box-shadow: 0 1px 4px rgba(19, 31, 40, 0.3);
}

.ags-coverage__dot--hq {
	width: 14px;
	height: 14px;
	background-color: var(--ags-secondary);
}

/* --- Region cards -------------------------------------------------------- */

.ags-coverage__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: stretch;
	gap: var(--ags-coverage-gap);
	margin-top: 40px;
}

.ags-coverage__card {
	padding: 28px 28px 30px;
	border: 1px solid rgba(19, 31, 40, 0.1);
	border-radius: 14px;
	background-color: rgba(255, 255, 255, 0.86);
	transition: border-color var(--ags-speed) var(--ags-ease),
	            box-shadow var(--ags-speed) var(--ags-ease);
}

.ags-coverage__card:hover {
	border-color: rgba(0, 127, 62, 0.45);
	box-shadow: 0 14px 34px rgba(19, 31, 40, 0.1);
}

.ags-coverage__card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding-bottom: 18px;
	margin-bottom: 18px;
	border-bottom: 1px solid rgba(19, 31, 40, 0.12);
}

.ags-coverage .ags-coverage__region {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--ags-secondary);
}

.ags-coverage__count {
	display: grid;
	place-items: center;
	flex: none;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border: 1px solid rgba(0, 127, 62, 0.45);
	border-radius: 999px;
	background-color: rgba(0, 127, 62, 0.12);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	color: var(--ags-primary);
	font-variant-numeric: tabular-nums;
}

.ags-coverage__list {
	column-count: 2;
	column-gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ags-coverage__country {
	position: relative;
	break-inside: avoid;
	margin: 0;
	padding: 5px 0 5px 18px;
	font-size: var(--ags-text-size);
	font-weight: 400;
	line-height: 1.5;
	color: var(--ags-secondary);
	transition: color var(--ags-speed) var(--ags-ease),
	            transform var(--ags-speed) var(--ags-ease);
}

.ags-coverage__country::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 6px;
	height: 6px;
	margin-top: -3px;
	border-radius: 50%;
	background-color: var(--ags-primary);
}

.ags-coverage__country:hover,
.ags-coverage__country.is-on {
	color: var(--ags-primary);
	transform: translateX(3px);
}

.ags-coverage__country.is-on {
	font-weight: 600;
}

/* A region lit from the map (or pinned by a tap) shows on its card too. */
.ags-coverage__card.is-on {
	border-color: rgba(0, 127, 62, 0.45);
	box-shadow: 0 14px 34px rgba(19, 31, 40, 0.1);
}

.ags-coverage__card-head {
	cursor: pointer;
}

/* --- Breakpoints --------------------------------------------------------- */

@media (max-width: 1024px) {
	.ags-coverage {
		--ags-coverage-pin: 10px;
		--ags-coverage-hq: 16px;
		--ags-coverage-route: 2.2;
	}

	.ags-coverage__map {
		margin-top: 28px;
	}

	.ags-coverage__grid {
		grid-template-columns: minmax(0, 1fr);
		margin-top: 36px;
	}

	.ags-coverage__list {
		column-count: 3;
	}
}

@media (max-width: 600px) {
	.ags-coverage {
		--ags-coverage-gap: 16px;
		--ags-coverage-pin: 10px;
		--ags-coverage-hq: 15px;
		--ags-coverage-route: 2.6;
		--ags-coverage-map-w: 780px;
	}

	/* The map is too small to read at phone width, so it stays at a readable
	   size and the visitor swipes across it. The scroller starts centred on
	   head office (see ags-coverage.js). The top padding leaves room for a
	   tooltip above the highest pins, which a scroll container would clip. */
	.ags-coverage__scroll {
		overflow-x: auto;
		overflow-y: hidden;
		padding-top: 44px;
		margin-top: -24px;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-webkit-mask-image: linear-gradient(to right, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
		mask-image: linear-gradient(to right, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
	}

	.ags-coverage__scroll::-webkit-scrollbar {
		display: none;
	}

	.ags-coverage__stage {
		width: var(--ags-coverage-map-w);
		max-width: none;
	}

	.ags-coverage__pin {
		border-width: 1.5px;
	}

	.ags-coverage__tip {
		padding: 6px 10px 7px;
		font-size: 11px;
	}

	.ags-coverage__legend-item {
		font-size: 11px;
	}

	.ags-coverage__map {
		margin-top: 20px;
	}

	.ags-coverage__card {
		padding: 22px 20px 24px;
	}

	.ags-coverage__list {
		column-count: 2;
		column-gap: 14px;
	}
}

/* --- Scroll-in animation ------------------------------------------------- */

.ags-coverage--animate.is-armed .ags-coverage__eyebrow,
.ags-coverage--animate.is-armed .ags-coverage__heading,
.ags-coverage--animate.is-armed .ags-coverage__lede,
.ags-coverage--animate.is-armed .ags-coverage__map,
.ags-coverage--animate.is-armed .ags-coverage__card,
.ags-coverage--animate.is-armed .ags-coverage__country {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ags-coverage--animate.is-armed .ags-coverage__eyebrow,
	.ags-coverage--animate.is-armed .ags-coverage__heading,
	.ags-coverage--animate.is-armed .ags-coverage__lede,
	.ags-coverage--animate.is-armed .ags-coverage__map,
	.ags-coverage--animate.is-armed .ags-coverage__card,
	.ags-coverage--animate.is-armed .ags-coverage__country {
		opacity: 1;
	}
}

.ags-coverage--animate.is-armed .ags-coverage__pin,
.ags-coverage--animate.is-armed .ags-coverage__legend {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ags-coverage--animate.is-armed .ags-coverage__pin,
	.ags-coverage--animate.is-armed .ags-coverage__legend {
		opacity: 1;
	}

	.ags-coverage__pin--hq::before,
	.ags-coverage__route.is-on {
		animation: none;
	}
}

/* GSAP drives the pins while the section is arming; a CSS transition on top
   of that would lag every frame behind it. */
.ags-coverage.is-armed .ags-coverage__pin {
	transition: none;
}

/* The theme sizes bare <strong>/<em>, so the tooltip sets its own. */
.ags-coverage .ags-coverage__tip strong {
	font-size: 13px;
	line-height: 1.25;
}

.ags-coverage .ags-coverage__tip em {
	font-size: 11px;
	line-height: 1.25;
}
