:root {
  --ink: #17212b;
  --muted: #657080;
  --line: #dde3ea;
  --paper: #ffffff;
  --surface: #f5f7fb;
  --primary: #d9472f;
  --primary-dark: #b93522;
  --teal: #047e7d;
  --gold: #f4b942;
  --success: #0f8f62;
  --danger: #b42318;
  --shadow: 0 16px 45px rgba(20, 32, 45, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

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

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

.cart-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 24px;
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 40px;
}

.menu-area,
.order-area {
  min-width: 0;
}

.order-area {
  position: sticky;
  top: 84px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  line-height: 1.05;
}

.section-heading h1 {
  font-size: clamp(34px, 5vw, 62px);
  max-width: 680px;
}

.section-heading h2 {
  font-size: 22px;
}

.section-heading p {
  max-width: 460px;
  margin: 8px 0 0;
  color: var(--muted);
}

.category-row {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  padding: 2px;
  overflow-x: auto;
}

.category-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  white-space: nowrap;
}

.category-button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.product-card,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-card {
  display: grid;
  overflow: hidden;
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #f6d365, #fda085);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.product-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-title h3 {
  margin: 0;
  font-size: 18px;
}

.price {
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.product-body p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.primary-button,
.secondary-button,
.qty-button,
.remove-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 750;
}

.primary-button {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  width: 100%;
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.panel {
  padding: 16px;
}

.empty-cart {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.cart-items {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cart-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.qty-control {
  display: grid;
  grid-template-columns: 34px 34px 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qty-button {
  width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.qty-number {
  text-align: center;
  font-weight: 800;
}

.remove-button {
  margin-top: 8px;
  min-height: 32px;
  padding: 4px 10px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 800;
}

.checkout-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
}

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

.status-message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.status-message.error {
  background: #fff1f0;
  color: var(--danger);
}

.status-message.success {
  background: #ecfdf3;
  color: var(--success);
}

.loading,
.menu-error {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
  }

  .brand small {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .order-area {
    position: static;
  }

  .section-heading {
    display: block;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .cart-link {
    flex-direction: column;
    gap: 0;
    min-width: 96px;
    min-height: 46px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .section-heading h1 {
    font-size: 36px;
  }
}

