/**
 * Appily Fortysix — Orders Pulse (new layout)
 * Centered hero · status legend bar · order card grid · orbit links
 */

@keyframes ord-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -10px) scale(1.04); }
}
@keyframes ord-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(174, 213, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(174, 213, 129, 0); }
}
@keyframes ord-card-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes ord-ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes ord-load-spin {
  to { transform: rotate(360deg); }
}

.page-orders-pulse {
  --ord-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ord-display: 'Syne', var(--font-display), Georgia, serif;
  --ord-lime: #AED581;
  --ord-shadow: 0 20px 50px rgba(38, 50, 56, 0.1);
  --ord-shadow-sm: 0 8px 24px rgba(38, 50, 56, 0.07);
  background: #eef2ef;
}
.page-orders-pulse .page-main { padding-top: 0; }
.ord-pulse { padding-bottom: 3rem; }

.ord-pulse-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ord-ease), transform 0.65s var(--ord-ease);
}
.ord-pulse-reveal.is-visible { opacity: 1; transform: none; }

/* ── Hero ── */
.ord-pulse-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(1.75rem, 3vw, 2.5rem);
  color: #fff;
  text-align: center;
}
.ord-pulse-hero-bg {
  position: absolute;
  inset: 0;
  background: #0f1f14;
  pointer-events: none;
  overflow: hidden;
}
.ord-pulse-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 22%, rgba(174, 213, 129, 0.28), transparent 42%),
    radial-gradient(circle at 80% 78%, rgba(255, 112, 67, 0.2), transparent 40%),
    linear-gradient(155deg, #1b3a1f, #0f1f14 55%, #152820);
}
.ord-pulse-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  animation: ord-blob 12s ease-in-out infinite;
}
.ord-pulse-blob--1 { width: 260px; height: 260px; top: -40px; right: 10%; background: rgba(255, 111, 0, 0.3); }
.ord-pulse-blob--2 { width: 200px; height: 200px; bottom: -20px; left: 6%; background: rgba(174, 213, 129, 0.28); animation-delay: -4s; }
.ord-pulse-blob--3 { width: 140px; height: 140px; top: 42%; left: 48%; background: rgba(38, 166, 154, 0.22); animation-delay: -7s; }

.ord-pulse-hero-inner { position: relative; z-index: 1; max-width: 620px; margin-inline: auto; }
.ord-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ord-pulse-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ord-lime); animation: ord-pulse-dot 2.5s ease-out infinite; }
.ord-pulse-kicker { margin: 0 0 0.5rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.ord-pulse-hero h1 { margin: 0 0 0.65rem; font-family: var(--ord-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.ord-pulse-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--ord-lime), var(--fg-yellow)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ord-pulse-lede { margin: 0 auto 1.25rem; max-width: 52ch; font-size: 0.92rem; line-height: 1.6; color: rgba(255,255,255,0.72); }

.ord-pulse-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ord-pulse-stats li {
  padding: 0.55rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}
.ord-pulse-stats strong { display: block; font-family: var(--ord-display); font-size: 1.15rem; line-height: 1.1; }
.ord-pulse-stats span { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.65; }

/* Loading */
.ord-pulse-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--ord-shadow-sm);
  font-size: 0.88rem;
  color: var(--fg-muted);
}
.ord-pulse-loading-ring {
  width: 22px; height: 22px;
  border: 2px solid rgba(85, 139, 47, 0.2);
  border-top-color: var(--fg-green);
  border-radius: 50%;
  animation: ord-load-spin 0.8s linear infinite;
}

/* Buttons */
.ord-pulse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  border: 0;
  transition: filter 0.2s, transform 0.2s, border-color 0.2s, background 0.2s;
}
.ord-pulse-btn--sm { padding: 0.5rem 0.95rem; font-size: 0.78rem; }
.ord-pulse-btn--primary {
  background: linear-gradient(120deg, var(--fg-green), var(--fg-green-dark));
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(51, 105, 30, 0.28);
}
.ord-pulse-btn--primary:hover { filter: brightness(1.08); transform: translateY(-2px); }
.ord-pulse-btn--ghost {
  background: transparent;
  border: 1px solid var(--fg-border);
  color: var(--fg-ink) !important;
}
.ord-pulse-btn--ghost:hover { border-color: var(--fg-orange); color: var(--fg-orange) !important; }
.ord-pulse-track { font-size: 0.82rem !important; white-space: nowrap; }

