/*
 * Waywa delivery: the "Fast delivery" badge, the cart and checkout delivery bits, the /track-order/ page and the
 * tracking timeline. Uses the theme's design tokens (with fallbacks) and logical properties, so it works right to left.
 */

/* Product cards */
.ww-badge--fast {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--ww-mint, #E3F2EC);
	color: #1F6B45;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

/* Cart and checkout blocks */
.ww-freebar {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 12px 0 4px;
	padding: 12px 14px;
	border-radius: 14px;
	background: var(--ww-peach, #FFE4DC);
}
.ww-freebar__text {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: #7C2D12;
}
.ww-freebar__track {
	height: 8px;
	border-radius: 999px;
	background: var(--ww-white, #FFFFFF);
	overflow: hidden;
}
.ww-freebar__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--ww-coral, #FF6B4A);
	transition: width 0.3s ease;
}
.ww-freebar.is-unlocked { background: var(--ww-mint, #E3F2EC); }
.ww-freebar.is-unlocked .ww-freebar__text { color: #1F6B45; }
.ww-freebar.is-unlocked .ww-freebar__fill { background: #1F9D61; }

.ww-cart-eta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 12px 0 4px;
	padding: 12px 14px;
	border-radius: 14px;
	background: var(--ww-sand, #F4F1EC);
	color: var(--ww-navy, #14213D);
}
.ww-cart-eta__text {
	display: flex;
	flex-direction: column;
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
}
.ww-cart-eta__label { color: var(--ww-muted, #5B6170); }
.ww-cart-eta__dates { font-size: 14px; font-weight: 600; }
.ww-cart-icon { flex: 0 0 auto; }

[dir="rtl"] .ww-cart-icon,
[dir="rtl"] .ww-thankyou-eta__icon svg,
[dir="rtl"] .ww-track__back svg { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
	.ww-freebar__fill { transition: none; }
}

/* Tracking page */
.ww-track {
	max-width: 560px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
	color: var(--ww-navy, #14213D);
}
.ww-track__intro { display: flex; flex-direction: column; gap: 6px; }
.ww-track__title {
	margin: 0;
	font-family: var(--ww-font-display, 'Alexandria', system-ui, sans-serif);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
}
.ww-track__lead { margin: 0; color: var(--ww-muted, #5B6170); }
.ww-track__error {
	padding: 12px 16px;
	border-radius: var(--ww-radius-s, 12px);
	background: var(--ww-peach, #FFE4DC);
	color: #7C2D12;
	font-size: 14px;
	font-weight: 500;
}

.ww-track-form { display: flex; flex-direction: column; gap: 14px; }
.ww-track-form__field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ww-track-form__field label { font-size: 14px; font-weight: 600; }
.ww-track-form__field input {
	box-sizing: border-box;
	width: 100%;
	height: 50px;
	padding-inline: 16px;
	border: 1px solid #CFC9BE;
	border-radius: 14px;
	background: var(--ww-white, #FFFFFF);
	color: inherit;
	font: inherit;
	font-size: 16px;
	unicode-bidi: plaintext;
	text-align: start;
}
.ww-track-form__field input:focus {
	outline: 2px solid var(--ww-navy, #14213D);
	outline-offset: 1px;
	border-color: var(--ww-navy, #14213D);
}

.ww-track__button {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 50px;
	padding-inline: 18px;
	border-radius: 14px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.ww-track__button--primary { border: 0; background: var(--ww-navy, #14213D); color: var(--ww-white, #FFFFFF); }
.ww-track__button--primary:hover,
.ww-track__button--primary:focus { background: #1F2F55; color: var(--ww-white, #FFFFFF); }
.ww-track__button--outline { border: 1.5px solid var(--ww-navy, #14213D); background: transparent; color: var(--ww-navy, #14213D); }
.ww-track__button--outline:hover,
.ww-track__button--outline:focus { background: var(--ww-sand, #F4F1EC); color: var(--ww-navy, #14213D); }
.ww-track__signin { margin: 0; font-size: 14px; color: var(--ww-muted, #5B6170); }

.ww-track-recent { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ww-track-recent__title { margin: 0; font-size: 17px; }
.ww-track-recent__list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ww-track-recent__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2px 12px;
	padding: 12px 14px;
	border: 1px solid var(--ww-line, #E6E2DA);
	border-radius: 14px;
	color: inherit;
	text-decoration: none;
}
.ww-track-recent__row:hover { border-color: var(--ww-navy, #14213D); color: inherit; }
.ww-track-recent__number { font-weight: 600; text-align: start; }
.ww-track-recent__meta { grid-column: 1; font-size: 13px; color: var(--ww-muted, #5B6170); }
.ww-track-pill {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: center;
	padding: 4px 10px;
	border-radius: 999px;
	background: #FFF1D6;
	color: #8A5A00;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}
.ww-track-pill--shipped,
.ww-track-pill--out_for_delivery { background: #E3ECFF; color: #1F4FBF; }
.ww-track-pill--customs { background: var(--ww-lilac, #ECE8FB); color: #5B3FB5; }
.ww-track-pill--delivered { background: #DFF3E8; color: #1F6B45; }
.ww-track-pill--cancelled { background: #EEECE8; color: var(--ww-muted, #5B6170); }

.ww-track__head { display: flex; align-items: center; gap: 10px; }
.ww-track__back {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--ww-sand, #F4F1EC);
	color: var(--ww-navy, #14213D);
}
.ww-track__back:hover { background: var(--ww-line, #E6E2DA); color: var(--ww-navy, #14213D); }
.ww-track__heading { display: flex; flex-direction: column; min-width: 0; }
.ww-track__head .ww-track__title { font-size: 19px; }
.ww-track__sub { font-size: 13px; color: var(--ww-muted, #5B6170); }

.ww-track-card {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	border-radius: 20px;
	background: var(--ww-navy, #14213D);
	color: var(--ww-white, #FFFFFF);
}
.ww-track-card::before {
	content: "";
	position: absolute;
	inset-inline-end: -40px;
	top: -40px;
	width: 130px;
	height: 130px;
	border-radius: 50%;
	background: #24345A;
}
.ww-track-card > * { position: relative; }
.ww-track-card__label,
.ww-track-card__step { font-size: 13px; color: #C9CEDA; }
.ww-track-card__date {
	margin: 0;
	font-family: var(--ww-font-display, 'Alexandria', system-ui, sans-serif);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}
.ww-track-card__bar {
	height: 8px;
	margin-top: 4px;
	border-radius: 999px;
	background: #2A3756;
	overflow: hidden;
}
.ww-track-card__bar span { display: block; height: 100%; border-radius: 999px; background: var(--ww-coral, #FF6B4A); }
.ww-track-card.is-cancelled { background: #3D4352; }
.ww-track-card.is-cancelled::before { background: #4A5161; }

.ww-timeline { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ww-timeline__item { position: relative; display: flex; gap: 14px; min-height: 50px; padding-bottom: 16px; }
.ww-timeline__item:last-child { min-height: 0; padding-bottom: 0; }
.ww-timeline__item:not(:last-child)::after {
	content: "";
	position: absolute;
	inset-inline-start: 13px;
	top: 28px;
	bottom: 0;
	width: 2px;
	background: var(--ww-line, #E6E2DA);
}
.ww-timeline__item.is-done:not(:last-child)::after { background: var(--ww-coral, #FF6B4A); }
.ww-timeline__dot {
	box-sizing: border-box;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 2px solid #CFC9BE;
	border-radius: 50%;
	background: var(--ww-white, #FFFFFF);
	color: var(--ww-navy, #14213D);
}
.is-done .ww-timeline__dot { border: 0; background: var(--ww-coral, #FF6B4A); }
.is-current .ww-timeline__dot { border: 3px solid var(--ww-navy, #14213D); }
.ww-timeline__pip {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--ww-navy, #14213D);
}
.is-current.is-cancelled .ww-timeline__dot { border-color: #B42318; color: #B42318; }
.ww-timeline__body { display: flex; flex-direction: column; min-width: 0; padding-top: 3px; }
.ww-timeline__title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.is-current .ww-timeline__title { font-weight: 700; }
.is-future .ww-timeline__title { font-weight: 500; color: var(--ww-muted, #5B6170); }
.ww-timeline__meta { font-size: 13px; line-height: 1.5; color: var(--ww-muted, #5B6170); overflow-wrap: anywhere; }
.ww-timeline__meta a { color: inherit; }
.ww-timeline__nowrap { white-space: nowrap; }

.ww-track-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: 16px;
	background: var(--ww-sand, #F4F1EC);
}
.ww-track-summary img.ww-track-summary__img {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	margin: 0;
	border-radius: 12px;
	object-fit: cover;
}
.ww-track-summary__text { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.4; }
.ww-track-summary__text strong { font-weight: 600; }
.ww-track-summary__text span { color: var(--ww-muted, #5B6170); }
.ww-track-summary__link { font-size: 13px; font-weight: 600; }

/* My account → View order */
.ww-track--account { max-width: 640px; margin: 0 0 32px; }
.ww-track__section-title { margin: 0; font-size: 20px; }

/* Order received */
.ww-thankyou-eta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin: 0 0 24px;
	padding: 16px 18px;
	border-radius: 18px;
	background: var(--ww-sand, #F4F1EC);
	color: var(--ww-navy, #14213D);
}
.ww-thankyou-eta__icon { display: flex; }
.ww-thankyou-eta__text { flex: 1 1 200px; display: flex; flex-direction: column; font-size: 14px; }
.ww-thankyou-eta__text span { color: var(--ww-muted, #5B6170); }
.ww-thankyou-eta__text strong { font-family: var(--ww-font-display, 'Alexandria', system-ui, sans-serif); font-size: 18px; }
.ww-thankyou-eta__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-inline: 18px;
	border-radius: 12px;
	background: var(--ww-navy, #14213D);
	color: var(--ww-white, #FFFFFF);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.ww-thankyou-eta__link:hover,
.ww-thankyou-eta__link:focus { background: #1F2F55; color: var(--ww-white, #FFFFFF); }

@media (min-width: 768px) {
	.ww-track__title { font-size: 30px; }
	.ww-track__head .ww-track__title { font-size: 24px; }
	.ww-track-card { padding: 22px 24px; }
	.ww-track-card__date { font-size: 26px; }
}
