/* VOICE: friendly local market for Rahat, clear and practical for shop owners and shoppers
   IDEA: a market street of shop fronts with striped awnings, one per shop
   PICTURE: awning row in the header band; each shop card wears its own awning
   COLOUR and TYPE: deep souk teal fields, white ground, saffron accent; Cairo + Tajawal
   LAYOUT: role bar on top, then one working view (customer / shop / admin) */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0d1716);
  --card: light-dark(#f4f7f6, #15211f);
  --ink: light-dark(#122321, #e8efed);
  --mute: light-dark(#566866, #9fb2ae);
  --teal: #0f5c4d;
  --teal2: light-dark(#0f5c4d, #3fae96);
  --saf: #f2a81d;
  --red: #c0392b;
  --line: light-dark(#d9e3e0, #26332f);
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
  min-width: 0;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.55 Tajawal,
    Tahoma,
    sans-serif;
  overflow-x: clip;
}
h1,
h2,
h3 {
  font-family: Cairo, Tajawal, sans-serif;
  line-height: 1.15;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 800;
}
h2 {
  font-size: 23px;
  font-weight: 800;
}
h3 {
  font-size: 18px;
  font-weight: 600;
}
.band {
  padding: clamp(20px, 3.5vw, 44px) max(5vw, 16px);
}
.wrap {
  max-width: 1240px;
  margin: auto;
}
.top {
  background: var(--teal);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.top .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px max(5vw, 16px);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.lg1 {
  font:
    34px Lalezar,
    Cairo,
    sans-serif;
  color: #fff;
}
.lg2 {
  font:
    800 20px Tajawal,
    sans-serif;
  color: var(--saf);
}
.heroPin {
  display: flex;
  justify-content: center;
  padding-bottom: 24px;
}
.heroPin svg {
  width: min(220px, 40vw);
  height: auto;
  filter: drop-shadow(0 10px 18px #0005);
}
.roles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.roles button {
  background: transparent;
  color: #fff;
  border: 1.5px solid #ffffff66;
}
.roles button.on {
  background: var(--saf);
  color: #1b1300;
  border-color: var(--saf);
}
button,
.btn {
  font:
    700 16px Tajawal,
    sans-serif;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 0;
  background: var(--teal2);
  color: light-dark(#fff, #06120f);
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
button.warn {
  background: var(--red);
  color: #fff;
}
button.saf {
  background: var(--saf);
  color: #1b1300;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
:focus-visible {
  outline: 3px solid var(--saf);
  outline-offset: 2px;
}
input,
select,
textarea {
  font:
    16px Tajawal,
    sans-serif;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
label {
  display: block;
  font-weight: 700;
  margin: 10px 0 4px;
}
.hero {
  background: var(--teal);
  color: #fff;
  padding-bottom: 0;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: end;
}
.hero p {
  font-size: 17px;
  color: #d8ece7;
  max-width: 46ch;
}
.street {
  width: 100%;
  height: auto;
  display: block;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.card .in {
  padding: 14px 16px;
}
.awn {
  height: 34px;
  background: repeating-linear-gradient(90deg, var(--c) 0 26px, #fff 26px 52px);
  -webkit-mask: radial-gradient(14px at 50% 100%, #0000 98%, #000) 0 0/26px 100%;
  mask: radial-gradient(14px at 50% 100%, #0000 98%, #000) 0 0/26px 100%;
}
.cover {
  height: 150px;
  background: var(--c) center/cover no-repeat;
}
.meta {
  color: var(--mute);
  font-size: 14px;
}
.price {
  font-weight: 800;
  white-space: nowrap;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.sp {
  flex: 1;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tabs button {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.tabs button.on {
  background: var(--ink);
  color: var(--bg);
}
.shopview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}
.cart {
  position: sticky;
  top: 80px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.prods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.prods.list {
  grid-template-columns: minmax(0, 1fr);
}
.prods.list .prod {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}
.prods.list .prod > * {
  grid-column: 2;
}
.prods.list .prod > img,
.prods.list .prod > .ph {
  grid-column: 1;
  grid-row: 1 / span 5;
  width: 90px;
}
.prods.list .prod > button {
  grid-column: 3;
  grid-row: 1 / span 5;
}
.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.steps i {
  flex: 1;
  height: 6px;
  border-radius: 9px;
  background: var(--line);
}
.steps i.on {
  background: var(--saf);
}
.prod {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prod img,
.ph {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--line);
}
.ph {
  display: grid;
  place-items: center;
  font-size: 34px;
}
.phone {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: var(--saf);
  color: #1b1300;
  font:
    800 20px Cairo,
    sans-serif;
  padding: 8px 16px;
  border-radius: 12px;
  text-decoration: none;
}
.ads {
  overflow: hidden;
  background: var(--ink);
  color: var(--bg);
  position: sticky;
  top: 64px;
  z-index: 4;
}
.ads .track {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  padding: 9px 0;
  animation: mv 22s linear infinite;
  width: max-content;
}
.ads span {
  font-weight: 700;
}
.ads .big {
  font-size: 22px;
}
.ads .blink {
  animation: bl 1s steps(1) infinite;
  padding: 2px 10px;
  border-radius: 6px;
}
@keyframes mv {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes bl {
  0% {
    background: #000;
    color: #fff;
  }
  50% {
    background: #fff;
    color: #000;
  }
}
.pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--line);
}
.pill.ok {
  background: #d7f0e8;
  color: #0b4a3d;
}
.pill.wait {
  background: #fdecc8;
  color: #6a4500;
}
.pill.stop {
  background: #f8d7d3;
  color: #7a1d12;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}
th {
  font-size: 14px;
  color: var(--mute);
}
.num {
  text-align: end;
  white-space: nowrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.stat b {
  display: block;
  font:
    800 clamp(24px, 4vw, 32px) Cairo,
    sans-serif;
}
.bar {
  height: 10px;
  border-radius: 9px;
  background: var(--saf);
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--mute);
  background: var(--card);
  border-radius: 14px;
  border: 1px dashed var(--line);
}
.chk {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chk label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 500;
  margin: 0;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.chk input {
  width: auto;
  min-height: auto;
}
.toast {
  position: fixed;
  bottom: 18px;
  inset-inline: 0;
  margin: auto;
  width: max-content;
  max-width: 92vw;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.25s;
  z-index: 30;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.note {
  font-size: 13px;
  color: var(--mute);
}
.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 14px;
}
.scroll {
  overflow-x: auto;
}
.fbox {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
}
.fhide {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
}
.ghost-b {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.fbox:focus-within .ghost-b {
  outline: 3px solid var(--saf);
  outline-offset: 2px;
}
.modal {
  position: fixed;
  inset: 0;
  background: #000a;
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 16px;
}
.modal > div,
.modal > form {
  background: var(--bg);
  color: var(--ink);
  border-radius: 16px;
  padding: 20px;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
}
.modal > .welcome {
  text-align: center;
  background: var(--teal);
  color: #fff;
  padding: 32px 20px;
}
.welcome h2 {
  font-size: 30px;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  padding: 0 6px;
  margin-inline-start: 6px;
}
@media (max-width: 860px) {
  .shopview {
    grid-template-columns: minmax(0, 1fr);
  }
  .cart {
    position: static;
  }
}
@media (max-width: 600px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  table {
    font-size: 13px;
  }
  .stack thead {
    display: none;
  }
  .stack tr {
    display: grid;
    padding-block: 10px;
  }
  .stack td {
    display: flow-root;
    border: 0;
    padding: 3px 0;
    padding-inline-start: 7em;
    text-align: start;
  }
  .stack td::before {
    content: attr(data-l);
    float: inline-start;
    width: 6.5em;
    margin-inline-start: -7em;
    color: var(--mute);
  }
  .stack td:empty {
    display: none;
  }
  .ads {
    top: 110px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
  .ads .track {
    animation: none;
    flex-wrap: wrap;
    white-space: normal;
    padding-inline: 16px;
  }
  .ads .blink {
    animation: none;
    background: #000;
    color: #fff;
  }
}
.cartbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px max(5vw, 16px) calc(10px + env(safe-area-inset-bottom));
  background: var(--teal);
  color: #fff;
  box-shadow: 0 -4px 18px #0004;
  font-size: 17px;
}
.cartbar .cbp {
  color: var(--saf);
}
.cartbar button {
  min-height: 44px;
}
body:has(.cartbar) {
  padding-bottom: 76px;
}
body:has(.cartbar) .toast {
  bottom: 92px;
}
