/* Customer tracking page 2.0 — quiet, premium, mobile-first. Every colour, the font and the
   corner radius come from the store's own settings (track.js writes them onto :root). */
:root, :host {
  --accent: #111111;
  --accent-ink: #ffffff;
  --bg: #f6f6f4;
  --card: #ffffff;
  --text: #151515;
  --text-2: #6b6b70;
  --text-3: #9c9ca3;
  --line: #e8e8e6;
  --soft: #f3f3f1;
  --green: #17843f;
  --green-bg: #e7f5ec;
  --amber: #b45309;
  --amber-bg: #fdf1e3;
  --red: #c62828;
  --red-bg: #fdeaea;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body, .tk-embed {
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased; font-size: 15.5px; line-height: 1.5;
}
/* Inside the shop's own theme (App Proxy, application/liquid): the theme already shows the logo,
   the menu and the footer, so ours step aside and the page sits on the theme's background. */
:host { display: block; }
.tk-embed { background: transparent; text-align: left; opacity: 1 !important; transition: opacity .15s; }
.tk-embed .brand, .tk-embed .foot { display: none; }
.tk-embed .wrap { padding-top: 28px; }
a { color: inherit; }
.wrap { max-width: 600px; margin: 0 auto; padding: 32px 18px 56px; }
/* The result view is wider than the lookup form: on a desktop inside the shop a 600px column
   reads as an empty page. Two columns from 900px, one on a phone. */
.wrap:has(#result:not(.hidden)) { max-width: 1080px; }
.cols { display: block; }
@media (min-width: 900px) {
  .cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .col-side { position: sticky; top: 18px; }
}
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.center { text-align: center; }

/* Brand */
.brand { text-align: center; margin: 4px 0 26px; }
.brand-link { display: inline-block; text-decoration: none; }
.brand-logo { display: block; margin: 0 auto; height: 34px; width: auto; max-width: 260px; object-fit: contain;
  /* Most store logos are a PNG on a white box. Multiply lets that white fall away against the
     page, so only the mark stays, without asking anyone for a transparent file. */
  mix-blend-mode: multiply; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 10px 30px -18px rgba(0,0,0,.14);
}
h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.015em; }
/* Headings and buttons follow the shop's theme when the page is inside it (track.js reads the
   theme and sets these); standalone they fall back to the page's own. */
h1, .hero-title, .up-h { font-family: var(--hfont, var(--font)); text-transform: var(--h-tt, none);
  letter-spacing: var(--h-ls, -0.015em); font-weight: var(--h-weight, 700); }
.tk-embed { font-weight: var(--body-weight, 400); letter-spacing: var(--body-ls, normal); }
h2 { margin: 0; }
.sec-title {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2); margin: 0 0 14px;
}
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

/* Fields + buttons */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .field textarea {
  font-family: inherit; font-size: 15.5px; padding: 12px 14px; border-radius: max(0px, calc(var(--radius) - 4px));
  border: 1px solid var(--line); background: var(--soft); color: var(--text); font-weight: 400; width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--card); }
