/**
 * ambe traders — Route Registry (orders)
 * Unique layout: dark split hero + horizontal stage filters
 * + manifest ticket cards + guest glass gate
 */

.page-orders-route {
  --rt-ink: #0E1F18;
  --rt-forest: #0B3D2E;
  --rt-deep: #041912;
  --rt-mid: #1A5C45;
  --rt-lime: #C8E86C;
  --rt-gold: #E8C547;
  --rt-cream: #F7F9F4;
  --rt-paper: #FFFFFF;
  --rt-muted: #5C6F64;
  --rt-line: rgba(11, 61, 46, 0.1);
  --rt-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rt-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--rt-cream);
}

.page-orders-route .page-main {
  padding-top: 0;
  overflow-x: clip;
}

.a51-route { padding-bottom: 3.5rem; }

/* ——— Reveal ——— */
.a51-route-reveal,
.a51-folio-reveal,
.a51-reel-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s var(--rt-ease), transform 0.65s var(--rt-ease);
}

.a51-route-reveal.is-visible,
.a51-folio-reveal.is-visible,
.a51-reel-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ——— Hero ——— */
.a51-route-hero {
  position: relative;
  padding: clamp(2.4rem, 5.5vw, 3.8rem) 0 clamp(2.8rem, 6vw, 4rem);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.a51-route-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(500px 260px at 90% 78%, rgba(200, 232, 108, 0.12), transparent 58%),
    conic-gradient(from 240deg at 15% 20%, rgba(232, 197, 71, 0.2), transparent 42%),
    linear-gradient(132deg, var(--rt-deep) 0%, var(--rt-forest) 55%, #134832 100%);
}

.a51-route-hero-bg::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 72px;
  background: var(--rt-cream);
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 72%);
}

.a51-route-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr auto;
  gap: clamp(1.25rem, 4vw, 2.25rem);
  align-items: end;
}

.a51-route-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(200, 232, 108, 0.92);
}

.a51-route-hero-copy h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 4.8vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.a51-route-hero-copy h1 em {
  font-style: normal;
  color: var(--rt-lime);
}

.a51-route-lede {
  margin: 0;
  max-width: 44ch;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.76);
}

.a51-route-stats {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.a51-route-stat {
  min-width: 92px;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  text-align: center;
}

.a51-route-stat strong {
  display: block;
  font-family: var(--a51-font-display, 'Cormorant Garamond', serif);
  font-size: 1.22rem;
  color: #fff;
  line-height: 1.1;
}

.a51-route-stat span {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.a51-route-stat--accent {
  background: rgba(200, 232, 108, 0.16);
  border-color: rgba(200, 232, 108, 0.35);
}

.a51-route-stat--accent strong {
  color: var(--rt-lime);
}

.a51-route-tag {
  display: inline-flex;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(200, 232, 108, 0.28);
  color: var(--rt-forest);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ——— Console ——— */
.a51-route-console {
  position: relative;
  margin-top: -1.5rem;
  z-index: 2;
}

.a51-route-loading,
.a51-folio-loading,
.a51-reel-loading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  border-radius: 18px;
  background: var(--rt-paper);
  border: 1px solid var(--rt-line);
  color: var(--rt-muted);
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(11, 61, 46, 0.06);
}

.a51-route-loading-bar,
.a51-reel-loading-bar {
  flex: 0 0 48px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rt-lime), var(--rt-gold), var(--rt-lime));
  background-size: 200% 100%;
  animation: a51RtShimmer 1.4s ease-in-out infinite;
}

@keyframes a51RtShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ——— Guest gate ——— */
.a51-route-gate {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 56px rgba(11, 61, 46, 0.1);
  backdrop-filter: blur(16px);
}

.a51-route-gate-visual {
  position: relative;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
}

.a51-route-gate-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(232, 197, 71, 0.45);
  animation: a51RtSpin 16s linear infinite;
}

