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

:root {
  --cream: #ffffff;
  --cream-dark: #f0f0f0;
  --charcoal: #2d2d2d;
  --charcoal-soft: #6b6b6b;
  --sunflower: #ff6b35;
  --sunflower-dark: #e85a2a;
  --terracotta: #ef4444;
  --leaf: #22c55e;
  --sky: #e85a2a;
  --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(--sunflower-dark);
  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(--sunflower-dark);
  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;
}

/* ---------- Vendor dashboard additions ---------- */

.login-wrap {
  max-width: 380px;
  margin: 60px auto 0;
  padding: 0 16px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow);
  border: 2px solid var(--cream-dark);
}

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

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

.dash-topbar .vendor-tag {
  font-size: 13px;
  opacity: 0.8;
}

.dash-nav {
  display: flex;
  background: var(--white);
  border-bottom: 2px solid var(--cream-dark);
  position: sticky;
  top: 0;
  z-index: 5;
}

.dash-nav a {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--charcoal-soft);
  border-bottom: 3px solid transparent;
}

.dash-nav a.active {
  color: var(--charcoal);
  border-bottom-color: var(--sunflower);
}

.dash-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.open-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 2px solid var(--cream-dark);
  margin-bottom: 18px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--cream-dark);
  border-radius: 999px;
  transition: 0.15s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: 0.15s;
}

.switch input:checked + .slider {
  background: var(--leaf);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.status-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 2px;
}

.status-filter-tabs button {
  flex-shrink: 0;
  border: 2px solid var(--cream-dark);
  background: var(--white);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--charcoal-soft);
}

.status-filter-tabs button.active {
  background: var(--sunflower);
  border-color: var(--sunflower-dark);
  color: var(--charcoal);
}

.order-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid var(--cream-dark);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.order-card .order-id {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 17px;
}

.order-card .order-meta {
  font-size: 13px;
  color: var(--charcoal-soft);
  margin-top: 2px;
}

.order-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream-dark);
  color: var(--charcoal-soft);
  white-space: nowrap;
}

.order-status-badge.pending {
  background: #fff2d4;
  color: var(--sunflower-dark);
}
.order-status-badge.accepted,
.order-status-badge.preparing {
  background: #ffe8dd;
  color: var(--sunflower-dark);
}
.order-status-badge.ready,
.order-status-badge.out_for_delivery {
  background: #ffe8dd;
  color: var(--sunflower-dark);
}
.order-status-badge.delivered,
.order-status-badge.collected {
  background: #e4f1e6;
  color: var(--leaf);
}
.order-status-badge.rejected {
  background: #f4e3e3;
  color: var(--terracotta);
}

.order-items-list {
  font-size: 14px;
  margin: 8px 0;
  color: var(--charcoal);
}

.order-items-list div {
  padding: 2px 0;
}

.order-notes {
  font-size: 13px;
  color: var(--charcoal-soft);
  font-style: italic;
  margin: 6px 0;
}

.order-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-sm {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
}

.btn-accept {
  background: var(--leaf);
  color: var(--white);
}

.btn-reject {
  background: var(--white);
  border: 2px solid var(--terracotta);
  color: var(--terracotta);
}

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

.btn-outline {
  background: var(--white);
  border: 2px solid var(--cream-dark);
  color: var(--charcoal);
}

/* Menu management */

.menu-manage-item {
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid var(--cream-dark);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.menu-manage-item .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.menu-manage-item .item-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  border: 2px solid var(--cream-dark);
  background: var(--white);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sunflower);
  color: var(--charcoal);
  font-size: 28px;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 10px rgba(43, 33, 24, 0.25);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 24, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.modal-sheet {
  background: var(--cream);
  width: 100%;
  max-width: 480px;
  border-radius: 18px 18px 0 0;
  padding: 20px 18px 28px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.close-x {
  border: none;
  background: none;
  font-size: 22px;
  color: var(--charcoal-soft);
  line-height: 1;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 16px;
}

/* ---------- 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;
}
