:root {
  --green: #1e7d3c;
  --green-dark: #145c2a;
  --green-light: #e6f4ea;
  --orange: #f28c1e;
  --viber: #7360f2;
  --text: #222;
  --muted: #667;
  --bg: #f7f7f4;
  --card: #ffffff;
  --border: #e2e2dc;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--green);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 2rem; }
.brand h1 { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.slogan { margin: 2px 0 0; font-size: 0.8rem; opacity: 0.9; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-link { color: #fff; font-size: 0.9rem; text-decoration: none; opacity: 0.95; }
.header-link:hover { text-decoration: underline; }

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-cart { background: var(--orange); color: #fff; position: relative; }
.cart-count {
  background: #fff;
  color: var(--orange);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0 5px;
}

.demo-banner {
  background: #fff3cd;
  color: #7a5c00;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid #f0e0a0;
}

/* ---------- Search & categories ---------- */
.search-bar {
  max-width: 1100px;
  margin: 14px auto 0;
  padding: 0 16px;
}
.search-bar input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.search-bar input:focus { outline: none; border-color: var(--green); }

.category-nav {
  max-width: 1100px;
  margin: 10px auto 0;
  padding: 4px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-nav button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.category-nav button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ---------- Catalog ---------- */
.catalog {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 16px 80px;
}
.category-section h2 {
  margin: 26px 0 10px;
  font-size: 1.15rem;
  color: var(--green-dark);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
}
.product-img {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafaf7;
  border-radius: 8px;
  overflow: hidden;
}
.product-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.img-fallback { font-size: 3rem; opacity: 0.55; }
.product-card { position: relative; }
.promo-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: #e02020;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 6px;
  padding: 3px 7px;
}
.old-price {
  color: #999;
  text-decoration: line-through;
  font-size: 0.85rem;
  margin-left: 4px;
}
.age-note {
  background: #fff3cd;
  color: #7a5c00;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  display: inline-block;
  margin: 0 0 6px;
}
.product-name { font-weight: 600; font-size: 0.95rem; flex: 1; }
.product-price { color: var(--green-dark); font-weight: 700; }
.product-price .bgn { color: var(--muted); font-weight: 400; font-size: 0.85em; }
.product-unit { color: var(--muted); font-size: 0.8rem; display: block; }
.product-actions { display: flex; align-items: center; gap: 8px; }
.btn-add {
  background: var(--green);
  color: #fff;
  flex: 1;
  justify-content: center;
  padding: 9px 10px;
}
.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.qty-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.qty-controls span { min-width: 26px; text-align: center; font-weight: 700; }

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 1.05rem;
}

/* ---------- Плаващ бутон кошница (мобилно) ---------- */
.cart-fab {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- Cart panel ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
}
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(430px, 100vw);
  background: var(--card);
  z-index: 100;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  padding: 16px;
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cart-header h2 { margin: 0; font-size: 1.15rem; }
.btn-close {
  border: none;
  background: var(--bg);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
}
.cart-items { display: flex; flex-direction: column; gap: 8px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  font-size: 0.9rem;
}
.cart-item-name { flex: 1; }
.cart-item-price { font-weight: 600; white-space: nowrap; }
.cart-empty { color: var(--muted); text-align: center; padding: 20px 0; }

.cart-totals { margin: 14px 0; }
.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.05rem;
}
.total-row.secondary { color: var(--muted); font-size: 0.9rem; }

/* ---------- Order form ---------- */
#order-form h3 { margin: 16px 0 8px; font-size: 1.05rem; }
#order-form label { display: block; margin: 10px 0; font-size: 0.9rem; font-weight: 600; }
#order-form input[type="text"],
#order-form input[type="tel"],
#order-form select,
#order-form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
#order-form input:focus, #order-form select:focus, #order-form textarea:focus {
  outline: none;
  border-color: var(--green);
}
.fulfillment {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin: 12px 0;
}
.fulfillment legend { font-weight: 700; font-size: 0.9rem; padding: 0 6px; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; }
.delivery-note {
  background: var(--green-light);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: var(--green-dark);
}
.slot-box { margin: 12px 0; }
.slot-days, .slot-windows {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}
.payment-note { font-size: 0.85rem; color: var(--muted); }
.consent { font-size: 0.85rem !important; margin: 10px 0; align-items: flex-start !important; }
.consent input { margin-top: 3px; }
.btn-submit {
  width: 100%;
  background: var(--green);
  color: #fff;
  font-size: 1.05rem;
  padding: 14px;
  justify-content: center;
}
.form-error {
  color: #c0392b;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-dark);
  color: #fff;
  padding: 26px 16px 16px;
  margin-top: 30px;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.site-footer h3 { margin: 0 0 8px; font-size: 1rem; }
.site-footer a { color: #fff; }
.site-footer ul { margin: 0; padding-left: 18px; }
.footer-bottom {
  text-align: center;
  margin-top: 20px;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ---------- Страници статус / благодарим ---------- */
.narrow-page {
  max-width: 560px;
  margin: 40px auto;
  padding: 26px 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.narrow-page .big { font-size: 3.2rem; text-align: center; }
.narrow-page h1 { text-align: center; font-size: 1.4rem; }
.narrow-page label { display: block; margin: 12px 0; font-weight: 600; font-size: 0.9rem; }
.narrow-page input {
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.narrow-page .btn { width: 100%; justify-content: center; background: var(--green); color: #fff; margin-top: 8px; }
.order-no-box {
  text-align: center;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 1.3rem;
  font-weight: 800;
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0;
  letter-spacing: 1px;
}
.status-result {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 700;
  font-size: 0.95rem;
}
.status-нова { background: #fff3cd; color: #7a5c00; }
.status-приготвя-се { background: #cfe8ff; color: #0b5394; }
.status-готова { background: #d9f2d9; color: #1e7d3c; }
.status-доставена { background: #e2e2e2; color: #444; }
.status-отказана { background: #ffd6d6; color: #a02020; }
.center-note { text-align: center; color: var(--muted); font-size: 0.9rem; }

/* ---------- Админ панел ---------- */
.admin-body { background: #eef1ee; }
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 16px; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-header h1 { font-size: 1.3rem; margin: 0; }
.admin-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 6px solid var(--orange);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.order-card.st-приготвя-се { border-left-color: #0b5394; }
.order-card.st-готова { border-left-color: var(--green); }
.order-card.st-доставена { border-left-color: #999; opacity: 0.75; }
.order-card.st-отказана { border-left-color: #a02020; opacity: 0.75; }
.order-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.order-no { font-weight: 800; font-size: 1.05rem; }
.order-meta { font-size: 0.9rem; color: var(--muted); }
.order-details { font-size: 0.95rem; margin: 8px 0; line-height: 1.55; }
.order-items {
  background: #fafaf7;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.order-actions .btn { font-size: 0.85rem; padding: 8px 12px; }
.btn-status-next { background: var(--green); color: #fff; }
.btn-status-cancel { background: #fff; color: #a02020; border: 1px solid #a02020; }
.login-box { max-width: 380px; margin: 60px auto; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .brand h1 { font-size: 1.05rem; }
  .slogan { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-img { height: 90px; }
}