@keyframes a51RtSpin {
  to { transform: rotate(360deg); }
}

.a51-route-gate-core {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--rt-mid), var(--rt-deep));
  color: var(--rt-gold);
  font-family: var(--a51-font-display, 'Cormorant Garamond', serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  box-shadow: 0 14px 32px rgba(11, 61, 46, 0.25);
}

.a51-route-gate-copy h2 {
  margin: 0.45rem 0 0.5rem;
}

.a51-route-gate-copy p {
  margin: 0 0 1.1rem;
  color: var(--rt-muted);
  max-width: 42ch;
}

.a51-route-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.a51-route-ghost {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: var(--rt-forest);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ——— Board ——— */
.a51-route-board {
  border-radius: 24px;
  background: var(--rt-paper);
  border: 1px solid var(--rt-line);
  box-shadow: 0 24px 56px rgba(11, 61, 46, 0.08);
  overflow: hidden;
  min-height: 320px;
}

.a51-route-board-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  padding: 1.25rem 1.35rem 1rem;
  background:
    linear-gradient(120deg, rgba(200, 232, 108, 0.14), transparent 55%),
    var(--rt-cream);
  border-bottom: 1px solid var(--rt-line);
}

.a51-route-board-head h2 {
  margin: 0.4rem 0 0.25rem;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
}

.a51-route-board-head p {
  margin: 0;
  color: var(--rt-muted);
  font-size: 0.88rem;
}

.a51-route-filter-label {
  margin: 0 !important;
  font-size: 0.82rem !important;
  font-weight: 800;
  color: var(--rt-mid) !important;
}

/* ——— Horizontal filters ——— */
.a51-route-filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--rt-line);
  background: var(--rt-cream);
  overflow-x: auto;
  scrollbar-width: none;
}

.a51-route-filters::-webkit-scrollbar {
  display: none;
}

.a51-route-filter {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--rt-line);
  border-radius: 14px;
  background: var(--rt-paper);
  font: inherit;
  cursor: pointer;
  transition: transform 0.25s var(--rt-snap), border-color 0.2s, background 0.2s, box-shadow 0.25s;
}

.a51-route-filter span {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--rt-ink);
}

.a51-route-filter small {
  font-size: 0.68rem;
  color: var(--rt-muted);
}

.a51-route-filter:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 232, 108, 0.45);
}

.a51-route-filter.is-active {
  background: linear-gradient(135deg, var(--rt-forest), var(--rt-deep));
  border-color: var(--rt-forest);
  box-shadow: 0 10px 24px rgba(11, 61, 46, 0.2);
}

.a51-route-filter.is-active span {
  color: #fff;
}

.a51-route-filter.is-active small {
  color: rgba(255, 255, 255, 0.65);
}

