:root {
  --ink: #1d1612;
  --muted: #6b625d;
  --line: #e8dfd7;
  --paper: #fffaf4;
  --panel: #ffffff;
  --red: #b42016;
  --green: #1f6b3a;
  --gold: #d89420;
  --shadow: 0 16px 40px rgba(64, 31, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.brand small,
.eyebrow,
.hero-card span,
.cart-line span,
.order-head span,
dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.brand span:last-child {
  display: grid;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.nav a,
.phone,
.cart-link,
.secondary,
.primary,
.secondary-button {
  border-radius: 6px;
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 700;
}

.nav a,
.cart-link,
.secondary,
.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
}

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

.cart-link {
  position: relative;
  display: inline-grid;
  grid-template-columns: 20px auto 24px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--ink);
}

.cart-link svg,
.floating-cart svg {
  width: 22px;
  height: 22px;
}

.cart-link b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.82rem;
}

.phone,
.primary {
  background: var(--red);
  color: #fff;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(20px, 5vw, 56px);
  align-items: end;
  padding: clamp(38px, 7vw, 86px) clamp(16px, 4vw, 48px) 28px;
  background:
    linear-gradient(120deg, rgba(29, 22, 18, 0.9), rgba(29, 22, 18, 0.5)),
    url("https://images.unsplash.com/photo-1513104890138-7c749659a591?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
}

.hero h1 {
  max-width: 720px;
  margin: 8px 0 14px;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.98;
}

.hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero .secondary {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.hero-card {
  display: grid;
  gap: 5px;
  padding: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 48px) 60px;
}

.category {
  scroll-margin-top: 90px;
  margin-bottom: 34px;
}

.category h2,
.cart-panel h2,
.admin-header h1 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.cart-panel h2 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

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

.menu-item,
.cart-panel,
.order-card,
.login-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(64, 31, 18, 0.06);
}

.menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.menu-item h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.menu-item p {
  margin: 0;
  color: var(--muted);
}

.item-action {
  display: grid;
  gap: 8px;
  justify-items: end;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.cart-panel {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow: auto;
  padding: 12px;
  scroll-margin-top: 90px;
  font-size: 0.88rem;
}

.cart-items {
  display: grid;
  gap: 6px;
  min-height: 28px;
}

.empty {
  color: var(--muted);
  align-items: center;
}

.cart-line,
.cart-total,
.order-items li,
.order-footer,
.admin-header,
.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-line {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.cart-line div:first-child {
  display: grid;
  min-width: 0;
}

.cart-line strong {
  overflow: hidden;
  font-size: 0.86rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-line span {
  font-size: 0.76rem;
}

.qty {
  display: grid;
  grid-template-columns: 26px 22px 26px;
  align-items: center;
  text-align: center;
  font-size: 0.82rem;
}

.qty button {
  width: 26px;
  height: 26px;
  padding: 0;
  background: var(--red);
}

.cart-total {
  padding: 9px 0;
  font-size: 1rem;
}

.order-form,
.login-box {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 3px;
  font-size: 0.82rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.88rem;
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.choice-row label {
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.choice-row input {
  width: auto;
}

.submit {
  width: 100%;
  background: var(--red);
  padding: 9px 10px;
  font-size: 0.9rem;
}

.form-message {
  min-height: 18px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.inline-note {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.success {
  color: var(--green);
}

.error {
  color: var(--red);
}

.admin-body {
  background: #f7f2ec;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.login-box {
  max-width: 390px;
  margin: 80px auto;
  padding: 22px;
}

.orders {
  display: grid;
  gap: 14px;
}

.order-card {
  padding: 18px;
}

.order-head strong {
  display: block;
  font-size: 1.1rem;
}

.status {
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-new {
  background: var(--red);
}

.status-accepted {
  background: var(--gold);
}

.status-done {
  background: var(--green);
}

.status-cancelled {
  background: #5d5d5d;
}

.order-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.order-meta div {
  min-width: 0;
}

dt,
dd {
  margin: 0;
}

.order-items {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.order-notes {
  padding: 10px;
  border-radius: 6px;
  background: #fff8df;
}

.order-footer {
  margin-top: 14px;
}

.order-footer form {
  display: flex;
  gap: 8px;
}

.admin-empty {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payment-result {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.result-box {
  width: min(620px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.result-box h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.result-box p {
  color: var(--muted);
}

.floating-cart {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: none;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.floating-cart.is-active {
  display: grid;
}

.floating-cart span {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(29, 22, 18, 0.58);
}

.modal-backdrop.is-open {
  display: flex;
}

.extras-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.extras-modal h2 {
  margin: 2px 34px 8px 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.12;
}

.extras-modal p {
  margin: 0 0 18px;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: #f0e7df;
  color: var(--ink);
}

.extras-grid {
  display: grid;
  gap: 10px;
}

.extra-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffaf4;
  color: var(--ink);
  text-align: left;
}

.extra-option strong {
  color: var(--green);
  white-space: nowrap;
}

.extra-option.is-added {
  border-color: var(--green);
  background: #eef8f0;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .primary,
.modal-actions .secondary-button {
  display: grid;
  place-items: center;
  text-align: center;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav {
    justify-content: flex-start;
  }

  .top-actions {
    width: 100%;
  }

  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .phone,
  .cart-link {
    text-align: center;
  }

  .cart-link {
    justify-content: center;
  }

  .menu-item {
    grid-template-columns: 1fr;
  }

  .item-action {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .choice-row,
  .order-meta {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    margin-inline: -6px;
    padding: 10px;
    font-size: 0.82rem;
  }

  .cart-panel h2 {
    font-size: 1rem;
  }

  .cart-line {
    gap: 8px;
  }

  .cart-line strong {
    max-width: 185px;
    font-size: 0.8rem;
  }

  .cart-line span,
  label,
  input,
  textarea {
    font-size: 0.78rem;
  }

  .qty {
    grid-template-columns: 24px 20px 24px;
    font-size: 0.76rem;
  }

  .qty button {
    width: 24px;
    height: 24px;
  }

  .cart-total {
    padding: 7px 0;
    font-size: 0.92rem;
  }

  .order-form {
    gap: 6px;
  }

  input,
  textarea {
    padding: 6px 7px;
  }

  textarea {
    min-height: 54px;
  }

  .choice-row {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .choice-row label {
    padding: 6px;
  }

  .order-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .order-footer form {
    flex-direction: column;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}
