/* ═══════════════════════════════════════════════════════════════
   Giặt Ơi! — /theo-doi
   Design language matches /dat-hang — same overlay, same modal,
   same success-summary rows. Minimal new styling.
   ═══════════════════════════════════════════════════════════════ */

[hidden] { display: none !important; }

/* ─── Page shell ─── */
.track-page {
  background: var(--brand-cream, #faf5e8);
  min-height: 100vh;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink-1, #1a1a1a);
}

/* ─── Top bar (same logo scale as home /nav-logo) ─── */
.track-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.track-logo { display: inline-flex; text-decoration: none; transition: opacity 0.2s; }
.track-logo:hover { opacity: 0.78; }
.track-logo img { display: block; height: 84px; width: auto; }
@media (max-width: 640px) {
  .track-topbar { padding: 12px 16px; }
  .track-logo img { height: 44px; }
}

/* ─── Base: unlock form centered ─── */
.track-base {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 160px);
  padding: 24px 16px 48px;
}
.track-unlock-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 28px 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  border: 1px solid #eee8dc;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
.track-unlock-h1 {
  font-family: 'Bahianita', 'Roboto', sans-serif;
  font-size: clamp(30px, 6vw, 40px);
  color: var(--brand-red);
  margin: 6px 0 8px;
  line-height: 1;
}
.track-unlock-sub {
  color: var(--ink-2, #4d4d4d);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 22px;
}
.track-unlock-form { display: grid; gap: 12px; text-align: left; }

.track-field-label {
  display: block;
  font-size: 12px;
  color: var(--ink-2, #4d4d4d);
  margin-bottom: 6px;
  font-weight: 600;
}
.track-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #eee8dc;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink-1, #1a1a1a);
  transition: border-color 0.15s;
}
.track-field input:focus {
  outline: none;
  border-color: var(--brand-red);
}
.track-unlock-err {
  background: #ffeceb;
  color: #a00;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0;
}

/* Unlock button — reuses the site CTA pattern (red pill, Bahianita) */
.track-unlock-btn {
  position: relative;
  background: var(--brand-red);
  color: #fff;
  font-family: 'Bahianita', 'Roboto', sans-serif;
  font-size: 22px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, transform 0.1s;
}
.track-unlock-btn:hover { background: #c00202; }
.track-unlock-btn:active { transform: translateY(1px); }
.track-unlock-btn.is-loading .track-unlock-btn-label { opacity: 0.4; }
.track-unlock-btn-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: track-spin 0.7s linear infinite;
}
.track-unlock-btn.is-loading .track-unlock-btn-spinner { display: block; }
@keyframes track-spin { to { transform: rotate(360deg); } }

.track-unlock-foot {
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-3, #808080);
}
.track-unlock-foot a {
  color: var(--brand-red);
  font-weight: 600;
  text-decoration: none;
  margin-left: 6px;
}

/* ═══════════════════════════════════════════════════════
   MODAL — reuses .order-overlay + .order-modal
   Overrides below only where the tracking modal differs.
   ═══════════════════════════════════════════════════════ */
.track-modal-overlay { z-index: 300; }

/* Scrollable body between the head and sticky foot */
.track-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Modal head: reuse .order-modal-head but center the code in brand-yellow pill */
#modalTitle.order-hero-title {
  display: inline-block;
  background: var(--brand-yellow);
  color: var(--brand-red);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: clamp(20px, 4vw, 28px);
  margin: 4px auto 0;
}

/* Sticky bottom — just the call button */
.track-modal-foot {
  flex: 0 0 auto;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0));
  background: #fff;
  border-top: 1px solid #eee8dc;
  display: flex;
  justify-content: center;
}
.track-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-red);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.track-call-btn:active { transform: translateY(1px); }