.a51-route-filter.tone-placed.is-active { border-color: var(--rt-mid); }
.a51-route-filter.tone-packed.is-active { background: linear-gradient(135deg, #1a5c45, var(--rt-deep)); }
.a51-route-filter.tone-shipped.is-active { background: linear-gradient(135deg, #134832, var(--rt-deep)); }
.a51-route-filter.tone-delivered.is-active {
  background: linear-gradient(135deg, var(--rt-lime), #a8c84a);
}
.a51-route-filter.tone-delivered.is-active span { color: var(--rt-deep); }
.a51-route-filter.tone-delivered.is-active small { color: rgba(4, 25, 18, 0.65); }

/* ——— Order tickets ——— */
.a51-route-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.a51-route-ticket,
.a51-reel-frame,
.a51-folio-slip {
  display: grid;
  grid-template-columns: 6px auto 88px 1fr auto;
  gap: 0;
  align-items: stretch;
  border-radius: 20px;
  overflow: hidden;
  background: var(--rt-cream);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateX(-14px);
  transition:
    transform 0.28s var(--rt-snap),
    border-color 0.2s,
    box-shadow 0.28s,
    background 0.2s;
}

.a51-route-ticket.is-visible,
.a51-reel-frame.is-visible,
.a51-folio-slip.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.55s var(--rt-ease) calc(var(--route-i, var(--reel-i, var(--folio-i, 0))) * 0.05s),
    transform 0.55s var(--rt-ease) calc(var(--route-i, var(--reel-i, var(--folio-i, 0))) * 0.05s),
    border-color 0.2s,
    box-shadow 0.28s,
    background 0.2s;
}

.a51-route-ticket:hover {
  background: var(--rt-paper);
  border-color: rgba(200, 232, 108, 0.45);
  box-shadow: 0 14px 32px rgba(11, 61, 46, 0.1);
  transform: translateX(4px);
}

.a51-route-ticket.is-filtered-out {
  display: none;
}

.a51-route-ticket-rail {
  background: linear-gradient(180deg, var(--rt-lime), var(--rt-gold));
}

.a51-route-ticket.tone-placed .a51-route-ticket-rail {
  background: linear-gradient(180deg, var(--rt-mid), var(--rt-forest));
}

.a51-route-ticket.tone-packed .a51-route-ticket-rail {
  background: linear-gradient(180deg, #2d7a5e, var(--rt-mid));
}

.a51-route-ticket.tone-shipped .a51-route-ticket-rail {
  background: linear-gradient(180deg, var(--rt-gold), #c9a832);
}

.a51-route-ticket.tone-delivered .a51-route-ticket-rail {
  background: linear-gradient(180deg, var(--rt-lime), #9bc84a);
}

.a51-route-ticket.tone-cancelled .a51-route-ticket-rail {
  background: linear-gradient(180deg, #b85454, #8a1f1f);
}

.a51-route-ticket-num {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--rt-muted);
}

.a51-route-ticket-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.85rem 0.65rem;
  background: var(--rt-forest);
  color: #fff;
  text-align: center;
  min-width: 72px;
}

.a51-route-ticket-date strong {
  font-family: var(--a51-font-display, 'Cormorant Garamond', serif);
  font-size: 1.45rem;
  color: var(--rt-lime);
  line-height: 1;
}

.a51-route-ticket-date span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.a51-route-ticket-date small {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
}

.a51-route-ticket-body {
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.a51-route-ticket-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.a51-route-ticket-stamp {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(200, 232, 108, 0.35);
  color: var(--rt-forest);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.a51-route-ticket.tone-shipped .a51-route-ticket-stamp {
  background: rgba(232, 197, 71, 0.35);
}

.a51-route-ticket.tone-delivered .a51-route-ticket-stamp {
  background: var(--rt-lime);
  color: var(--rt-deep);
}

.a51-route-ticket-id {
  margin: 0;
  font-family: var(--a51-font-sans);
  font-size: 1rem;
  font-weight: 800;
  word-break: break-word;
  flex: 1 1 auto;
}

.a51-route-ticket-meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.a51-route-ticket-meta > div {
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--rt-line);
}

.a51-route-ticket:hover .a51-route-ticket-meta > div {
  background: var(--rt-cream);
}

.a51-route-ticket-meta dt {
  margin: 0 0 0.12rem;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rt-muted);
}

.a51-route-ticket-meta dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--rt-ink);
}

.a51-route-ticket-items {
  margin: 0;
  font-size: 0.84rem;
  color: var(--rt-muted);
  line-height: 1.45;
}

.a51-route-ticket-foot {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-left: 1px dashed var(--rt-line);
  background: rgba(255, 255, 255, 0.5);
}

.a51-route-track {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--rt-forest);
  white-space: nowrap;
  transition: color 0.2s;
}

.a51-route-track:hover {
  color: var(--rt-mid);
}

/* ——— Empty states ——— */
.a51-route-empty {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
  padding: 2rem 1.5rem;
}

.a51-route-empty-visual {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.5rem;
}

.a51-route-empty-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rt-line);
}

.a51-route-empty-dot:nth-child(1) {
  background: var(--rt-mid);
  animation: a51RtPulse 1.8s ease-in-out infinite;
}

.a51-route-empty-dot:nth-child(2) {
  animation: a51RtPulse 1.8s ease-in-out 0.3s infinite;
}

.a51-route-empty-dot:nth-child(3) {
  animation: a51RtPulse 1.8s ease-in-out 0.6s infinite;
}

@keyframes a51RtPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

.a51-route-empty h2 {
  margin: 0.45rem 0 0.45rem;
}

.a51-route-empty p {
  margin: 0 0 1rem;
  color: var(--rt-muted);
}

.a51-route-filter-empty {
  padding: 1.25rem 1.4rem 1.5rem;
  text-align: center;
  color: var(--rt-muted);
}

.a51-route-filter-empty p {
  margin: 0 0 0.75rem;
}

/* ——— Buttons ——— */
.a51-route-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.2rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s var(--rt-snap), box-shadow 0.25s, background 0.2s;
}

