:root {
  --navy: #0f1b2d;
  --navy-2: #16263c;
  --green: #1f7a3d;
  --green-2: #2e9b53;
  --red: #d8342a;
  --gold: #c8a24a;
  --bg: #f2f6ee;
  --card: #ffffff;
  --ink: #16202b;
  --muted: #6d7a85;
  --line: #e4ebe0;
  --radius: 18px;
  --nav-h: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Cairo", -apple-system, "Segoe UI", "Noto Naskh Arabic", Tahoma, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
}
img { display: block; }
button { font-family: inherit; }

.top {
  background: linear-gradient(180deg, #0d1728 0%, #16273d 100%);
  color: #fff;
  padding: calc(12px + env(safe-area-inset-top)) 16px 18px;
  border-radius: 0 0 26px 26px;
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { display: flex; align-items: center; gap: 10px; }
.moon {
  width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255,255,255,.10); font-size: 17px; color: #ffe9b0;
}
.hi { margin: 0; font-size: 11px; color: #a9b6c6; }
.shop { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: .2px; }
.logo { height: 40px; width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }

.search { position: relative; margin-top: 14px; }
.search input {
  width: 100%; border: 0; border-radius: 14px; padding: 13px 44px 13px 14px;
  font-family: inherit; font-size: 13px; color: var(--ink); background: #fff;
  box-shadow: 0 4px 14px rgba(4, 12, 24, .18);
}
.search input::placeholder { color: #9aa5b1; }
.search-ico { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: #7b8794; }

.promo { padding: 14px 14px 0; }
.promo-inner {
  border-radius: 20px; padding: 16px 16px 14px;
  background: linear-gradient(135deg, #ffe9b8 0%, #ffd27a 45%, #ffb74d 100%);
  color: #3a2a05; box-shadow: 0 6px 18px rgba(200, 162, 74, .28);
}
.promo-kicker { margin: 0; font-size: 11px; font-weight: 700; opacity: .75; }
.promo-inner h2 { margin: 2px 0 8px; font-size: 21px; font-weight: 900; }
.promo-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.promo-chips span {
  background: #1f5d33; color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
}
.promo-note { margin: 10px 0 0; font-size: 11px; font-weight: 600; opacity: .8; }

.cats { display: flex; gap: 8px; overflow-x: auto; padding: 14px 14px 4px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.sec-head h3 { margin: 0; font-size: 17px; font-weight: 900; }
.sec-more { font-size: 12px; color: var(--muted); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 12px 18px; max-width: 1000px; margin: 0 auto; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 18px 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(16, 32, 24, .06); display: flex; flex-direction: column; }
.card-img { position: relative; aspect-ratio: 1 / 1; background: #eef1ea; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-name { margin: 0; font-size: 14px; font-weight: 900; line-height: 1.35; }
.card-desc { margin: 0; font-size: 11px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.price-row { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.price { color: var(--red); font-size: 16px; font-weight: 900; }
.price small { font-size: 11px; font-weight: 700; }
.price.ask { color: var(--muted); font-size: 12px; }
.unit { font-size: 10px; color: var(--muted); font-weight: 700; }
.carton { font-size: 10.5px; color: var(--green); font-weight: 700; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.brand { font-size: 10.5px; color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.brand::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--red); display: inline-block; }
.add {
  border: 0; background: var(--red); color: #fff; width: 38px; height: 34px; border-radius: 11px;
  font-size: 16px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(216, 52, 42, .3);
}
.add:active { transform: scale(.95); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 28px 10px; }

.wa-fab {
  position: fixed; inset-inline-start: 50%; transform: translateX(50%);
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 999px; background: #25d366; color: #fff;
  display: grid; place-items: center; font-size: 22px; text-decoration: none;
  box-shadow: 0 6px 18px rgba(37, 211, 102, .45); z-index: 30;
}

.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 35;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(16, 32, 24, .06);
}
.bottom-nav button {
  border: 0; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; position: relative;
}
.bottom-nav button span { font-size: 18px; line-height: 1; }
.bottom-nav button.on { color: var(--green); }
.badge[hidden] { display: none; }
.badge {
  position: absolute; top: 8px; inset-inline-start: 50%; margin-inline-start: 6px;
  background: var(--red); color: #fff; font-size: 9px; font-style: normal; font-weight: 900;
  min-width: 16px; height: 16px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
}

.backdrop { position: fixed; inset: 0; background: rgba(12, 20, 30, .5); z-index: 40; opacity: 0; transition: opacity .2s; }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45; background: #fff;
  border-radius: 22px 22px 0 0; max-height: 88vh; overflow-y: auto;
  transform: translateY(102%); transition: transform .26s ease;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.sheet.open { transform: none; }
.sheet-head { position: sticky; top: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); z-index: 2; }
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 900; }
.sheet-close { border: 0; background: #f0f2ee; width: 32px; height: 32px; border-radius: 999px; font-size: 15px; cursor: pointer; }
.sheet-body { padding: 14px 16px 0; }
.sheet-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 16px; background: #eef1ea; }
.sheet-name { margin: 12px 0 2px; font-size: 19px; font-weight: 900; }
.sheet-desc { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.field { margin-bottom: 12px; }
.field-label { display: block; font-size: 11.5px; font-weight: 900; color: #45525e; margin-bottom: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 7px; }
.opt {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 700;
  padding: 8px 13px; border-radius: 11px; cursor: pointer;
}
.opt[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.sheet-price { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 12px; }
.sheet-price strong { font-size: 20px; color: var(--red); font-weight: 900; }
.sheet-price span { font-size: 11px; color: var(--muted); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  border: 0; border-radius: 14px; padding: 14px 16px; font-size: 14.5px; font-weight: 900;
  text-decoration: none; cursor: pointer;
}
.btn-wa { background: #25d366; color: #06300f; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost { background: #f0f2ee; color: var(--ink); }
.hint { margin: 8px 0 0; font-size: 11px; color: var(--muted); text-align: center; }

.cart-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-row img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #eef1ea; }
.cart-row .info { flex: 1; min-width: 0; }
.cart-row .info b { display: block; font-size: 13px; font-weight: 900; }
.cart-row .info small { font-size: 11px; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 14px; cursor: pointer; }
.qty span { font-size: 13px; font-weight: 900; min-width: 18px; text-align: center; }
.cart-total { display: flex; justify-content: space-between; font-size: 14px; font-weight: 900; padding: 14px 0 10px; }
.me-card { background: #f7f9f4; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.me-card p { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.me-card a { color: var(--green); font-weight: 900; text-decoration: none; font-size: 13px; }
.admin-link { display: block; text-align: center; font-size: 11px; color: #9aa5b1; text-decoration: none; margin-top: 14px; }
