:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #7a7a7a;
  --border: #eeeeee;
  --accent: #b5651d;   /* warm coffee accent for price/CTAs */
  --accent-soft: #fbeee2;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[dir="rtl"] body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 30;
}
.site-header .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; }
.site-header .logo img { height: 34px; width: auto; }
.lang-toggle {
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; background: var(--bg); cursor: pointer;
}

/* ---------- Category tabs (scrollspy) ---------- */
.cat-tabs {
  position: sticky; top: 62px; z-index: 20;
  display: flex; gap: 22px; overflow-x: auto;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  white-space: nowrap; font-size: 15px; color: var(--muted); font-weight: 600;
  padding-bottom: 6px; border-bottom: 2px solid transparent; cursor: pointer;
}
.cat-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Category section + card grid ---------- */
.category-section { padding: 20px 16px 4px; }
.category-title { font-size: 20px; font-weight: 700; margin: 0 0 12px; }
.item-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (min-width: 640px) { .item-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .item-grid { grid-template-columns: repeat(4, 1fr); } }

.item-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; background: var(--bg);
  display: flex; flex-direction: column;
}
.item-card .img-wrap { width: 100%; aspect-ratio: 1 / 1; background: #f5f5f5; overflow: hidden; }
.item-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.item-card .body { padding: 10px 12px 14px; }
.item-card .name { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.item-card .desc {
  font-size: 12.5px; color: var(--muted); margin: 0 0 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-card .price { font-size: 14px; font-weight: 700; color: var(--accent); }
.badge-customizable {
  display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; margin-top: 6px;
}

/* ---------- Item modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: flex-end; justify-content: center; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  background: var(--bg); width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto;
  padding-bottom: 24px;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal-sheet { border-radius: 20px; }
}
.modal-sheet .close-btn {
  position: absolute; top: 12px; inset-inline-end: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 50%;
  width: 32px; height: 32px; font-size: 16px; cursor: pointer;
}
.modal-sheet .img-wrap { width: 100%; aspect-ratio: 4 / 3; background: #f5f5f5; overflow: hidden; }
.modal-sheet .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.modal-sheet .content { padding: 16px 18px; }
.modal-sheet .name { font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.modal-sheet .desc { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.modal-sheet .price { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }

.mod-group { margin-bottom: 18px; }
.mod-group .mg-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.mod-group .mg-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.mod-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.mod-option:last-child { border-bottom: none; }
.mod-option .opt-price { color: var(--muted); font-size: 12.5px; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
.admin-nav { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.admin-nav a { padding: 10px 4px; font-weight: 600; color: var(--muted); font-size: 14px; }
.admin-nav a.active { color: var(--text); border-bottom: 2px solid var(--accent); }
.admin-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: start; }
.admin-table th { color: var(--muted); font-weight: 600; }
.form-row { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-row input, .form-row textarea, .form-row select {
  padding: 9px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; width: 100%;
  font-family: inherit;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; background: var(--text); color: #fff;
}
.btn.secondary { background: #f2f2f2; color: var(--text); }
.btn.danger { background: #d9534f; color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert.success { background: #eafaf0; color: #1a7a41; }
.alert.error { background: #fdecea; color: #b3261e; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.login-box { max-width: 340px; margin: 80px auto; padding: 24px; border: 1px solid var(--border); border-radius: 14px; }