.field textarea { resize: vertical; min-height: 84px; }
.lookup form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
/* The lookup state: a centred hero, the form, then the same trust, answers and bestsellers. */
.wrap:has(#lookup:not(.hidden)) { max-width: 1080px; }
.lk-hero { text-align: center; margin: 8px 0 22px; }
.lk-hero p { margin: 6px auto 0; max-width: 520px; font-size: 15.5px; }
#lookup .card.lookup, #lookup .lk-faq { max-width: 560px; margin-left: auto; margin-right: auto; }
#lookup .trust { max-width: 820px; margin: 18px auto 14px; }
.lk-hint { margin: 14px 0 0; font-size: 13px; color: var(--text-3); text-align: center; }
.field input, .field textarea { border-radius: var(--btn-radius, max(0px, calc(var(--radius) - 4px))) !important; }
#lookup .btn { width: 100%; }
.btn {
  font-family: inherit; font-size: var(--btn-size, 15px); font-weight: var(--btn-weight, 600); padding: 14px 20px;
  text-transform: var(--btn-tt, none); letter-spacing: var(--btn-ls, normal);
  border-radius: var(--btn-radius, calc(var(--radius) - 4px)); background: var(--accent); color: var(--accent-ink);
  border: none; cursor: pointer; transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-ghost {
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 11px 16px;
  border-radius: max(0px, calc(var(--radius) - 4px)); background: transparent; color: var(--text);
  border: 1px solid var(--line); cursor: pointer;
}
.btn-ghost:hover { background: var(--soft); }
.link-btn { font-family: inherit; font-size: 14px; font-weight: 600; color: var(--accent); background: none; border: none; padding: 6px 0 0; cursor: pointer; }
.form-err { color: var(--red); font-size: 14px; margin: 10px 0 0; }

/* Hero */
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hero-order b { font-weight: 700; font-size: 14px; }
.pill {
  flex-shrink: 0; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--soft); color: var(--text-2); white-space: nowrap;
}
.pill.s-transit, .pill.s-info, .pill.s-pending { background: var(--soft); color: var(--text); }
.pill.s-ofd { background: var(--amber-bg); color: var(--amber); }
.pill.s-delivered { background: var(--green-bg); color: var(--green); }
.pill.s-exception { background: var(--red-bg); color: var(--red); }
.hero-title { font-size: 28px; line-height: 1.2; margin: 0 0 6px; }
@media (min-width: 900px) { .hero-title { font-size: 32px; } .card.hero { padding: 32px; } }
.hero-sub { margin: 0; color: var(--text-2); }
.eta {
  margin-top: 18px; padding: 14px 16px; border-radius: max(0px, calc(var(--radius) - 4px));
  background: color-mix(in srgb, var(--accent) 9%, var(--card)); color: var(--text);
  font-size: 14.5px; display: flex; gap: 12px; align-items: center;
}
.eta svg { color: var(--accent); flex-shrink: 0; }
.eta span { display: flex; flex-direction: column; line-height: 1.3; color: var(--text-2); font-size: 13px; }
.eta span b { font-size: 18px; color: var(--text); font-weight: 700; }
.eta.is-delivered svg { color: var(--green); }
.eta.is-delivered { background: var(--green-bg); color: var(--green); }

/* Progress */
.progress { display: flex; margin: 26px 0 6px; }
.pstep { flex: 1; text-align: center; position: relative; }
.pstep .dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--line); margin: 0 auto 8px;
  display: grid; place-items: center; color: var(--accent-ink); font-size: 12px; position: relative; z-index: 1;
}
.pstep .plabel { font-size: 11px; color: var(--text-3); font-weight: 600; line-height: 1.25; }
.pstep .pdate { font-size: 10.5px; color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pstep::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.pstep:first-child::before { display: none; }
.pstep.done .dot, .pstep.active .dot { background: var(--accent); }
.pstep.done::before, .pstep.active::before { background: var(--accent); }
.pstep.active .dot { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.pstep.done .plabel, .pstep.active .plabel { color: var(--text); }
.progress.is-exception .pstep.active .dot { background: var(--red); box-shadow: 0 0 0 5px rgba(198,40,40,.14); }
.progress.is-exception .pstep.active .plabel { color: var(--red); }

.latest { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.latest .l-desc { font-weight: 600; }
.latest .l-meta { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.carrier { margin-top: 10px; font-size: 13.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.carrier code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--soft); padding: 2px 7px; border-radius: 6px; color: var(--text); }
.carrier .copy { font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; }
.notice { margin-top: 16px; padding: 12px 14px; border-radius: max(0px, calc(var(--radius) - 4px)); background: var(--amber-bg); color: var(--amber); font-size: 14px; line-height: 1.45; }
.notice b { display: block; margin-bottom: 2px; }
.notice.is-red { background: var(--red-bg); color: var(--red); }
.notice.is-calm { background: var(--soft); color: var(--text-2); }
.reassure { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.reassure .link-btn { padding: 0; font-size: 13.5px; }

/* Trust: three promises under the status */
.trust { display: grid; grid-template-columns: 1fr; gap: 0; margin-bottom: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tr-item { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-top: 1px solid var(--line); }
.tr-item:first-child { border-top: 0; }
.tr-ic { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.tr-item b { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.tr-item span span, .tr-item div > span { display: block; color: var(--text-2); font-size: 13px; margin-top: 3px; line-height: 1.4; }
@media (min-width: 680px) {
  .trust { grid-template-columns: repeat(3, 1fr); }
  .tr-item { border-top: 0; border-left: 1px solid var(--line); flex-direction: column; gap: 10px; }
  .tr-item:first-child { border-left: 0; }
}

/* FAQ */
.fq { border-top: 1px solid var(--line); }
.fq:first-child { border-top: 0; }
.fq summary { cursor: pointer; list-style: none; padding: 13px 26px 13px 0; font-weight: 600; font-size: 14.5px; position: relative; line-height: 1.35; }
.fq summary::-webkit-details-marker { display: none; }
.fq summary::after { content: "+"; position: absolute; right: 2px; top: 10px; font-size: 20px; font-weight: 400; color: var(--text-3); }
.fq[open] summary::after { content: "\2013"; }
.fq p { margin: 0 0 14px; color: var(--text-2); font-size: 14px; line-height: 1.55; }

/* Items */
.products { display: flex; flex-direction: column; gap: 14px; }
.prod { display: flex; align-items: center; gap: 14px; }
.prod-img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: var(--soft); flex-shrink: 0; border: 1px solid var(--line); }
.prod-info { flex: 1; min-width: 0; }
.prod-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.prod-var { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.prod-qty { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Destination */
.dest { font-size: 15px; line-height: 1.55; }
.mapwrap { margin-top: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.mapwrap #lmap { width: 100%; height: 190px; }
.leaflet-container { font: inherit; }

/* Help */
.reasons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reason {
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 999px;
  background: var(--soft); color: var(--text); border: 1px solid transparent; cursor: pointer;
}
.reason:hover { border-color: var(--line); }
.reason.on { background: var(--accent); color: var(--accent-ink); }
.help-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.help-actions { display: flex; gap: 10px; align-items: center; }
.help-done { margin-top: 14px; padding: 14px 16px; border-radius: max(0px, calc(var(--radius) - 4px)); background: var(--green-bg); color: var(--green); font-weight: 600; }

/* Upsell */
.upsell { margin: 34px 0 16px; }
.up-h { font-size: 22px; text-align: center; margin: 0 0 18px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.up {
  display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.up:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -16px rgba(0,0,0,.25); }
.up-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--soft); display: block; }
.up-body { padding: 10px 12px 12px; }
.up-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.up-price { font-size: 13.5px; color: var(--text-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.up-price.is-sale s { color: var(--text-3); margin-right: 6px; }
.up-price.is-sale b { color: var(--red); font-weight: 700; }
.up-off { display: inline-block; margin-left: 6px; color: var(--red); font-size: 12px; font-weight: 600; }
.up-cta { margin-top: 12px; padding: 10px 8px; text-align: center; background: var(--accent); color: var(--accent-ink);
  border-radius: var(--btn-radius, calc(var(--radius) - 6px)); font-size: 12px; font-weight: var(--btn-weight, 700);
  text-transform: var(--btn-tt, none); letter-spacing: var(--btn-ls, normal); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } .up-title { font-size: 12.5px; } }

/* Timeline */
.timeline { position: relative; }
.tl-row { display: flex; gap: 14px; padding-bottom: 16px; position: relative; }
.tl-row:last-child { padding-bottom: 0; }
.tl-row:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); margin-top: 4px; flex-shrink: 0; z-index: 1; box-shadow: 0 0 0 3px var(--card); }
.tl-row:first-child .tl-dot { background: var(--accent); }
.tl-body b { font-size: 14.5px; font-weight: 600; }
.tl-meta { color: var(--text-2); font-size: 13px; margin-top: 1px; }
.tl-empty { color: var(--text-3); }

/* States */
.state { text-align: center; color: var(--text-2); padding: 36px 22px; }
.state-icon { font-size: 30px; margin-bottom: 8px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 22px; line-height: 1.5; }

@media (max-width: 420px) {
  .wrap { padding: 22px 14px 48px; }
  .card { padding: 20px 18px; }
  .hero-title { font-size: 23px; }
  .pstep .plabel { font-size: 10px; }
}
