/* SWIFT Pack Flow Tracking - public styles.
   Works on its own; picks up the theme's brand colours when --spf-* variables exist. */
.spf-track, .spf-form, .spf-map, .spf-social {
	--y: var(--spf-yellow, #FFC400);
	--ink: var(--spf-ink, #0B0B0B);
	--char: var(--spf-charcoal, #1E1F21);
	--line: var(--spf-line, #DEDED8);
	--mute: var(--spf-muted, #5B5C5F);
	--bg: var(--spf-surface, #F4F4F1);
	--ok: #1E7F3C;
	--warn: #B45309;
	--bad: #B3261E;
	box-sizing: border-box;
	font-family: inherit;
	color: var(--ink);
}
.spf-track *, .spf-form *, .spf-map * { box-sizing: border-box; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- search form ---------- */
.spf-track__label { display: block; font-weight: 700; margin: 0 0 8px; font-size: 1rem; }
.spf-track__row { display: flex; gap: 10px; align-items: stretch; }
.spf-track__input {
	flex: 1 1 auto; min-width: 0; height: 60px; padding: 0 20px; font: inherit; font-size: 1.15rem; font-weight: 600;
	letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--ink); background: #fff;
	border: 2px solid var(--ink); border-radius: 12px; margin: 0;
}
.spf-track__input::placeholder { color: #8a8b8e; font-weight: 500; letter-spacing: 0; }
.spf-track__input:focus-visible { outline: 3px solid var(--y); outline-offset: 2px; }
.spf-track__input[aria-invalid="true"] { border-color: var(--bad); }
.spf-btn {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: 0 0 auto;
	height: 60px; padding: 0 28px; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer;
	color: #000; background: var(--y); border: 2px solid var(--y); border-radius: 12px; transition: background .15s, transform .15s;
}
.spf-btn:hover { background: #ffd23d; border-color: #ffd23d; }
.spf-btn:active { transform: translateY(1px); }
.spf-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.spf-btn[disabled] { cursor: progress; opacity: .85; }
.spf-spinner { display: none; width: 18px; height: 18px; border: 3px solid rgba(0,0,0,.25); border-top-color: #000; border-radius: 50%; animation: spf-spin .7s linear infinite; }
.is-loading .spf-spinner { display: inline-block; }
@keyframes spf-spin { to { transform: rotate(360deg); } }
.spf-track__msg { margin: 12px 0 0; padding: 12px 16px; border-radius: 10px; background: #fdecea; color: #7a1812; font-weight: 600; border-left: 4px solid var(--bad); }
.spf-track__msg[hidden] { display: none; }
.spf-track--compact .spf-track__input, .spf-track--compact .spf-btn { height: 52px; }

/* dark surface helper (the theme sets .spf-on-dark on dark sections) */
.spf-on-dark .spf-track__label { color: #fff; }
.spf-on-dark .spf-track__input { border-color: transparent; }
.spf-on-dark .spf-track__msg { background: #2a1210; color: #ffd9d6; }

/* ---------- skeleton ---------- */
.spf-track__result { margin-top: 28px; outline: none; }
.spf-track__result:empty { margin-top: 0; }
.spf-skel { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: grid; gap: 14px; }
.spf-skel__l { display: block; height: 16px; border-radius: 8px; background: linear-gradient(90deg, #ececE8 25%, #f7f7f4 50%, #ececE8 75%); background-size: 200% 100%; animation: spf-shimmer 1.2s linear infinite; }
.spf-skel .w100 { width: 100%; } .spf-skel .w80 { width: 80%; } .spf-skel .w60 { width: 60%; } .spf-skel .w40 { width: 40%; }
@keyframes spf-shimmer { to { background-position: -200% 0; } }

/* ---------- result card ---------- */
.spf-result { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px -24px rgba(0,0,0,.35); text-align: left; }
.spf-result__head { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; padding: 22px 28px; background: var(--ink); color: #fff; border-bottom: 6px solid var(--y); }
.spf-result__id { display: grid; gap: 2px; min-width: 0; }
.spf-result__k { font-size: .85rem; color: #c9c9c4; }
.spf-result__num { font-size: clamp(1.25rem, 3.4vw, 1.9rem); font-weight: 800; letter-spacing: .03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spf-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: .95rem; background: var(--y); color: #000; }
.spf-badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.spf-badge--success { background: #d6f2de; color: #0f5a28; }
.spf-badge--warning { background: #ffe7c2; color: #7a3d03; }
.spf-badge--danger { background: #fbd9d6; color: #8c1a12; }
.spf-badge--hold { background: #c2410c; color: #fff; letter-spacing: .04em; }
.spf-alert { margin: 0; padding: 14px 28px; font-weight: 600; }
.spf-alert--warning { background: #fff3dd; color: #7a3d03; }
.spf-alert--danger { background: #fdecea; color: #8c1a12; }

/* route strip: origin ---[package]--- destination */
.spf-route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: center; padding: 30px 28px 10px; }
.spf-route__end { display: grid; gap: 2px; min-width: 0; }
.spf-route__end--to { text-align: right; }
.spf-route__k { font-size: .85rem; color: var(--mute); }
.spf-route__v { font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.spf-route__line { position: relative; height: 6px; margin: 0 14px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 16px); }
.spf-route__fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--ink); transition: width .6s ease; }
.spf-route__pin { position: absolute; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; color: var(--ink); background: var(--y); border: 3px solid #fff; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.spf-route__pin svg path:first-child { fill: var(--ink); }
.spf-route__line::before, .spf-route__line::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; }
.spf-route__line::before { left: -14px; }
.spf-route__line::after { right: -14px; }

.spf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; margin: 22px 28px 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.spf-fact { margin: 0; padding: 14px 16px; background: #fff; display: grid; gap: 2px; }
.spf-fact__k { font-size: .85rem; color: var(--mute); }
.spf-fact__v { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.spf-block { padding: 28px; }
.spf-block + .spf-block { border-top: 1px solid var(--line); }
.spf-block__title { margin: 0 0 18px; font-size: 1.15rem; font-weight: 800; color: var(--ink); }

/* progress steps (vertical) */
.spf-steps, .spf-events { list-style: none; margin: 0; padding: 0; }
.spf-step, .spf-event { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding-bottom: 22px; }
.spf-step:last-child, .spf-event:last-child { padding-bottom: 0; }
.spf-step::before, .spf-event::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.spf-step:last-child::before, .spf-event:last-child::before { display: none; }
.spf-step.is-completed::before { background: var(--ink); }
.spf-step__dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: #000; z-index: 1; }
.spf-step.is-completed .spf-step__dot { background: var(--y); border-color: var(--y); }
.spf-step.is-current .spf-step__dot { background: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 5px rgba(255,196,0,.55); }
.spf-step.is-current .spf-step__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--y); }
.spf-step.is-final .spf-step__dot { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 0 0 5px rgba(30,127,60,.2); }
.spf-step.is-final .spf-step__dot::after { display: none; }
.spf-step__body { display: grid; gap: 2px; padding-top: 3px; }
.spf-step__label { font-weight: 800; }
.spf-step__meta { font-size: .9rem; color: var(--mute); }
.spf-step.is-upcoming .spf-step__label { color: #8a8b8e; font-weight: 700; }
.spf-step.is-current .spf-step__label { font-size: 1.1rem; }
@media (prefers-reduced-motion: no-preference) {
	.spf-step.is-current:not(.is-final) .spf-step__dot { animation: spf-pulse 2s ease-out infinite; }
}
@keyframes spf-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,196,0,.8); } 100% { box-shadow: 0 0 0 12px rgba(255,196,0,0); } }

/* history events */
.spf-event__dot { justify-self: center; width: 14px; height: 14px; margin-top: 6px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); z-index: 1; }
.spf-event.is-latest .spf-event__dot { background: var(--y); box-shadow: 0 0 0 4px rgba(255,196,0,.4); }
.spf-event__body { display: grid; gap: 2px; min-width: 0; }
.spf-event__when { font-size: .9rem; color: var(--mute); font-variant-numeric: tabular-nums; }
.spf-event__status { margin: 0; font-weight: 800; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spf-event__tag { font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--y); color: #000; }
.spf-event__loc { margin: 0; font-weight: 600; }
.spf-event__desc { margin: 0; color: var(--mute); }
.spf-empty { margin: 0; color: var(--mute); }

.spf-result__help { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 18px 28px; background: var(--bg); border-top: 1px solid var(--line); font-weight: 600; }
.spf-link { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--y); text-underline-offset: 4px; }
.spf-link:hover { background: var(--y); text-decoration-color: transparent; }
.spf-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (max-width: 640px) {
	.spf-track__row { flex-direction: column; }
	.spf-btn { width: 100%; }
	.spf-result__head, .spf-block, .spf-result__help, .spf-alert { padding-left: 18px; padding-right: 18px; }
	.spf-facts { margin-left: 18px; margin-right: 18px; }
	.spf-route { grid-template-columns: 1fr; gap: 22px; padding: 24px 18px 6px; }
	.spf-route__end--to { text-align: left; }
	.spf-route__line { order: 2; margin: 10px 18px; }
	.spf-route__end--to { order: 3; }
}

/* ---------- contact form ---------- */
.spf-form { display: grid; gap: 18px; }
.spf-form__row { display: grid; gap: 6px; }
.spf-form label { font-weight: 700; }
.spf-form input[type="text"], .spf-form input[type="email"], .spf-form input[type="tel"], .spf-form textarea {
	width: 100%; padding: 14px 16px; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 10px; margin: 0;
}
.spf-form input:hover, .spf-form textarea:hover { border-color: #b9b9b2; }
.spf-form input:focus-visible, .spf-form textarea:focus-visible { outline: 3px solid var(--y); outline-offset: 1px; border-color: var(--ink); }
.spf-form [aria-invalid="true"] { border-color: var(--bad); }
.spf-form__err { color: var(--bad); font-weight: 600; font-size: .92rem; }
.spf-form__err[hidden], .spf-form__status[hidden] { display: none; }
.spf-form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.spf-form .spf-btn { justify-self: start; }
.spf-form__status { margin: 0; padding: 14px 16px; border-radius: 10px; font-weight: 600; outline: none; }
.spf-form__status.is-ok { background: #e3f5e8; color: #0f5a28; border-left: 4px solid var(--ok); }
.spf-form__status.is-bad { background: #fdecea; color: #7a1812; border-left: 4px solid var(--bad); }

/* ---------- map + social ---------- */
.spf-map { position: relative; width: 100%; aspect-ratio: 16 / 7; min-height: 280px; border-radius: 18px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.spf-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.spf-map--placeholder { display: grid; place-content: center; text-align: center; gap: 6px; padding: 24px;
	background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 36px 36px; }
.spf-map--placeholder span { font-weight: 800; font-size: 1.4rem; }
.spf-map--placeholder small { color: var(--mute); }

.spf-social { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.spf-social a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font-weight: 700; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 999px; transition: background .15s; }
.spf-social a:hover { background: var(--y); }
.spf-social a:focus-visible { outline: 3px solid var(--y); outline-offset: 2px; }

/* status description + ON HOLD notice */
.spf-desc { padding: 20px 28px; background: var(--bg); border-bottom: 1px solid var(--line); }
.spf-desc__k { display: block; font-size: .85rem; color: var(--mute); margin-bottom: 4px; }
.spf-desc__text { margin: 0; font-size: 1.08rem; font-weight: 600; line-height: 1.55; }
.spf-hold { padding: 22px 28px; background: #fff4e5; border-left: 10px solid #c2410c; color: #5c1d05; }
.spf-hold__title { display: block; font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 800; letter-spacing: .04em; color: #9a3412; }
.spf-hold__text { margin: 8px 0 0; font-size: 1.08rem; font-weight: 600; line-height: 1.55; }
.spf-overview { padding-bottom: 6px; }

/* sender / receiver */
.spf-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; margin: 22px 28px 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.spf-party { background: #fff; padding: 18px 20px; min-width: 0; }
.spf-party__title { margin: 0 0 10px; font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.spf-party__list { margin: 0; display: grid; gap: 6px; }
.spf-party__row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; }
.spf-party__k { font-size: .88rem; color: var(--mute); }
.spf-party__v { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.spf-party__row.is-name .spf-party__v { font-weight: 800; font-size: 1.05rem; }
@media (max-width: 640px) {
	.spf-desc, .spf-hold { padding-left: 18px; padding-right: 18px; }
	.spf-parties { margin-left: 18px; margin-right: 18px; }
}