/* Guest gate */
.ord-pulse-gate {
  text-align: center;
  padding: clamp(2rem, 4vw, 3rem) 1.5rem;
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--ord-shadow);
  border: 1px solid rgba(38, 50, 56, 0.06);
  max-width: 520px;
  margin-inline: auto;
}
.ord-pulse-gate-icon { display: block; font-size: 2.5rem; margin-bottom: 0.75rem; line-height: 1; }
.ord-pulse-gate-badge { display: inline-block; margin-bottom: 0.5rem; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-orange); }
.ord-pulse-gate h2 { margin: 0 0 0.45rem; font-family: var(--ord-display); font-size: 1.45rem; font-weight: 700; color: var(--fg-ink); }
.ord-pulse-gate p { margin: 0 0 1.25rem; font-size: 0.9rem; color: var(--fg-muted); line-height: 1.55; }
.ord-pulse-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem; }

/* Main area */
.ord-pulse-main { display: grid; gap: 1.25rem; }

.ord-pulse-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(38, 50, 56, 0.06);
  box-shadow: var(--ord-shadow-sm);
}
.ord-pulse-legend-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ord-pulse-legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.ord-pulse-legend-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-ink);
}
.ord-pulse-legend-list .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ord-pulse-legend-list .tone-placed { background: var(--fg-orange); }
.ord-pulse-legend-list .tone-packed { background: var(--fg-green); }
.ord-pulse-legend-list .tone-shipped { background: var(--fg-yellow-dark); }
.ord-pulse-legend-list .tone-delivered { background: #059669; }

/* Order grid */
.ord-pulse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.ord-pulse-grid:empty { display: none; }

.ord-pulse-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  border: 1px solid rgba(38, 50, 56, 0.06);
  box-shadow: var(--ord-shadow-sm);
  padding: 1.15rem 1.25rem 1.1rem;
  overflow: hidden;
  transition: transform 0.35s var(--ord-ease), box-shadow 0.35s;
  animation: ord-card-in 0.55s var(--ord-ease) both;
  animation-delay: calc(var(--ord-i, 0) * 0.06s);
}
.ord-pulse-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--ord-shadow);
}

