:root {
  --brand: #ef4056;
  --brand-dark: #d62e44;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #faf7f4;
  --card: #ffffff;
  --line: #eee5dd;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Tahoma, "Vazirmatn", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
}
a { color: var(--brand); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand-name { font-weight: bold; font-size: 20px; color: var(--brand); }
.brand-sub { font-size: 12px; color: var(--muted); }
.cart-btn {
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  border-radius: 999px; padding: 8px 16px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.cart-count {
  display: inline-block; background: #fff; color: var(--brand);
  border-radius: 999px; min-width: 22px; text-align: center; font-weight: bold; margin-inline-start: 4px;
}
.hero { text-align: center; padding: 28px 16px 8px; }
.hero h1 { margin: 0 0 4px; font-size: 26px; }
.hero p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.search {
  width: 100%; max-width: 520px; padding: 12px 16px; font-family: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; outline: none;
}
.search:focus { border-color: var(--brand); }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-family: inherit; font-size: 13px;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
main { padding: 0 16px 32px; max-width: 1100px; margin: 0 auto; }
.result-line { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
}
.tile {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fdf0f1, #faf7f4); color: var(--brand);
  font-size: 13px; font-weight: bold; text-align: center; padding: 12px;
}
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-size: 14px; font-weight: bold; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: bold; color: var(--brand); font-size: 14px; }
.add-btn {
  border: none; background: var(--brand); color: #fff; border-radius: 10px;
  padding: 8px 12px; cursor: pointer; font-family: inherit; font-size: 13px;
}
.add-btn:active { background: var(--brand-dark); }
.footer { text-align: center; padding: 24px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.footer .note { font-size: 12px; }
.drawer-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20;
}
.drawer-backdrop.show { display: block; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(420px, 92vw);
  background: #fff; z-index: 21; transform: translateX(-105%); transition: transform .25s ease;
  display: flex; flex-direction: column; box-shadow: 0 0 24px rgba(0,0,0,.2);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.close-btn { border: none; background: none; font-size: 18px; cursor: pointer; }
.drawer-items { flex: 1; overflow-y: auto; padding: 12px 16px; }
.drawer-item { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.drawer-item .nm { flex: 1; font-size: 13px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; }
.drawer-foot { padding: 16px; border-top: 1px solid var(--line); }
.drawer-foot input, .drawer-foot textarea {
  width: 100%; padding: 10px 12px; margin-bottom: 8px; font-family: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 10px;
}
.wa-btn {
  display: block; width: 100%; text-align: center; background: #25d366; color: #fff !important;
  border-radius: 12px; padding: 12px; font-weight: bold; text-decoration: none; margin-top: 8px;
}
.total-line { display: flex; justify-content: space-between; font-weight: bold; margin: 8px 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }
