/* المعرض العام: واجهة الزبون. اللون من هوية المحل (--brand) والخط Cairo. */
body {
  background: var(--bg);
}
.boot,
.state {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.state-card {
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: 420px;
}
.state-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.wrap {
  width: min(1200px, 100%);
  margin-inline: auto;
  padding-inline: 16px;
}
.notice {
  background: var(--brand);
  color: var(--brand-ink);
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 7px 16px;
}
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, calc((100% - 1200px) / 2 + 16px));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.logo img,
.logo .mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: contain;
  flex: none;
}
.logo .mark {
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 900;
  font-size: 20px;
}
.logo > span {
  display: grid;
  line-height: 1.25;
  min-width: 0;
}
.logo b {
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logo small {
  color: var(--muted);
  font-size: 12px;
}
.bar-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
.cart-btn {
  position: relative;
  min-width: 48px;
}
.cart-btn .count {
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--err);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
}
.cart-btn .count[hidden] {
  display: none;
}

/* الواجهة */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000));
  color: #fff;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero.has-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.15));
}
.hero-text {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  margin-inline: auto;
  padding: 44px 16px 30px;
  display: grid;
  gap: 8px;
}
.hero.has-img .hero-text {
  padding-top: 120px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
}
.hero p {
  max-width: 640px;
  opacity: 0.92;
  font-size: 16px;
}
.info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
  font-size: 13.5px;
  font-weight: 700;
}
.info .icon {
  width: 16px;
  height: 16px;
}
.closed {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
  text-align: center;
  padding: 12px 16px;
}

