:root {
  --cream: #fff5de;
  --paper: #fffaf0;
  --ink: #331b11;
  --muted: #846454;
  --red: #d84322;
  --red-dark: #a82d18;
  --amber: #ffb229;
  --green: #2f8a52;
  --mint: #dff2cc;
  --line: rgba(110, 61, 34, 0.18);
  --display: "Yeseva One", Georgia, serif;
  --body: "Rubik", Arial, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 178, 41, 0.32), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(47, 138, 82, 0.18), transparent 26%),
    linear-gradient(180deg, #fff7e6, #ffe5b4 52%, #fff1d1);
  color: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
  animation: pageEnter 360ms cubic-bezier(0.2, 0.9, 0.22, 1) both;
}

body.is-page-leaving {
  pointer-events: none;
  animation: pageLeave 180ms ease both;
}

body.is-embedded {
  background: transparent;
  animation: none;
}

body.is-embedded .orders-topbar {
  display: none;
}

body.is-embedded .orders-shell {
  width: min(1180px, calc(100% - 28px));
  padding: 24px 0 64px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

[hidden] {
  display: none !important;
}

.orders-topbar {
  position: fixed;
  top: 14px;
  left: clamp(12px, 3vw, 36px);
  right: clamp(12px, 3vw, 36px);
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.84);
  padding: 12px;
  box-shadow: 0 14px 34px rgba(95, 42, 16, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand > span:first-child {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--red), var(--amber));
  color: #fff8e8;
  font-family: var(--display);
  font-size: 25px;
  box-shadow: inset 0 -8px 18px rgba(102, 30, 10, 0.22);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  font-weight: 800;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.top-nav {
  display: flex;
  gap: 8px;
  border-radius: 18px;
  background: rgba(255, 238, 200, 0.72);
  padding: 6px;
}

.top-nav a {
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
}

.top-nav a:hover {
  background: #fffaf0;
}

.top-actions {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 10px;
}

.chip-button,
.cart-button,
.mini-button {
  border: 0;
  cursor: pointer;
  background: var(--ink);
  color: #fff5de;
}

.chip-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 800;
}

.mini-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 14px;
  background: #fff7e6;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.user-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #fff5de;
  border-radius: 999px;
  box-shadow: 0 10px 0 -5px #fff5de;
}

.cart-button {
  position: relative;
  min-width: 54px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  background: var(--red);
  font-weight: 900;
}

.cart-glyph {
  position: relative;
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 3px 3px 7px 7px;
}

.cart-glyph::before {
  position: absolute;
  left: 2px;
  top: -8px;
  width: 10px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  content: "";
}

.orders-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(132px, 14vw, 164px) 0 64px;
}

.orders-hero {
  max-width: 820px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.04;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(58px, 9vw, 112px);
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 54px);
}

.orders-hero p:not(.eyebrow),
.access-card p:not(.eyebrow),
.order-meta,
.order-items,
.empty-state {
  color: var(--muted);
  line-height: 1.65;
}

.access-card,
.summary-grid article,
.filter-strip,
.order-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 16px 40px rgba(95, 42, 16, 0.1);
}

.summary-grid span,
.order-number,
.status-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.access-card {
  max-width: 600px;
  padding: 34px;
}

.action-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green), #174f31);
  color: #fffaf0;
  padding: 0 18px;
  font-weight: 900;
}

.orders-content {
  display: grid;
  gap: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.summary-grid article {
  padding: 22px;
}

.summary-grid strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: clamp(26px, 4vw, 42px);
}

.last-status-pill {
  width: max-content;
  border-radius: 999px;
  padding: 10px 13px;
  font-family: var(--body) !important;
  font-size: 13px !important;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.last-status-pill.status-new {
  background: #ffcf69;
  color: #6a3a00;
}

.last-status-pill.status-cooking {
  background: var(--red);
  color: #fff5de;
}

.last-status-pill.status-done {
  background: var(--green);
  color: #fffaf0;
}

.last-status-pill.status-picked {
  background: var(--ink);
  color: #fff5de;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.filter-button {
  position: relative;
  overflow: hidden;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: #fffaf0;
  cursor: pointer;
  padding: 0 14px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
  transition:
    color 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.filter-button::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--ink), #5b2418);
  opacity: 0;
  transform: translateX(-55%) scaleX(0.35);
  transform-origin: left center;
  transition:
    opacity 220ms ease,
    transform 340ms cubic-bezier(0.2, 0.9, 0.2, 1);
  content: "";
}

.filter-button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(110, 61, 34, 0.24), 0 10px 22px rgba(95, 42, 16, 0.1);
}

.filter-button span {
  position: relative;
  z-index: 1;
}

.filter-button.active {
  background: #fffaf0;
  color: #fff5de;
  box-shadow: 0 14px 24px rgba(51, 27, 17, 0.15);
  animation: filterPress 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.filter-button.active::before {
  opacity: 1;
  transform: translateX(0) scaleX(1);
}

.orders-list {
  display: grid;
  gap: 16px;
}

.orders-list.filter-flip .order-card,
.orders-list.filter-flip .empty-state {
  animation: orderFlipIn 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.order-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 0;
  overflow: hidden;
  padding: 22px;
}

.order-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
  background: var(--status-color, var(--amber));
  content: "";
}

.status-ribbon {
  position: absolute;
  top: 22px;
  right: -44px;
  width: 148px;
  padding: 7px 0;
  background: var(--status-color, var(--amber));
  color: var(--status-ink, var(--ink));
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(38deg);
  box-shadow: 0 10px 22px rgba(51, 27, 17, 0.16);
}

.order-open-cell {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  min-width: 116px;
}

