:root {
  color-scheme: light;
  --ink: #171513;
  --muted: #706960;
  --line: #e6dccd;
  --paper: #fffaf1;
  --panel: #ffffff;
  --brand: #c9912f;
  --brand-dark: #7d5216;
  --good: #0f7b57;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 92px;
  background: linear-gradient(180deg, #11100f 0 150px, var(--paper) 150px 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.menu-header {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 16px 22px;
  color: #fff8ec;
}

.menu-header img {
  width: 66px;
  height: 66px;
  border: 1px solid rgba(201, 145, 47, 0.55);
  border-radius: 14px;
  object-fit: cover;
  background: #080706;
}

.menu-header span {
  display: block;
  color: #d7c7ad;
  font-size: 0.86rem;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  letter-spacing: 0;
}

main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0 14px 24px;
}

.table-box {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(32, 25, 18, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 145, 47, 0.18);
}

.products {
  display: grid;
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  min-height: 126px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(32, 25, 18, 0.08);
}

.product-card img,
.product-empty {
  width: 96px;
  height: 106px;
  border-radius: 8px;
  object-fit: cover;
  background: #201914;
}

.product-empty {
  display: grid;
  place-items: center;
  color: #f3c266;
  font-weight: 900;
}

.product-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.product-info h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.product-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-bottom strong {
  font-size: 1rem;
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 38px 34px 38px;
  align-items: center;
  min-width: 110px;
  border: 1px solid #d7e9dd;
  border-radius: 8px;
  overflow: hidden;
  background: #f0fff6;
}

.qty-control button {
  width: 38px;
  min-height: 38px;
  border: 0;
  background: #dff7ea;
  color: var(--good);
  font-size: 1.2rem;
  font-weight: 900;
}

.qty-control span {
  text-align: center;
  font-weight: 900;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
}

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 250, 241, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.cart-bar button,
.primary-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #d9a64a, var(--brand));
  color: #1c1205;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(130, 85, 20, 0.22);
}

.cart-bar button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 18px;
}

.cart-dialog {
  width: min(560px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.cart-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.cart-panel {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-head span {
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cart-head h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.icon-button {
  width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #f0e7d9;
  color: var(--ink);
  font-weight: 900;
}

.cart-items {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.customer-fields {
  display: grid;
  gap: 12px;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 86px;
  z-index: 5;
  max-width: 520px;
  margin: 0 auto;
  padding: 13px 16px;
  border-radius: 8px;
  background: #11100f;
  color: #fff8ec;
  box-shadow: 0 18px 48px rgba(32, 25, 18, 0.24);
}

@media (min-width: 720px) {
  body {
    background: linear-gradient(180deg, #11100f 0 180px, var(--paper) 180px 100%);
  }

  .menu-header {
    width: min(760px, 100%);
    margin: 0 auto;
    padding-top: 28px;
  }

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

  .product-card {
    grid-template-columns: 112px 1fr;
  }

  .product-card img,
  .product-empty {
    width: 112px;
  }
}
