:root {
  --bg: #FFF9F5;
  --text: #1F1A17;
  --muted: #6B5E56;
  --line: #EADFD6;
  --card: #ffffff;
  --brand: #E4572E;
  --brand-2: #F4A261;
  --ok: #2F9E44;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font: 16px/1.45 var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 480px at 8% -12%, #FFE0C8 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #FFD2B8 0%, transparent 48%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.order-page {
  width: min(560px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom, 0px));
}

.order-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.order-top__back,
.order-top__spacer {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 20px;
}

.order-top__spacer {
  border: 0;
  background: transparent;
}

.order-top__title {
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.order-hero {
  margin: 10px 0 12px;
  padding: 22px 20px 20px;
  border-radius: 28px;
  color: #fffaf6;
  background: linear-gradient(135deg, #E4572E 0%, #F07146 55%, #F4A261 100%);
  position: relative;
  overflow: hidden;
}

.order-hero::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 214, 165, 0.28);
}

.order-hero__badge,
.order-hero__title,
.order-hero__sub {
  position: relative;
  z-index: 1;
}

.order-hero__badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.order-hero__title {
  margin: 10px 0 6px;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.order-hero__sub {
  margin: 0;
  opacity: 0.92;
  font-size: 14px;
  max-width: 36ch;
}

.order-eta {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 250, 246, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-eta[hidden] {
  display: none !important;
}

.order-eta__label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

.order-eta__value {
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Прогресс как Uber/Яндекс: белая карточка + точки на линии */
.order-status-card {
  margin: 0 0 14px;
  padding: 18px 14px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.order-progress {
  display: grid;
  gap: 12px;
}

.order-progress__rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.order-progress__rail::before {
  content: "";
  position: absolute;
  left: 16.66%;
  right: 16.66%;
  top: 9px;
  height: 3px;
  border-radius: 999px;
  background: #E8DFD7;
  z-index: 0;
}

.order-progress__rail-fill {
  position: absolute;
  left: 16.66%;
  top: 9px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
  z-index: 1;
  width: 0;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.order-progress__item {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.order-progress__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #D9CFC6;
  box-sizing: border-box;
}

.order-progress__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #A89990;
  line-height: 1.2;
  max-width: 11ch;
}

.order-progress__item.is-done .order-progress__dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 3px #fff;
}

.order-progress__item.is-current .order-progress__dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 5px rgba(228, 87, 46, 0.16);
}

.order-progress__item.is-done .order-progress__label,
.order-progress__item.is-current .order-progress__label {
  color: var(--text);
}

.order-progress__item.is-current .order-progress__label {
  color: var(--brand);
  font-weight: 800;
}

.order-progress.is-cancelled .order-progress__rail-fill {
  background: #D94841;
  width: 0 !important;
}

.order-progress.is-cancelled .order-progress__item.is-current .order-progress__dot {
  background: #D94841;
  border-color: #D94841;
  box-shadow: 0 0 0 5px rgba(217, 72, 65, 0.14);
}

.order-progress.is-cancelled .order-progress__item.is-current .order-progress__label {
  color: #D94841;
}

.order-map {
  margin: 0 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.order-map[hidden] {
  display: none !important;
}

.order-map__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 14px 16px 10px;
}

.order-map__head strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.order-map__head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.order-map__canvas {
  height: min(42vh, 320px);
  width: 100%;
  background: #efe7e0;
}

.order-details {
  margin: 0 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.order-details__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-details__summary::-webkit-details-marker { display: none; }

.order-details__summary::after {
  content: "▾";
  color: var(--muted);
  font-weight: 700;
}

.order-details[open] .order-details__summary::after {
  content: "▴";
}

.order-details .order-card {
  border: 0;
  border-radius: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.order-map__canvas .leaflet-container {
  width: 100%;
  height: 100%;
  font: inherit;
}

.order-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 6px 16px;
  margin-bottom: 14px;
}

.order-card__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.order-card__row:last-child { border-bottom: 0; }
.order-card__row span { color: var(--muted); }
.order-card__row strong {
  text-align: right;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.order-card__row--block {
  display: grid;
  gap: 4px;
}

.order-card__row--block strong {
  text-align: left;
  font-weight: 600;
  white-space: pre-wrap;
}

.order-note {
  margin: 0 2px 18px;
  color: var(--muted);
  font-size: 13px;
}

.order-actions {
  display: grid;
  gap: 10px;
}

.order-btn {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-radius: 16px;
  border: 0;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.order-btn--primary {
  background: var(--brand);
  color: #fffaf6;
}

.order-btn--ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.order-btn:active { transform: scale(0.98); }

@media (prefers-reduced-motion: reduce) {
  .order-step.is-current .order-step__dot { animation: none; }
}