/* البحث والأقسام */
.filters {
  position: sticky;
  top: 63px;
  z-index: 15;
  background: var(--bg);
  padding: 12px max(16px, calc((100% - 1200px) / 2 + 16px)) 8px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search .icon {
  position: absolute;
  inset-inline-start: 14px;
  color: var(--muted);
}
.search input {
  padding-inline-start: 44px;
  min-height: 48px;
  border-radius: 99px;
  font-size: 16px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* المنتجات */
#grid {
  padding-block: 18px 110px;
  display: grid;
  gap: 24px;
}
.featured h2 {
  font-size: 19px;
  margin-bottom: 10px;
}
.hscroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 210px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.hscroll .pcard {
  scroll-snap-align: start;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s, transform 0.18s;
}
.pcard:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.pcard.out {
  opacity: 0.62;
}
.pimg {
  position: relative;
  aspect-ratio: 1;
  background: var(--brand-soft);
  border: 0;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pinitial {
  font-size: 34px;
  font-weight: 900;
  color: var(--brand);
}
.off {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: var(--err);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 2px 9px;
  border-radius: 99px;
}
.pbody {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.pname {
  background: none;
  border: 0;
  padding: 0;
  text-align: start;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pattrs {
  color: var(--muted);
  font-size: 12.5px;
}
.pfoot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  flex-wrap: wrap;
}
.price {
  font-weight: 900;
  font-size: 16px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.price small {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}
.price s {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.price.big {
  font-size: 24px;
  align-items: center;
}
.add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 99px;
  border: 0;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
  cursor: pointer;
}
.add .icon {
  width: 18px;
  height: 18px;
}
.mini-step {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--brand-soft);
  border-radius: 99px;
  padding: 2px;
}
.mini-step button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--surface);
  color: var(--brand);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.mini-step button .icon {
  width: 16px;
  height: 16px;
}
.mini-step b {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
}
.soldout {
  color: var(--err);
  font-weight: 800;
  font-size: 13px;
}
.soldout.big {
  font-size: 16px;
}
.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

/* شريط السلة السفلي */
.cart-bar {
  position: fixed;
  z-index: 25;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 24px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}
.cart-bar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cart-bar[hidden] {
  display: none;
}

/* تفاصيل المنتج */
.pd {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.pd .close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  background: var(--surface);
  border-radius: 50%;
}
.pd-img {
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  min-height: 300px;
}
.pd-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pd-body {
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.pd-body h2 {
  font-size: 22px;
  padding-inline-end: 40px;
}
.desc {
  color: var(--ink-2);
  white-space: pre-line;
}
.specs {
  margin: 0;
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.specs div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.specs div:last-child {
  border-bottom: 0;
}
.specs dt {
  color: var(--muted);
}
.specs dd {
  margin: 0;
  font-weight: 700;
}
.pd-buy {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.grow {
  flex: 1;
}
.stepper-lg {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
}
.stepper-lg button {
  width: 48px;
  height: 52px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--brand);
}
.stepper-lg output {
  min-width: 64px;
  text-align: center;
  font-weight: 800;
  font-size: 17px;
}
@media (max-width: 680px) {
  .pd {
    grid-template-columns: 1fr;
  }
  .pd-img {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .pd-body {
    padding: 18px;
  }
}

/* السلة والطلب */
.clines {
  display: grid;
}
.cline {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  grid-template-areas: 'img info total' 'img step step';
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cl-img {
  grid-area: img;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
}
.cl-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cl-img .pinitial {
  font-size: 16px;
}
.cl-info {
  grid-area: info;
  display: grid;
  line-height: 1.35;
}
.cline .mini-step {
  grid-area: step;
  justify-self: start;
}
.cl-total {
  grid-area: total;
}
.sum-row,
.sum-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.sum-total {
  font-size: 19px;
  font-weight: 900;
  padding-top: 6px;
}
.quote {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.quote:empty {
  display: none;
}
.coupon {
  display: flex;
  gap: 8px;
}
.coupon input {
  flex: 1;
}
.pay-opts {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 14px 10px;
  margin: 0;
  display: grid;
}
.pay-opts legend {
  font-weight: 800;
  padding: 0 6px;
  font-size: 14px;
}
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.seg-btn.on {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow);
}
p.hint {
  background: var(--info-soft);
  color: var(--info);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  white-space: pre-line;
}

/* تأكيد الطلب */
.done {
  text-align: center;
  justify-items: center;
}
.done .sum-total {
  width: 100%;
  border-top: 1px solid var(--line);
}
.done-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: grid;
  place-items: center;
}
.done-icon .icon {
  width: 42px;
  height: 42px;
  stroke-width: 3;
}
.code {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--brand);
}
.actions.center {
  justify-content: center;
}

/* التتبع */
.track-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 560px) {
  .track-form {
    grid-template-columns: 1fr;
  }
}
.recent {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.recent .chip {
  min-height: 32px;
  direction: ltr;
}
.track {
  display: grid;
  gap: 12px;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--muted);
  font-weight: 700;
}
.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  inset-inline-start: 13px;
  top: 36px;
  height: calc(100% - 28px);
  width: 2px;
  background: var(--line);
}
.steps li.past::after {
  background: var(--brand);
}
.steps .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--surface);
  display: grid;
  place-items: center;
  flex: none;
}
.steps .dot .icon {
  width: 15px;
  height: 15px;
  stroke-width: 3;
}
.steps li.past,
.steps li.now {
  color: var(--ink);
}
.steps li.past .dot,
.steps li.now .dot {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.steps li.now .dot {
  box-shadow: 0 0 0 5px var(--brand-soft);
}
.order-items {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 4px;
  font-size: 14px;
}
.order-items li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* التذييل */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px 120px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.foot p {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  margin-top: 4px;
}
.foot .icon {
  width: 17px;
  height: 17px;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.foot-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .pbody {
    padding: 8px 10px 10px;
  }
  .pname {
    font-size: 14px;
  }
  .price {
    font-size: 15px;
  }
  .add span {
    display: none;
  }
  .add {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  .hide-xs {
    display: none;
  }
  .hero-text {
    padding: 30px 16px 22px;
  }
  .hero.has-img .hero-text {
    padding-top: 90px;
  }
}