.order-open-cell .order-number {
  max-width: 116px;
  border-radius: 16px;
  background: #fff7e6;
  color: var(--ink);
  padding: 10px 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1.15;
  font-family: var(--mono);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px var(--line);
}

.order-toggle {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  align-self: center;
  border: 0;
  border-radius: 999px;
  background: var(--status-color, var(--ink));
  color: var(--status-ink, #fff5de);
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(51, 27, 17, 0.18);
  transition: transform 220ms ease, background 220ms ease;
}

.order-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translate(-62%, -50%) rotate(-45deg);
  transition: transform 240ms ease;
}

.order-toggle:hover {
  transform: translateY(-2px);
  background: var(--status-color, var(--green));
}

.order-card.open .order-toggle {
  background: var(--status-color, var(--green));
}

.order-card.open .order-toggle span {
  transform: translate(-50%, -66%) rotate(45deg);
}

.order-summary {
  min-width: 0;
  display: grid;
  align-items: stretch;
}

.order-main {
  min-width: 0;
  display: grid;
}

.order-price-box {
  min-height: 92px;
  border-radius: 18px;
  background: #fff7e6;
  padding: 14px 24px;
  display: grid;
  align-content: center;
  gap: 5px;
  width: 100%;
}

.order-price-box span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-price-box strong {
  display: block;
  font-family: var(--mono);
  font-size: clamp(24px, 3vw, 36px);
}

.order-price-box span:last-child {
  color: var(--muted);
  font-weight: 800;
}

.order-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows 320ms ease,
    opacity 220ms ease,
    margin-top 320ms ease;
}

.order-card.open .order-details {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 18px;
}

.order-details-inner {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.38fr);
  align-items: stretch;
  gap: 20px;
  overflow: hidden;
}

.order-card.open .order-details-inner {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.items-panel {
  position: relative;
  height: 100%;
  border-radius: 20px;
  background: #fff7e6;
  padding: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.items-title {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 9px;
  margin-bottom: 14px;
}

.items-title span {
  color: var(--ink);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.items-title strong {
  color: var(--red-dark);
  font-family: var(--mono);
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1;
}

.order-meta {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  border-radius: 18px;
  background: #fff7e6;
  padding: 16px;
}

.order-items {
  display: grid;
  gap: 8px;
  max-height: 204px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.order-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 14px;
  background: #ffe9b6;
  color: #5a2c18;
  padding: 11px 12px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(216, 67, 34, 0.08);
}

.order-items li strong {
  flex: 0 0 auto;
  color: var(--red-dark);
  font-family: var(--mono);
  font-weight: 900;
}

.order-side-stack {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.order-side {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: stretch;
  gap: 14px;
  border-radius: 20px;
  background: #fffaf0;
  padding: 18px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.order-side strong {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 28px;
}

.phone-box {
  border-radius: 16px;
  background: #fff7e6;
  padding: 18px 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.phone-box strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.15;
}

.status-box {
  align-self: start;
}

.progress {
  display: grid;
  align-self: end;
  gap: 8px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(51, 27, 17, 0.12);
  overflow: hidden;
}

.progress-track i {
  display: block;
  width: var(--progress, 25%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--red), var(--green), var(--ink));
}

.order-card.status-new {
  --status-color: #ffcf69;
  --status-ink: #6a3a00;
  --progress: 25%;
}

.order-card.status-cooking {
  --status-color: var(--red);
  --status-ink: #fff5de;
  --progress: 50%;
}

.order-card.status-done {
  --status-color: var(--green);
  --status-ink: #fffaf0;
  --progress: 78%;
}

.order-card.status-picked {
  --status-color: var(--ink);
  --status-ink: #fff5de;
  --progress: 100%;
}

.empty-state {
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.9);
  padding: 30px;
  text-align: center;
}

@keyframes filterPress {
  0% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-2px) scale(1.035);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes orderFlipIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageLeave {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: 86px;
  }

  .orders-hero,
  .order-summary,
  .order-details-inner {
    grid-template-columns: 1fr;
  }

  .orders-topbar {
    grid-template-columns: 1fr auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .top-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 22px;
    background: rgba(255, 250, 240, 0.94);
    box-shadow: 0 18px 44px rgba(51, 27, 17, 0.2);
  }

  .top-nav a {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 0 8px;
    font-size: 12px;
  }

  .filter-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .order-card {
    grid-template-columns: 1fr;
  }

  .order-open-cell {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .orders-shell {
    width: min(100% - 20px, 1180px);
  }

  .orders-topbar {
    left: 10px;
    right: 10px;
    top: 10px;
    grid-template-columns: 1fr auto;
    border-radius: 20px;
  }

  .brand small,
  .chip-button span:last-child {
    display: none;
  }

  .chip-button {
    width: 46px;
    padding: 0;
    justify-content: center;
  }

  .admin-panel-link {
    width: 46px;
    min-width: 46px;
    padding: 0;
    font-size: 0;
  }

  .admin-panel-link::before {
    content: "A";
    font-family: var(--mono);
    font-size: 15px;
  }

  .order-card {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 12px;
    padding: 18px 14px;
  }

  .order-open-cell {
    min-width: 66px;
    justify-items: center;
    gap: 8px;
  }

  .order-toggle {
    width: 44px;
    height: 44px;
  }

  .order-summary {
    grid-template-columns: 1fr;
  }

  .order-price-box {
    min-height: 86px;
    padding: 13px 14px;
  }

  .order-price-box strong {
    font-size: clamp(24px, 8vw, 34px);
  }

  .order-open-cell .order-number {
    max-width: none;
    font-size: 12px;
  }
}
