/* ==========================================================================
   Suong Mai Coffee Roasters — Trang Tra cuu don hang (/orders/lookup/)
   Ke thua token + component dung chung tu /shared/site-theme.css.
   Chi dung transform + opacity cho motion. Ton trong reduced-motion.
   ========================================================================== */

/* ---------------------------------------------------------------- Hero */
.lookup-hero {
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(184, 135, 91, .16), transparent 55%),
    radial-gradient(100% 80% at 10% 100%, rgba(46, 58, 44, .10), transparent 55%),
    var(--cream);
  border-bottom: 1px solid var(--line);
}
.lookup-hero-inner { padding-top: 44px; padding-bottom: 36px; }
.lookup-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--leaf); margin: 0 0 14px;
}
.lookup-crumb a { color: var(--leaf); text-decoration: none; }
.lookup-crumb a:hover { color: var(--rust); }
.lookup-eyebrow {
  margin: 0 0 10px; font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; color: var(--success);
}
.lookup-hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1;
  letter-spacing: -.02em; margin: 0 0 12px; color: var(--ink);
}
.lookup-lead { margin: 0; max-width: 62ch; color: var(--muted); font-size: 1.02rem; }

/* ---------------------------------------------------------------- Grid */
.lookup-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px; padding-top: 36px; padding-bottom: 64px; align-items: start;
}
.lookup-main { display: grid; gap: 24px; min-width: 0; }
.lookup-side { display: grid; gap: 24px; min-width: 0; }

.lookup-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-panel); box-shadow: var(--shadow-soft);
  padding: 28px;
}
.lookup-card-title {
  font-family: var(--serif); font-weight: 700; font-size: 1.35rem;
  margin: 0 0 18px; color: var(--ink); letter-spacing: -.01em;
}

/* ------------------------------------------------------------ Form */
.float-field { position: relative; margin-bottom: 6px; }
.float-field input {
  width: 100%; min-height: 52px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; padding: 22px 14px 6px;
  font: inherit; color: var(--ink); transition: border-color .2s ease, box-shadow .2s ease;
}
.float-field label {
  position: absolute; left: 14px; top: 16px; color: var(--muted);
  font-size: .95rem; pointer-events: none;
  transition: transform .2s ease, font-size .2s ease, color .2s ease;
}
.float-field input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgba(184, 135, 91, .22); }
.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label {
  transform: translateY(-12px); font-size: .72rem; font-weight: 600;
  letter-spacing: .04em; color: var(--rust);
}
.field-hint { font-size: .82rem; color: var(--muted); margin: 8px 0 14px; }
.form-error {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(141, 68, 53, .08); border: 1px solid rgba(141, 68, 53, .35);
  color: var(--danger); border-radius: 12px; padding: 12px 14px;
  font-size: .9rem; font-weight: 600; margin: 0 0 16px;
}
.form-error[hidden] { display: none; }
.form-error::before { content: '⚠'; flex-shrink: 0; }
.lookup-submit {
  width: 100%; min-height: 52px; border: 0; border-radius: 999px;
  background: var(--forest); color: var(--paper);
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .25s var(--ease-spring), box-shadow .25s ease, background .2s ease;
}
.lookup-submit:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); background: #3d4c39; }
.lookup-submit:active { transform: translateY(1px); }
.lookup-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.lookup-submit.is-loading::before {
  content: ''; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(251, 249, 244, .4); border-top-color: var(--paper);
  animation: lookup-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes lookup-spin { to { transform: rotate(360deg); } }
.lookup-status { min-height: 26px; margin: 14px 0 0; font-size: .9rem; color: var(--muted); }
.lookup-status.is-error { color: var(--danger); font-weight: 600; }
.lookup-status.is-success { color: var(--success); font-weight: 600; }
.lookup-help { margin: 12px 0 0; font-size: .9rem; color: var(--muted); }
.lookup-help a { color: var(--rust); font-weight: 600; }

/* ---------------------------------------------------------- Result */
.lookup-result[hidden] { display: none; }
.result-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 12px 16px; margin-bottom: 6px;
}
.result-code {
  font-family: var(--serif); font-weight: 700; font-size: 1.4rem;
  margin: 0; word-break: break-all; color: var(--ink);
}
.result-code small { display: block; font-family: var(--sans); font-weight: 600; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--leaf); margin-bottom: 4px; }
.result-meta { margin: 0 0 4px; font-size: .85rem; color: var(--muted); }
.result-head .copy-btn { flex-shrink: 0; }
.copy-btn {
  border: 1px solid var(--line); background: #fff; color: var(--forest);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: border-color .2s ease, transform .2s var(--ease-spring);
}
.copy-btn:hover { border-color: var(--clay); transform: translateY(-1px); }
.eta-line { margin: 10px 0 0; font-weight: 700; color: var(--rust); font-size: .95rem; }
.result-shipping {
  margin: 14px 0 0; padding: 12px 14px; background: rgba(46, 58, 44, .05);
  border: 1px solid var(--line); border-radius: 12px; font-size: .9rem;
  display: grid; gap: 6px;
}
.result-shipping dt { font-weight: 700; color: var(--forest); font-size: .8rem; }
.result-shipping dd { margin: 0; color: var(--ink); word-break: break-word; }
.result-timeline { margin: 20px 0 6px; }
/* Tien trinh line fill khi load (chi transform/opacity). */
.result-timeline .sm-timeline-step { animation: lookup-step-in .45s var(--ease-spring) backwards; }
.result-timeline .sm-timeline-step:nth-child(2) { animation-delay: .12s; }
.result-timeline .sm-timeline-step:nth-child(3) { animation-delay: .24s; }
.result-timeline .sm-timeline-step:nth-child(4) { animation-delay: .36s; }
@keyframes lookup-step-in { from { opacity: 0; transform: translateY(10px); } }
.result-items { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.result-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fff;
}
.result-thumb {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cream), var(--sand));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; color: var(--rust); font-size: 1rem;
  overflow: hidden;
}
.result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-item-name { margin: 0; font-weight: 700; font-size: .92rem; color: var(--ink); }
.result-item-sub { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.result-item-right { text-align: right; display: grid; gap: 2px; }
.result-item-qty { font-size: .8rem; color: var(--muted); }
.result-item-price { font-weight: 700; font-size: .9rem; color: var(--forest); }
.result-totals {
  margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line);
  display: grid; gap: 8px; font-size: .92rem;
}
.result-totals .row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.result-totals .row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.result-totals .grand { font-size: 1.05rem; font-weight: 800; color: var(--rust); }
.result-totals .grand strong { color: var(--rust); }
.result-note { margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn-outline, .btn-solid {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 22px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: .92rem; text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease-spring), box-shadow .25s ease;
}
.btn-outline { border: 1px solid var(--forest); background: transparent; color: var(--forest); }
.btn-outline:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn-solid { border: 0; background: var(--forest); color: var(--paper); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); background: #3d4c39; }

