:root {
  --red: #d9142b;
  --red-dark: #b81124;
  --red-press: #ab0c1e;
  --page: #f7f7f7;
  --card: #ffffff;
  --ink: #242424;
  --text: #636363;
  --line: #ececec;
  --header: 72px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: inherit; }

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--red);
  color: #fff;
}
.top-bar {
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  color: #fff;
  padding: 0;
}
.logo img { height: 42px; width: auto; background: #fff; border-radius: 8px; padding: 4px; }
.logo strong { display: block; font-size: 18px; letter-spacing: .02em; }
.logo span { display: block; font-size: 12px; opacity: .85; font-weight: 400; }
.search {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
  border: 0;
  border-radius: 4px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}
.basket-btn {
  border: 0;
  background: #fff;
  color: var(--red);
  border-radius: 4px;
  min-width: 108px;
  height: 42px;
  font-weight: 700;
}
.cats {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: var(--red-dark);
  border-top: 1px solid rgba(255,255,255,.15);
}
.cats button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.cats button.on { background: #fff; color: var(--red); }

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
  align-items: start;
}
.category { margin-bottom: 22px; }
.category h2 {
  margin: 0 0 8px;
  padding: 8px 2px;
  color: var(--red);
  font-size: 22px;
  text-transform: uppercase;
}
.product {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px;
}
.product img {
  width: 132px;
  height: 96px;
  object-fit: cover;
  background: #f4f4f4;
}
.product h3 { margin: 0 0 4px; font-size: 16px; }
.product p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.4; }
.product-side { text-align: right; min-width: 110px; }
.price { display: block; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.price s { display: block; color: var(--text); font-weight: 400; font-size: 12px; }
.add, .pay, .mode button.on, .primary {
  border: 0;
  background: var(--red);
  color: #fff;
  border-radius: 3px;
  padding: 9px 14px;
  font-weight: 700;
}
.add:hover, .pay:hover, .primary:hover { background: var(--red-press); }
.ghost {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px;
  padding: 8px 12px;
}

.cart, .sheet {
  background: #fff;
  border: 1px solid var(--line);
}
.cart { position: sticky; top: 128px; padding: 14px; }
.cart h2, .sheet h2 { margin: 0 0 12px; font-size: 18px; color: var(--red); }
.cart-line, .sum div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty button { width: 24px; height: 24px; border: 1px solid #ddd; background: #fff; }
.sum { margin-top: 8px; }
.sum .grand { font-size: 18px; font-weight: 700; color: var(--ink); }
.empty { color: var(--text); }
.notice { background: #fff4f5; color: var(--red-dark); padding: 10px 12px; margin: 0 0 12px; }

.sheet { max-width: 720px; margin: 18px auto; padding: 22px; }
.modes, .pay-row { display: flex; gap: 8px; margin-bottom: 14px; }
.modes button, .pay-row button {
  flex: 1;
  border: 1px solid #ddd;
  background: #fff;
  padding: 12px;
  font-weight: 700;
}
.modes button.on, .pay-row button.on { background: var(--red); color: #fff; border-color: var(--red); }
label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--text); }
input, textarea, select {
  width: 100%;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  padding: 10px;
  background: #fff;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay { width: 100%; margin-top: 16px; padding: 14px; font-size: 16px; }
.pay:disabled { opacity: .55; cursor: default; }
.error { color: var(--red); font-weight: 700; }

.foot {
  background: var(--red-dark);
  color: #fff;
  margin-top: 28px;
  padding: 28px 18px 40px;
}
.foot-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
}
.foot h3, .foot h4 { margin: 0 0 8px; }
.foot p, .foot li { margin: 0 0 6px; color: rgba(255,255,255,.88); }
.foot ul { margin: 0; padding: 0; list-style: none; }
.fine { max-width: 1180px; margin: 18px auto 0; opacity: .7; font-size: 13px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal article { background: #fff; width: min(480px, 100%); padding: 18px; }
.modal h3 { margin: 0 0 8px; }
.opt { margin: 12px 0; }
.opt label { display: flex; gap: 8px; align-items: center; color: var(--ink); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  z-index: 60;
}

@media (max-width: 860px) {
  .layout, .foot-grid, .grid-2, .product { grid-template-columns: 1fr; }
  .search { display: none; }
  .cart { position: static; }
  .product img { width: 100%; height: 180px; }
  .product-side { text-align: left; }
  .logo span { display: none; }
}