/* ─── Status strip inside the modal body ─── */
.track-status-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--brand-red);
  color: #fff;
  border-radius: 16px;
  padding: 16px 18px;
}
.track-status-strip.is-cancelled { background: #4a4a4a; }
.track-status-strip.is-completed { background: #1a8e3b; }
.track-status-icon {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.track-status-icon svg { width: 28px; height: 28px; display: block; }
.track-status-text { flex: 1; min-width: 0; }
.track-status-label {
  /* Readability (Dong 2026-07-22): the decorative Bahianita display face was
     hard to read here; use the clean body sans-serif, bold, keeping the yellow. */
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 4.4vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--brand-yellow);
}
.track-status-strip.is-completed .track-status-label { color: #fff5b0; }
.track-status-sub {
  font-size: 14px;
  opacity: 1;
  margin-top: 5px;
  line-height: 1.45;
}
.track-status-step {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Summary rows (reuse .success-summary visual) ─── */
.track-summary-block {
  margin: 0;
}
.track-summary-block div + div {
  border-top: 1px solid #f0e7c8;
  margin-top: 6px;
  padding-top: 6px;
}

/* ─── Section heading ─── */
.track-section { margin: 0; }
.track-section-h3 {
  font-size: 12px;
  color: var(--brand-red);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px 2px;
}

/* ─── Team ─── */
.track-team { display: grid; gap: 8px; }
.track-team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #eee8dc;
  border-radius: 14px;
  padding: 12px 14px;
}
.track-team-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-yellow);
  color: var(--brand-red);
  display: grid;
  place-items: center;
  font-family: 'Bahianita', 'Roboto', sans-serif;
  font-size: 18px;
  flex-shrink: 0;
}
.track-team-info { flex: 1; min-width: 0; }
.track-team-role {
  font-size: 11px;
  color: var(--ink-3, #808080);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.track-team-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-1, #1a1a1a);
  margin-top: 1px;
}
.track-team-call {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-red);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.track-team-call:active { transform: translateY(1px); }
.track-team-call-icon svg { width: 14px; height: 14px; display: block; }

/* ─── Timeline ─── */
.track-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #eee8dc;
  border-radius: 16px;
  overflow: hidden;
}
.track-step {
  position: relative;
  padding: 14px 16px 14px 56px;
  border-bottom: 1px solid #f5eecd;
}
.track-step:last-child { border-bottom: none; }

.track-step-icon {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f0e7c8;
  color: var(--ink-3, #808080);
  z-index: 2;
}
.track-step-icon svg { width: 18px; height: 18px; display: block; }
.track-step::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 46px;
  bottom: -14px;
  width: 2px;
  background: #f0e7c8;
  z-index: 1;
}
.track-step:last-child::after { display: none; }

.track-step.is-done .track-step-icon { background: var(--brand-red); color: #fff; }
.track-step.is-done::after { background: var(--brand-red); }
.track-step.is-current .track-step-icon {
  background: var(--brand-yellow);
  color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(255, 194, 0, 0.3);
}
.track-step.is-current { background: #fffaf0; }

.track-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.track-step-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-1, #1a1a1a);
}
.track-step.is-current .track-step-label { color: var(--brand-red); }
.track-step.is-pending .track-step-label { color: var(--ink-3, #808080); font-weight: 500; }
.track-step-time {
  font-size: 12px;
  color: var(--ink-3, #808080);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.track-step-sub {
  font-size: 13px;
  color: var(--ink-2, #4d4d4d);
  margin-top: 2px;
  line-height: 1.4;
}
.track-step.is-pending .track-step-sub { color: #bdbdbd; }

.track-step-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.track-step-photo {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: none;
  padding: 0;
  background: #f5f5f5;
  cursor: pointer;
}
.track-step-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.track-step-photo:hover { transform: translateY(-2px); }

.track-notes {
  margin-top: 10px;
  background: #fff9e6;
  border: 1px solid #f0e7c8;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink-2, #4d4d4d);
  line-height: 1.5;
}

/* ─── Payment ─── */
.track-payment {
  background: #fff;
  border: 1px solid #eee8dc;
  border-radius: 14px;
  overflow: hidden;
}
.track-payment-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid #f5eecd;
  font-size: 14px;
}
.track-payment-row:last-of-type { border-bottom: none; }
.track-payment-label { color: var(--ink-2, #4d4d4d); }
.track-payment-value { font-weight: 600; color: var(--ink-1, #1a1a1a); }
.track-payment-value.is-paid { color: #1a8e3b; }
.track-payment-value.is-pending { color: #c28a00; }
.track-payment-total { color: var(--brand-red); font-size: 17px; font-weight: 700; }

.track-payment-qr {
  padding: 16px;
  background: #fffaf0;
  border-top: 1px solid #f0e7c8;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.track-payment-qr img {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  flex-shrink: 0;
  border: 1px solid #eee8dc;
}
.track-payment-qr-text { flex: 1; font-size: 13px; color: var(--ink-2, #4d4d4d); line-height: 1.5; }
.track-payment-qr-text strong { color: var(--ink-1, #1a1a1a); display: block; margin-bottom: 2px; }
.track-payment-bank {
  display: grid;
  gap: 3px;
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 8px;
  font-size: 12.5px;
  border: 1px solid #eee8dc;
}
.track-payment-bank code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: none;
  color: var(--ink-1, #1a1a1a);
  font-weight: 600;
}
@media (max-width: 500px) {
  .track-payment-qr { flex-direction: column; align-items: center; text-align: center; }
}

/* ─── Refresh row ─── */
.track-refresh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3, #808080);
  padding: 4px 2px;
}
.track-refresh-btn {
  background: transparent;
  border: 1px solid #eee8dc;
  color: var(--brand-red);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.track-refresh-btn:hover { background: #fff; border-color: var(--brand-red); }

/* ─── Lightbox ─── */
.track-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 500;
  animation: track-fade 0.15s ease-out;
}
@keyframes track-fade { from { opacity: 0; } to { opacity: 1; } }
.track-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
}
.track-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.track-lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* Visually-hidden text for screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── Customer photo gallery + upload ─────────────────────────── */
.track-photos{
  margin:16px 16px 0;background:#fff;border:1px solid #e5e7eb;
  border-radius:12px;padding:14px;
}
.track-photos-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:10px;
}
.track-photos-head strong{font-size:14px;color:#374151;}
.track-photo-upload-btn{
  display:inline-flex;align-items:center;gap:6px;cursor:pointer;
  background:#e00303;color:#fff;border-radius:999px;
  padding:6px 14px 6px 12px;font-size:12px;font-weight:700;
  letter-spacing:.04em;
}
.track-photo-upload-btn:hover{background:#7a0202;}
.track-photos-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));
  gap:8px;
}
.track-photo-thumb{
  position:relative;display:block;border-radius:8px;overflow:hidden;
  border:1px solid #e5e7eb;text-decoration:none;background:#f3f4f6;
}
.track-photo-thumb img{width:100%;aspect-ratio:1;object-fit:cover;display:block;}
.track-photo-thumb span{
  position:absolute;bottom:0;left:0;right:0;
  background:rgba(0,0,0,.55);color:#fff;font-size:10px;
  text-align:center;padding:2px 0;letter-spacing:.04em;
}
.track-photo-feedback{
  margin-top:8px;font-size:12px;color:#6b7280;min-height:14px;
}
.track-photo-feedback.ok{color:#059669;}
.track-photo-feedback.err{color:#dc2626;}

/* ═══════════════════════════════════════════════════════════════
   Bilingual EN sub-text (2026-05-18 — foreign-friendly tracking)
   .track-en renders the English translation below its Vietnamese
   parent in a lighter, smaller line. Inline parent stays primary.
   ═══════════════════════════════════════════════════════════════ */
.track-en {
  display: block;
  font-size: 0.78em;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  color: rgba(26, 26, 26, 0.55);
  margin-top: 2px;
  font-style: normal;
  /* Avoid inheriting bold/transform from parent labels */
  text-transform: none;
}
/* Eyebrow has uppercase + brand red; keep EN readable but not shouty */
.order-eyebrow .track-en {
  color: rgba(224, 3, 3, 0.55);
  font-weight: 600;
  letter-spacing: 0.02em;
}
/* H1 / H2 / H3 — EN should be visibly subordinate */
.track-unlock-h1 .track-en,
.track-section-h3 .track-en {
  font-size: 0.62em;
  color: rgba(26, 26, 26, 0.5);
  font-weight: 500;
  margin-top: 4px;
}
/* Form field labels — keep compact */
.track-field-label .track-en {
  font-size: 0.85em;
  color: rgba(26, 26, 26, 0.5);
  font-weight: 400;
}
/* Status label inside the status strip */
.track-status-label .track-en {
  font-size: 0.75em;
  color: rgba(26, 26, 26, 0.55);
  font-weight: 500;
}
.track-status-sub .track-en {
  font-size: 0.92em;
  color: rgba(26, 26, 26, 0.5);
}
/* Summary table dt labels */
.track-summary-block dt .track-en {
  font-size: 0.82em;
  color: rgba(26, 26, 26, 0.5);
  font-weight: 400;
}
/* Timeline step label */
.track-step-label .track-en {
  font-size: 0.78em;
  color: rgba(26, 26, 26, 0.55);
  font-weight: 400;
}
.track-step-sub .track-en {
  font-size: 0.92em;
  color: rgba(26, 26, 26, 0.5);
}
/* Team role */
.track-team-role .track-en {
  font-size: 0.82em;
  color: rgba(26, 26, 26, 0.55);
  font-weight: 400;
}
/* Payment row labels + values */
.track-payment-label .track-en,
.track-payment-value .track-en {
  font-size: 0.82em;
  color: rgba(26, 26, 26, 0.5);
  font-weight: 400;
}
/* QR-block headings/text */
.track-payment-qr-text .track-en {
  display: block;
  font-size: 0.85em;
  color: rgba(26, 26, 26, 0.55);
  font-weight: 400;
  margin-top: 2px;
}
/* Photo section header */
.track-photos-head .track-en {
  font-size: 0.78em;
  color: rgba(26, 26, 26, 0.5);
  font-weight: 400;
}
/* Cancelled state — keep EN visible against red bg */
.track-status-strip.is-cancelled .track-en {
  color: rgba(255, 255, 255, 0.75);
}
.track-status-strip.is-completed .track-en {
  color: rgba(255, 255, 255, 0.75);
}
/* On dark/cream backgrounds inside the unlock card eyebrow */
.track-unlock-card .order-eyebrow .track-en {
  color: rgba(224, 3, 3, 0.6);
}
