@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@700&display=swap");

:root {
  --cream: #fbf3e4;
  --cream-dark: #f0e5cd;
  --charcoal: #2b2118;
  --charcoal-soft: #5c5142;
  --sunflower: #f4a814;
  --sunflower-dark: #d99000;
  --terracotta: #d2542b;
  --leaf: #3f7a4e;
  --sky: #1c5d8c;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 0 rgba(43, 33, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  padding-bottom: 90px; /* room for sticky cart bar */
}

h1,
h2,
h3 {
  font-family: "Baloo 2", -apple-system, sans-serif;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 8px;
}

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Top bar ---------- */

.topbar {
  background: var(--charcoal);
  color: var(--cream);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .brand {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--sunflower);
  letter-spacing: 0.3px;
}

.topbar .back-link {
  font-size: 15px;
  color: var(--cream);
  opacity: 0.85;
}

/* ---------- Signature "painted signboard" heading ---------- */

.signboard {
  display: inline-block;
  position: relative;
  padding: 2px 2px 10px;
  transform: rotate(-0.6deg);
}

.signboard::after {
  content: "";
  position: absolute;
  left: 0;
  right: 8%;
  bottom: 2px;
  height: 7px;
  background: var(--sunflower);
  border-radius: 6px;
  transform: rotate(-0.8deg);
  z-index: -1;
}

/* ---------- Layout ---------- */

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px;
}

.section-title {
  font-size: 22px;
  margin: 22px 0 12px;
}

.muted {
  color: var(--charcoal-soft);
  font-size: 15px;
}

/* ---------- Vendor cards ---------- */

.vendor-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 14px;
  border: 2px solid var(--cream-dark);
}

.vendor-card .logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--sunflower);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--charcoal);
}

.vendor-card .info {
  flex: 1;
  min-width: 0;
}

.vendor-card .name {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 4px;
}

.status-pill.open {
  background: #e4f1e6;
  color: var(--leaf);
}

.status-pill.closed {
  background: #f4e3e3;
  color: var(--terracotta);
}

/* ---------- Menu items ---------- */

.category-label {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 20px 0 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 2px solid var(--cream-dark);
}

.menu-item.unavailable {
  opacity: 0.55;
}

.menu-item .details {
  flex: 1;
  min-width: 0;
}

.menu-item .item-name {
  font-weight: 700;
  font-size: 16px;
}

.menu-item .item-desc {
  font-size: 14px;
  color: var(--charcoal-soft);
  margin-top: 2px;
}

.menu-item .item-price {
  font-weight: 700;
  color: var(--terracotta);
  font-size: 15px;
  margin-top: 4px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 16px;
}

.btn-primary {
  background: var(--sunflower);
  color: var(--charcoal);
}

.btn-primary:active {
  background: var(--sunflower-dark);
}

.btn-primary:disabled {
  background: var(--cream-dark);
  color: var(--charcoal-soft);
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-add {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sunflower);
  color: var(--charcoal);
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qty-control button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--sunflower-dark);
  background: var(--white);
  font-size: 18px;
  font-weight: 700;
}

.qty-control .qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

/* ---------- Sticky cart bar ---------- */

.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--charcoal);
  color: var(--white);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-bar .cart-info {
  font-size: 14px;
}

.cart-bar .cart-total {
  font-family: "Baloo 2", sans-serif;
  font-size: 18px;
  color: var(--sunflower);
}

/* ---------- Forms ---------- */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 15px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--cream-dark);
  background: var(--white);
  font-size: 16px;
  color: var(--charcoal);
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

.radio-group {
  display: flex;
  gap: 10px;
}

.radio-option {
  flex: 1;
  border: 2px solid var(--cream-dark);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-weight: 700;
  background: var(--white);
}

.radio-option input {
  display: none;
}

.radio-option.selected {
  border-color: var(--sunflower-dark);
  background: #fff6e2;
}

.hint {
  font-size: 13px;
  color: var(--charcoal-soft);
  margin-top: 4px;
}

.error-box {
  background: #f4e3e3;
  color: var(--terracotta);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ---------- Order summary / receipt ---------- */

.receipt {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 2px dashed var(--cream-dark);
  position: relative;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  padding: 6px 0;
}

.receipt-row.total {
  border-top: 2px dashed var(--cream-dark);
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 17px;
}

.receipt-divider {
  border-top: 2px dashed var(--cream-dark);
  margin: 12px 0;
}

/* ---------- Status tracker ---------- */

.status-track {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0;
}

.status-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-bottom: 22px;
}

.status-step:last-child {
  padding-bottom: 0;
}

.status-step .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream-dark);
  flex-shrink: 0;
  z-index: 1;
}

.status-step.done .dot {
  background: var(--leaf);
}

.status-step.current .dot {
  background: var(--sunflower);
  box-shadow: 0 0 0 4px #fff2d4;
}

.status-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--cream-dark);
}

.status-step .label {
  font-weight: 700;
  font-size: 15px;
  padding-top: 2px;
}

/* ---------- Empty / loading states ---------- */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--charcoal-soft);
}

.empty-state .big-emoji {
  font-size: 40px;
  margin-bottom: 10px;
}
