:root {
    --bg: #f7f2ea; --card: #fffdf9; --ink: #2b2420; --muted: #7a6e64; --line: #e8dfd3;
    --brand: #3f6b4a; --brand-soft: #e4eee5; --accent: #c4703a; --warn: #b4432f;
    --r: 16px; --shadow: 0 1px 2px rgba(60,40,20,.06), 0 6px 20px rgba(60,40,20,.06);
}

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Tajawal", system-ui, sans-serif; }
.muted { color: var(--muted) !important; }

/* =================================================== customer page */
.shop { font-size: 16px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
.shop img { max-width: 100%; display: block; }
.shop button, .shop input, .shop textarea { font: inherit; color: inherit; }
.shop .wrap { max-width: 760px; width: 100%; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.shop > .wrap { flex: 1; }

.hero { padding: 28px 0 18px; text-align: center; }
.hero .mark { width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; font-size: 28px; }
.hero h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.3px; }
.hero p { margin: 4px 0 0; color: var(--muted); }

.step { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-weight: 700; font-size: 19px; }
.step b { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 18px; cursor: pointer; font-weight: 600; transition: .15s; }
.chip small { color: var(--muted); font-weight: 500; margin-inline-start: 4px; direction: ltr; unicode-bidi: isolate; }
.chip.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.chip.on small { color: #dbe9dd; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.basket { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border: 2px solid transparent; transition: border-color .15s; }
.basket.in { border-color: var(--brand); }
.basket .img { aspect-ratio: 4/3; background: linear-gradient(135deg, #efe4d4, #e3d3bd); display: grid; place-items: center; }
.basket .img.ph { aspect-ratio: 16/7; font-size: 44px; }
.basket .img img { width: 100%; height: 100%; object-fit: cover; }
.basket .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.basket h3 { margin: 0; font-size: 18px; }
.basket .desc { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.basket .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 800; font-size: 19px; color: var(--brand); }
.price s { color: var(--muted); font-weight: 500; font-size: 13px; margin-inline-start: 6px; }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--bg); border-radius: 999px; padding: 3px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card); cursor: pointer; font-size: 20px; line-height: 1; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }
.add { border: 0; background: var(--brand); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 15px; }
.field label em { color: var(--muted); font-style: normal; font-weight: 400; font-size: 13px; }
.field input, .field textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #fff; outline: none; width: 100%; box-sizing: border-box; font-size: 16px; }
.field input:focus, .field textarea:focus { border-color: var(--brand); }
.field .ltr-in { text-align: right; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

.summary { margin-top: 16px; }
.summary .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.summary .total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; font-weight: 800; font-size: 18px; }
.empty { color: var(--muted); text-align: center; padding: 6px 0; }
.err { color: var(--warn); font-size: 14px; margin-top: 8px; min-height: 1em; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 0 8px; }

.bar { position: sticky; bottom: 0; background: rgba(247,242,234,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); margin-top: 24px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.bar .wrap { display: flex; align-items: center; gap: 14px; }
.bar .info { flex: 1; min-width: 0; }
.bar .sum { font-weight: 800; font-size: 20px; }
.bar .hint { font-size: 13.5px; color: var(--muted); }
.bar .hint.bad { color: var(--warn); }
.meter { height: 5px; background: var(--line); border-radius: 9px; overflow: hidden; margin-top: 5px; }
.meter i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.meter i.full { background: var(--brand); }

.send { border: 0; background: var(--brand); color: #fff; font-weight: 800; border-radius: 14px; padding: 13px 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font-size: 16px; text-decoration: none; }
.send:disabled { background: #b9c4bb; cursor: not-allowed; }

.done-card { text-align: center; padding: 28px 20px; margin-top: 10px; }
.done-card .big { font-size: 48px; }
.done-card h2 { margin: 6px 0; font-size: 22px; }
.done-card p { color: var(--muted); margin: 0; }
.done-card p b { color: var(--ink); }
.receipt { text-align: start; background: var(--bg); border-radius: 12px; padding: 10px 14px; margin: 16px 0 10px; }
.receipt .line { display: flex; justify-content: space-between; padding: 3px 0; font-size: 15px; }
.receipt .total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; font-weight: 800; }
.done-card .keep { font-size: 13.5px; margin-bottom: 6px; }
.link { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; padding: 8px; }

/* login */
.login { max-width: 400px !important; padding-top: 8vh !important; }
.alert { background: #f7e3dd; color: var(--warn); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.btn-main { width: 100%; border: 0; background: var(--brand); color: #fff; border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; font-size: 16px; }

/* =================================================== admin */
.thumb { width: 52px; height: 52px; border-radius: 10px; background: #efe4d4; display: grid; place-items: center; overflow: hidden; flex: none; font-size: 22px; }
.thumb.lg { width: 84px; height: 84px; font-size: 34px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.faded { opacity: .65; }
ul.lines { margin: 6px 0; padding-inline-start: 20px; font-size: 14.5px; }

/* =================================================== blazor reconnect / error */
#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 2000; box-sizing: border-box; }
#blazor-error-ui .reload { font-weight: 700; margin-inline-start: 8px; }
