/* ModusTech delivery estimate card.
   Brand teal + navy, same family as the Add to basket button.
   Hierarchy on the product page: headline (what you get) > clock (how long you have) > label text. */
.mt-delivery--card {
	--mt-teal: #00a3b4;
	--mt-teal-soft: #e9fafb;
	--mt-teal-line: #a9e9ee;
	--mt-navy: #15153a;
	--mt-muted: #4f5d70;

	display: flex;
	align-items: center;
	gap: 16px;
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 20px;
	padding: 16px 20px;
	background: linear-gradient(135deg, #f4fdfe 0%, #e2f7f9 100%);
	border: 1px solid var(--mt-teal-line);
	border-radius: 16px;
	box-shadow: 0 8px 20px -12px rgba(0, 163, 180, 0.55);
	color: var(--mt-navy);
	font-size: 16px;
	line-height: 1.35;
	/* The layout reacts to the width of this card, not the screen, so it also copes with a narrow buy box. */
	container-type: inline-size;
}

.mt-delivery--card[hidden] {
	display: none;
}

.mt-delivery__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--mt-teal);
	color: #fff;
}

.mt-delivery__icon svg {
	display: block !important;
	width: 32px !important;
	height: 26px !important;
	fill: none !important;
	stroke: currentColor !important;
	overflow: visible;
	animation: mt-drive-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The van: drives in, then idles with a gentle bounce, spinning wheels and speed lines. */
.mt-van__body {
	animation: mt-bounce 0.7s ease-in-out 0.9s infinite;
}

.mt-van__wheel {
	transform-box: fill-box;
	transform-origin: center;
	animation: mt-spin 0.8s linear infinite;
}

.mt-van__lines path {
	animation: mt-lines 0.9s ease-out infinite;
}

.mt-van__lines path:nth-child(2) {
	animation-delay: 0.3s;
}

.mt-van__lines path:nth-child(3) {
	animation-delay: 0.6s;
}

@keyframes mt-drive-in {
	from { transform: translateX(-46px); }
	to { transform: translateX(0); }
}

@keyframes mt-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-0.8px); }
}

@keyframes mt-spin {
	to { transform: rotate(360deg); }
}

@keyframes mt-lines {
	0% { transform: translateX(4px); opacity: 0; }
	30% { opacity: 1; }
	100% { transform: translateX(-3px); opacity: 0; }
}

@keyframes mt-road {
	to { background-position: -48px 0; }
}

.mt-delivery__body {
	flex: 1 1 auto;
	min-width: 0;
}

/* Product page, before 9pm: headline on the left, clock on the right. */
.mt-delivery__live {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px 20px;
}

.mt-delivery__done {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mt-delivery__live[hidden],
.mt-delivery__done[hidden] {
	display: none;
}

.mt-delivery__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1 1 0;
	min-width: 9.5em;
}

.mt-delivery__kicker {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--mt-teal);
}

.mt-delivery__kicker--muted {
	color: var(--mt-muted);
	letter-spacing: 0.08em;
}

.mt-delivery__headline {
	font-size: 23px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.005em;
}

.mt-delivery__title {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.mt-delivery__title--big {
	font-size: 22px;
	line-height: 1.2;
}

/* The clock block is set apart by a dashed divider, so it reads as its own thing. */
.mt-delivery__timer {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 0 0 auto;
	padding-left: 18px;
	border-left: 1px dashed var(--mt-teal-line);
}

.mt-delivery__clock {
	--mt-clock-gap: 20px;
	display: inline-flex;
	gap: var(--mt-clock-gap);
}

.mt-delivery__unit {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 48px;
	padding: 7px 5px 5px;
	background: var(--mt-navy);
	border-radius: 10px;
	color: #fff;
	text-align: center;
}

/* Colons between the boxes. */
.mt-delivery__unit + .mt-delivery__unit::before {
	content: ":";
	position: absolute;
	left: calc(-1 * var(--mt-clock-gap));
	width: var(--mt-clock-gap);
	text-align: center;
	top: 6px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--mt-navy);
}

/* The seconds box is teal, so the ticking part catches the eye. */
.mt-delivery__unit:last-child {
	background: var(--mt-teal);
}

.mt-delivery__unit b {
	font-size: 23px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.mt-delivery__unit i {
	font-size: 10px;
	font-style: normal;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.85;
}

/* Basket and checkout: same card, a little tighter. */
.mt-delivery--plain {
	position: relative;
	overflow: hidden;
	padding: 10px 14px 18px;
	margin-bottom: 16px;
}

.mt-delivery--plain .mt-delivery__icon {
	width: 56px;
	height: 56px;
}

.mt-delivery--plain .mt-delivery__icon svg {
	width: 36px !important;
	height: 29px !important;
}

.mt-delivery--plain .mt-delivery__title--big {
	font-size: 18px;
}

/* Basket and checkout: a dashed road keeps moving along the bottom of the card. */
.mt-delivery--plain::after {
	content: "";
	position: absolute;
	left: 78px;
	right: 14px;
	bottom: 7px;
	height: 3px;
	background: repeating-linear-gradient(90deg, var(--mt-teal) 0 14px, transparent 14px 24px);
	opacity: 0.55;
	border-radius: 2px;
	background-size: 48px 3px;
	animation: mt-road 1.2s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
	.mt-delivery__icon svg,
	.mt-van__body,
	.mt-van__wheel,
	.mt-van__lines path,
	.mt-delivery--plain::after {
		animation: none;
	}

	.mt-van__lines {
		display: none;
	}
}

/* Narrow card: the clock drops under the headline and spans the full width. */
@container (max-width: 440px) {
	.mt-delivery__timer {
		flex: 1 1 100%;
		padding-left: 0;
		padding-top: 12px;
		border-left: 0;
		border-top: 1px dashed var(--mt-teal-line);
	}

	.mt-delivery__clock {
		display: flex;
		--mt-clock-gap: 22px;
	}

	.mt-delivery__unit {
		flex: 1 1 0;
	}
}

/* Very narrow card (phones): the product-page icon is dropped to save width; basket and checkout keep it. */
@container (max-width: 380px) {
	.mt-delivery--card:not(.mt-delivery--plain) .mt-delivery__icon {
		display: none;
	}

	.mt-delivery__headline {
		font-size: 22px;
	}
}
