/* ==========================================================================
   DeshipOS — How It Works widget
   Intro header + numbered step grid with a connector line on desktop.
   Mobile-first: steps stack in one column; the connector only shows once the
   grid is multi-column. Depends on assets/css/base.css for design tokens.
   ========================================================================== */

.deshipos-hiw {
	--dhiw-accent:   var(--dew-brand, #16A34A);
	--dhiw-accent-2: var(--dew-brand-strong, #15803D);
	--dhiw-soft:     var(--dew-brand-soft, rgba(22, 163, 74, .12));
	--dhiw-soft:     color-mix(in srgb, var(--dhiw-accent) 14%, transparent);
	--dhiw-ink:      var(--dew-ink, #0F172A);
	--dhiw-text:     var(--dew-text, #1E293B);
	--dhiw-muted:    var(--dew-muted, #475569);
	--dhiw-divider:  var(--dew-divider, #E2E8F0);
	--dhiw-bg:       var(--dew-bg, #FFFFFF);
	--dhiw-gap:      32px;

	box-sizing: border-box;
	width: 100%;
	padding: 56px 20px;
	background: transparent;
	color: var(--dhiw-text);
}
.deshipos-hiw *,
.deshipos-hiw *::before,
.deshipos-hiw *::after { box-sizing: border-box; }

.deshipos-hiw__inner {
	max-width: 1140px;
	margin: 0 auto;
}

/* ----- Header ----- */
.deshipos-hiw__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 14px;
	max-width: 700px;
	margin: 0 auto 48px;
}
.deshipos-hiw__eyebrow {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--dhiw-accent-2);
	background: var(--dhiw-soft);
	padding: 6px 14px;
	border-radius: 999px;
}
.deshipos-hiw__heading {
	margin: 0;
	font-size: clamp(1.625rem, 3.5vw, 2.25rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: var(--dew-tracking-tight);
	color: var(--dhiw-ink);
}
.deshipos-hiw__subheading {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--dhiw-muted);
}

/* ----- Steps grid ----- */
.deshipos-hiw__steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}

.deshipos-hiw__step {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
}

/* ----- Number / icon badge ----- */
.deshipos-hiw__num {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--dhiw-accent) 0%, var(--dhiw-accent-2) 100%);
	color: #FFFFFF;
	font-size: 1.375rem;
	font-weight: 800;
	line-height: 1;
	box-shadow: var(--dew-shadow-md);
}
.deshipos-hiw__num i   { font-size: 1.5rem; color: #FFFFFF; }
.deshipos-hiw__num svg { width: 26px; height: 26px; fill: #FFFFFF; }
.deshipos-hiw__num svg path,
.deshipos-hiw__num svg g,
.deshipos-hiw__num svg circle,
.deshipos-hiw__num svg rect,
.deshipos-hiw__num svg polygon { fill: #FFFFFF; }

/* ----- Step text ----- */
.deshipos-hiw__step-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: var(--dew-tracking-snug);
	color: var(--dhiw-ink);
}
.deshipos-hiw__step-desc {
	margin: 0;
	font-size: .9375rem;
	line-height: 1.6;
	color: var(--dhiw-muted);
}

/* ==========================================================================
   Connector line — a dashed track behind the number badges, with an accent
   "progress" line that auto-fills across each segment in turn (a continuous
   left-to-right wave). The opaque badges sit on top and break it into
   segments. Desktop only (multi-column).
   ========================================================================== */
@media (min-width: 600px) {
	.deshipos-hiw__steps {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Auto-progress: a dashed accent line grows from one badge to the next,
   holds, then fades and restarts — looping so it always reads as "in motion". */
@keyframes dhiw-progress {
	0%   { width: 0;                            opacity: 1; }
	35%  { width: calc(100% + var(--dhiw-gap)); opacity: 1; }
	80%  { width: calc(100% + var(--dhiw-gap)); opacity: 1; }
	100% { width: calc(100% + var(--dhiw-gap)); opacity: 0; }
}

@media (min-width: 960px) {
	.deshipos-hiw {
		padding: 80px 40px;
	}
	.deshipos-hiw__head {
		margin-bottom: 56px;
	}
	.deshipos-hiw__steps {
		grid-template-columns: repeat(4, 1fr);
		gap: 32px;
	}

	/* Dashed grey base track. */
	.deshipos-hiw--connect .deshipos-hiw__step:not(:last-child)::before {
		content: "";
		position: absolute;
		top: 29px;            /* vertical centre of the 60px badge */
		left: 50%;
		width: calc(100% + var(--dhiw-gap));
		height: 0;
		border-top: 2px dashed var(--dhiw-divider);
		z-index: 0;
	}

	/* Accent progress line — same dashed style, auto-filling on a loop. */
	.deshipos-hiw--connect .deshipos-hiw__step:not(:last-child)::after {
		content: "";
		position: absolute;
		top: 29px;
		left: 50%;
		width: 0;
		height: 0;
		border-top: 2px dashed var(--dhiw-accent);
		z-index: 0;
		animation: dhiw-progress 4s var(--dew-ease-in-out) infinite;
	}
	/* Stagger each segment so the fill cascades step → step. */
	.deshipos-hiw--connect .deshipos-hiw__step:nth-child(2)::after { animation-delay: .5s; }
	.deshipos-hiw--connect .deshipos-hiw__step:nth-child(3)::after { animation-delay: 1s; }
	.deshipos-hiw--connect .deshipos-hiw__step:nth-child(4)::after { animation-delay: 1.5s; }
	.deshipos-hiw--connect .deshipos-hiw__step:nth-child(5)::after { animation-delay: 2s; }
}

/* Reduced motion — drop the auto-progress animation; the dashed track stays. */
@media (prefers-reduced-motion: reduce) {
	.deshipos-hiw__num { transition: none; }
	.deshipos-hiw--connect .deshipos-hiw__step::after { animation: none; display: none; }
}