.a51-route-btn--primary {
  background: var(--rt-forest);
  color: #fff;
  box-shadow: 0 10px 24px rgba(11, 61, 46, 0.22);
}

.a51-route-btn--primary:hover {
  transform: translateY(-2px);
  background: var(--rt-mid);
}

/* ——— Shortcuts ——— */
.a51-route-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.a51-route-shortcut {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.7rem;
  row-gap: 0.08rem;
  padding: 1rem 1.05rem;
  border-radius: 20px;
  background: var(--rt-paper);
  border: 1px solid var(--rt-line);
  transition: transform 0.28s var(--rt-snap), border-color 0.2s, box-shadow 0.28s;
}

.a51-route-shortcut:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 232, 108, 0.55);
  box-shadow: 0 16px 36px rgba(11, 61, 46, 0.1);
}

.a51-route-shortcut span {
  grid-row: 1 / span 2;
  align-self: center;
  font-weight: 800;
  font-size: 0.72rem;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--rt-forest);
  color: var(--rt-lime);
}

.a51-route-shortcut strong {
  font-size: 0.92rem;
  color: var(--rt-ink);
}

.a51-route-shortcut small {
  font-size: 0.76rem;
  color: var(--rt-muted);
}

/* ——— Responsive ——— */
@media (max-width: 960px) {
  .a51-route-hero-grid,
  .a51-route-gate,
  .a51-route-empty {
    grid-template-columns: 1fr;
  }

  .a51-route-ticket {
    grid-template-columns: 6px 72px 1fr;
    grid-template-rows: auto auto;
  }

  .a51-route-ticket-num {
    display: none;
  }

  .a51-route-ticket-date {
    grid-row: 1 / span 2;
  }

  .a51-route-ticket-foot {
    grid-column: 2 / -1;
    border-left: 0;
    border-top: 1px dashed var(--rt-line);
    justify-content: flex-start;
  }

  .a51-route-ticket-meta {
    grid-template-columns: 1fr 1fr;
  }

  .a51-route-shortcuts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .a51-route-ticket {
    grid-template-columns: 4px 64px 1fr;
  }

  .a51-route-ticket-meta,
  .a51-route-shortcuts {
    grid-template-columns: 1fr;
  }

  .a51-route-gate-visual,
  .a51-route-empty-visual {
    display: none;
  }

  .a51-route-filters {
    padding-bottom: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a51-route-gate-orbit,
  .a51-route-loading-bar,
  .a51-reel-loading-bar,
  .a51-route-empty-dot {
    animation: none !important;
  }

  .a51-route-reveal,
  .a51-folio-reveal,
  .a51-reel-reveal,
  .a51-route-ticket,
  .a51-reel-frame,
  .a51-folio-slip {
    opacity: 1 !important;
    transform: none !important;
  }
}