.ord-pulse-progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(38, 50, 56, 0.06);
}
.ord-pulse-progress-fill {
  display: block;
  height: 100%;
  width: calc(var(--ord-progress, 25) * 1%);
  border-radius: 0 2px 2px 0;
  transition: width 0.8s var(--ord-ease);
}
.ord-pulse-card.tone-placed .ord-pulse-progress-fill { background: linear-gradient(90deg, var(--fg-orange), #ffb74d); }
.ord-pulse-card.tone-packed .ord-pulse-progress-fill { background: linear-gradient(90deg, var(--fg-green), var(--ord-lime)); }
.ord-pulse-card.tone-shipped .ord-pulse-progress-fill { background: linear-gradient(90deg, var(--fg-yellow-dark), var(--fg-yellow)); }
.ord-pulse-card.tone-delivered .ord-pulse-progress-fill { background: linear-gradient(90deg, #059669, #34d399); }
.ord-pulse-card.tone-cancelled .ord-pulse-progress-fill { background: linear-gradient(90deg, #c62828, #ef5350); width: 100% !important; opacity: 0.5; }

.ord-pulse-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding-top: 0.35rem;
}
.ord-pulse-date strong {
  display: block;
  font-family: var(--ord-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: var(--fg-ink);
}
.ord-pulse-date span { font-size: 0.72rem; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.ord-pulse-status {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ord-pulse-card.tone-placed .ord-pulse-status { background: rgba(255, 111, 0, 0.12); color: var(--fg-orange); }
.ord-pulse-card.tone-packed .ord-pulse-status { background: rgba(85, 139, 47, 0.12); color: var(--fg-green-dark); }
.ord-pulse-card.tone-shipped .ord-pulse-status { background: rgba(249, 168, 37, 0.15); color: #9a6b00; }
.ord-pulse-card.tone-delivered .ord-pulse-status { background: rgba(5, 150, 105, 0.12); color: #047857; }
.ord-pulse-card.tone-cancelled .ord-pulse-status { background: rgba(198, 40, 40, 0.1); color: #c62828; }

.ord-pulse-id {
  margin: 0 0 0.75rem;
  font-family: var(--ord-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg-ink);
  word-break: break-all;
  line-height: 1.35;
}

.ord-pulse-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
}
.ord-pulse-meta > div {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: #f8fbf8;
}
.ord-pulse-meta dt {
  margin: 0 0 0.15rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ord-pulse-meta dd { margin: 0; font-size: 0.88rem; font-weight: 700; color: var(--fg-ink); }

.ord-pulse-items {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--fg-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ord-pulse-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--fg-border);
}
.ord-pulse-foot time { font-size: 0.72rem; color: var(--fg-muted); font-weight: 600; }

/* Empty */
.ord-pulse-empty {
  text-align: center;
  padding: clamp(2.5rem, 5vw, 3.5rem) 1.5rem;
  background: #fff;
  border-radius: 28px;
  border: 1px solid rgba(38, 50, 56, 0.06);
  box-shadow: var(--ord-shadow);
}
.ord-pulse-empty-scene {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.25rem;
}
.ord-pulse-empty-box {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.75rem;
  z-index: 2;
}
.ord-pulse-empty-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 100px; height: 100px;
  border: 2px dashed rgba(85, 139, 47, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ord-ring-spin 16s linear infinite;
}
.ord-pulse-empty h2 { margin: 0 0 0.45rem; font-family: var(--ord-display); font-size: 1.45rem; font-weight: 700; }
.ord-pulse-empty p { margin: 0 0 1.25rem; font-size: 0.9rem; color: var(--fg-muted); line-height: 1.55; max-width: 44ch; margin-inline: auto; }

/* Orbit */
.ord-pulse-orbit {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}
.ord-pulse-orbit-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 88px;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid rgba(38, 50, 56, 0.08);
  border-radius: 18px;
  text-decoration: none !important;
  color: var(--fg-ink);
  box-shadow: var(--ord-shadow-sm);
  transition: transform 0.3s var(--ord-ease), box-shadow 0.3s;
}
.ord-pulse-orbit-item:hover { transform: translateY(-4px); box-shadow: var(--ord-shadow); }
.ord-pulse-orbit-item--accent {
  background: linear-gradient(145deg, var(--fg-green-dark), var(--fg-green));
  color: #fff;
  border-color: transparent;
}
.ord-pulse-orbit-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 1.2rem;
  background: rgba(174, 213, 129, 0.2);
  border: 2px solid var(--fg-green);
}
.ord-pulse-orbit-item--accent .ord-pulse-orbit-icon { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.35); }
.ord-pulse-orbit-label { font-size: 0.76rem; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .ord-pulse-grid { grid-template-columns: 1fr; }
  .ord-pulse-legend { flex-direction: column; align-items: stretch; }
  .ord-pulse-legend .ord-pulse-btn { width: 100%; }
}

@media (max-width: 640px) {
  .ord-pulse-foot { flex-direction: column; align-items: stretch; }
  .ord-pulse-foot .ord-pulse-btn { width: 100%; text-align: center; }
  .ord-pulse-meta { grid-template-columns: 1fr; }
  .ord-pulse-orbit { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .ord-pulse-orbit::-webkit-scrollbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ord-pulse-reveal, .ord-pulse-card { animation: none !important; opacity: 1; transform: none; transition: none; }
  .ord-pulse-blob, .ord-pulse-badge-dot, .ord-pulse-empty-ring, .ord-pulse-loading-ring { animation: none !important; }
  .ord-pulse-card:hover { transform: none; }
}
