:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #23211e;
  --muted: #7a766f;
  --accent: #b3541e;
  --accent-dark: #8f4218;
  --ok: #2e7d32;
  --err: #c62828;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.site-header {
  text-align: center;
  padding: 32px 16px 8px;
}
.site-header h1 { margin: 0 0 6px; font-size: 1.8rem; }
.site-header p { margin: 0; color: var(--muted); }

.banner {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
}
.banner.ok { background: #e5f2e6; color: var(--ok); }
.banner.err { background: #fdeaea; color: var(--err); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px 48px;
}
.empty { grid-column: 1/-1; text-align: center; color: var(--muted); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
}
.card.reserved { opacity: .75; }
.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #eee;
}
.card-img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h2 { margin: 0; font-size: 1.05rem; }
.price { margin: 0; font-weight: 700; font-size: 1.1rem; }
.note { margin: 0; color: var(--muted); font-size: .9rem; }
.shop-link { color: var(--accent); text-decoration: none; font-size: .95rem; }
.shop-link:hover { text-decoration: underline; }

.badge {
  margin: auto 0 0;
  padding: 8px 12px;
  background: #f0ede8;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

details { margin-top: auto; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

.btn {
  display: block;
  text-align: center;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.btn:hover { background: #faf3ee; }
.btn.primary { background: var(--accent); color: #fff; width: 100%; }
.btn.primary:hover { background: var(--accent-dark); }

form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, textarea, select {
  padding: 9px 10px;
  border: 1px solid #d8d4cd;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ---------- Админка ---------- */

.admin { max-width: 900px; margin: 0 auto; padding: 24px 16px 64px; }
.admin h1 { font-size: 1.5rem; }
.admin section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.admin h2 { margin: 0 0 12px; font-size: 1.1rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.row .btn { flex: 0 0 auto; }

.item-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #eceae5;
  align-items: flex-start;
}
.item-row img, .item-row .thumb {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.item-info { flex: 1; min-width: 0; }
.item-info .t { font-weight: 600; }
.item-info .m { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.item-info .res { color: var(--accent-dark); font-size: .9rem; margin-top: 4px; }
.item-actions { display: flex; flex-direction: column; gap: 6px; }
.item-actions button {
  font: inherit; font-size: .82rem;
  padding: 5px 10px;
  border: 1px solid #d8d4cd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.item-actions button:hover { background: #f4f2ee; }
.item-actions button.danger { color: var(--err); border-color: #eec9c9; }

.msg { padding: 10px 12px; border-radius: 8px; margin: 10px 0; display: none; }
.msg.show { display: block; }
.msg.ok { background: #e5f2e6; color: var(--ok); }
.msg.err { background: #fdeaea; color: var(--err); }

.hidden-tag { background: #eee; border-radius: 6px; padding: 1px 7px; font-size: .78rem; color: var(--muted); }

@media (max-width: 560px) {
  .item-row { flex-wrap: wrap; }
  .item-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
}