/* Not found than thien */
.notfound { text-align: left; }
.notfound-visual {
  width: 110px; height: 110px; border-radius: 28px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--cream), var(--sand));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 2.4rem; font-weight: 700; color: var(--clay);
  box-shadow: inset 0 0 0 1px var(--line);
}
.notfound h2 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 8px; }
.notfound p { margin: 0 0 10px; color: var(--muted); }
.notfound-check { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.notfound-check li { display: flex; gap: 8px; align-items: flex-start; }
.notfound-check li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* -------------------------------------------------- Journey panel */
.journey-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.journey-steps li { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; }
.journey-icon {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  background: rgba(46, 58, 44, .07); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.journey-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--forest); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.journey-name { margin: 0; font-weight: 700; font-size: .95rem; color: var(--ink); }
.journey-desc { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.journey-visual {
  margin: 20px 0 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: linear-gradient(135deg, var(--cream), var(--sand));
  position: relative; min-height: 120px;
}
.journey-visual img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.journey-visual figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px;
  font-size: .82rem; color: #fff;
  background: linear-gradient(transparent, rgba(28, 36, 28, .75));
}
.journey-visual.is-fallback::before {
  content: 'SM'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 3rem; font-weight: 700; color: rgba(126, 82, 51, .28);
}
.journey-visual.is-fallback figcaption { position: static; background: none; color: var(--muted); padding: 10px 14px 14px; }

/* ------------------------------------------------------------- FAQ */
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.faq-item:last-child { margin-bottom: 0; }
.faq-item summary {
  cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: .92rem; color: var(--forest);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  color: var(--rust); font-size: 1.05rem; line-height: 1;
  transition: transform .25s var(--ease-spring);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0; padding: 0 16px 14px; font-size: .88rem; color: var(--muted); }

/* --------------------------------------------------------- Support */
.support-desc { margin: 0 0 14px; font-size: .9rem; color: var(--muted); }
.lookup-support-link { font-weight: 700; color: var(--rust); font-size: .92rem; }
.lookup-support-link:hover { color: var(--forest); }

/* ------------------------------------------------------ Responsive */
@media (max-width: 1050px) {
  .lookup-grid { gap: 24px; }
  .lookup-card { padding: 24px; }
}
@media (max-width: 700px) {
  .lookup-grid { grid-template-columns: 1fr; padding-top: 24px; padding-bottom: 48px; }
  .lookup-hero-inner { padding-top: 32px; padding-bottom: 28px; }
  .result-item { grid-template-columns: 48px 1fr; }
  .result-item-right { grid-column: 2; text-align: left; grid-auto-flow: column; justify-content: start; gap: 12px; align-items: baseline; }
  .result-thumb { width: 48px; height: 48px; }
  .result-actions .btn-outline, .result-actions .btn-solid { flex: 1 1 100%; }
}
@media (max-width: 390px) {
  .lookup-card { padding: 20px 16px; }
  .lookup-hero h1 { font-size: 2rem; }
}

/* -------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lookup-submit.is-loading::before { animation: none; }
  .result-timeline .sm-timeline-step { animation: none; }
  .lookup-submit, .copy-btn, .btn-outline, .btn-solid { transition: none; }
  .lookup-submit:hover, .copy-btn:hover, .btn-outline:hover, .btn-solid:hover { transform: none; }
  .float-field input, .float-field label { transition: none; }
}
