/* متجر Cetara — نفس ألوان cetara.app (فاتح افتراضي + ليلي) */
:root {
  --bg: #EDF2F0; --surface: #FFFFFF; --surface-2: #F5F9F8; --surface-3: #EEF4F2;
  --text: #0E1F1C; --mut: #4C605C; --subtle: #8A9E99;
  --line: #DCE6E3; --line-strong: #C9D8D4;
  --teal: #0E6E6A; --teal-hi: #0E7C77; --teal-soft: rgba(14,110,106,.10); --on-teal: #fff;
  --wa: #128C4A; --err: #9B3324;
  --sh: 0 10px 30px rgba(18,51,58,.10);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #091513; --surface: #10201D; --surface-2: #16302C; --surface-3: #1B3B36;
  --text: #E7EEEC; --mut: #A9BBB6; --subtle: #84968F;
  --line: #213531; --line-strong: #2C433E;
  --teal: #2FA9A2; --teal-hi: #43C0B8; --teal-soft: rgba(47,169,162,.16); --on-teal: #06231F;
  --wa: #2BB673; --err: #F49A90;
  --sh: 0 10px 30px rgba(0,0,0,.40);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 "IBM Plex Sans Arabic", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ── header ── */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top__row { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { border-radius: 10px; }
.brand span { display: flex; flex-direction: column; line-height: 1.25; }
.brand b { font-size: 17px; }
.brand small { color: var(--mut); font-size: 12px; }
.search { flex: 1; min-width: 0; }
.search input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface-2); outline: none;
}
.search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.top__acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.link-site { color: var(--mut); font-size: 13px; padding: 6px 8px; }
.link-site:hover { color: var(--teal); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--mut);
}
.icon-btn:hover { color: var(--teal); }
.cart-btn {
  position: relative; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border-radius: 10px; background: var(--teal); color: var(--on-teal); font-weight: 600;
}
.cart-btn:hover { background: var(--teal-hi); }
.cart-btn em {
  font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--surface); color: var(--teal); font-size: 12px; font-weight: 700; display: grid; place-items: center;
}

.cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--mut); font-size: 14px; cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on { background: var(--teal); border-color: var(--teal); color: var(--on-teal); font-weight: 600; }

/* ── list ── */
.hero {
  margin: 20px 0 8px; padding: 22px; border-radius: 16px; background: var(--teal); color: var(--on-teal);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.hero h1 { margin: 0; font-size: 22px; }
.hero p { margin: 4px 0 0; opacity: .85; }
.hero__pts { display: flex; flex-wrap: wrap; gap: 8px; }
.hero__pts span { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 13px; }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; }
.bar h2 { margin: 0; font-size: 19px; }
.bar small { color: var(--mut); font-weight: 400; font-size: 14px; margin-inline-start: 6px; }
.bar select {
  height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
}
.subs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 30px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: var(--sh); border-color: var(--line-strong); }
.card__img { aspect-ratio: 1; background: #fff; display: grid; place-items: center; padding: 14px; }
.card__img img { width: 100%; height: 100%; object-fit: contain; }
.card__body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__brand { color: var(--subtle); font-size: 12px; }
.card__name { font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-weight: 700; font-size: 17px; color: var(--teal); white-space: nowrap; }
.add {
  border: 0; border-radius: 9px; background: var(--teal-soft); color: var(--teal); font-weight: 600;
  padding: 7px 12px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.add:hover { background: var(--teal); color: var(--on-teal); }
.empty { text-align: center; color: var(--mut); padding: 60px 0; }
.more { display: block; margin: 0 auto 30px; }

/* ── product page ── */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--mut); font-size: 13px; margin: 18px 0; }
.crumbs a:hover { color: var(--teal); }
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; margin-bottom: 30px; }
.gal { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.gal__main { aspect-ratio: 1; display: grid; place-items: center; }
.gal__main img { width: 100%; height: 100%; object-fit: contain; }
.gal__thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.gal__thumbs button { width: 64px; height: 64px; padding: 4px; border-radius: 10px; border: 2px solid #e4ecea; background: #fff; cursor: pointer; }
.gal__thumbs button.on { border-color: var(--teal); }
.gal__thumbs img { width: 100%; height: 100%; object-fit: contain; }
.info h1 { font-size: 22px; line-height: 1.5; margin: 4px 0 10px; }
.info .brand-tag { color: var(--mut); font-size: 14px; }
.info .price { font-size: 28px; }
.buy { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty button { width: 38px; height: 42px; border: 0; background: transparent; cursor: pointer; font-size: 18px; color: var(--mut); }
.qty button:hover { color: var(--teal); }
.qty input { width: 46px; height: 42px; border: 0; text-align: center; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn {
  height: 44px; padding: 0 20px; border-radius: 10px; border: 0; cursor: pointer; font-weight: 600;
  background: var(--teal); color: var(--on-teal); display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:hover { background: var(--teal-hi); }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { filter: brightness(1.08); background: var(--wa); }
.note { color: var(--mut); font-size: 13px; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-top: 16px; }
.sec h3 { margin: 0 0 10px; font-size: 16px; }
.sec p { margin: 0; color: var(--mut); white-space: pre-line; }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs th, .specs td { text-align: start; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.specs tr:first-child th, .specs tr:first-child td { border-top: 0; }
.specs th { color: var(--mut); font-weight: 500; width: 38%; }
.specs td { direction: ltr; text-align: right; unicode-bidi: plaintext; }

/* ── cart ── */
.cart { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin: 20px 0 30px; align-items: start; }
.lines { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line__img { width: 72px; height: 72px; background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--line); }
.line__img img { width: 100%; height: 100%; object-fit: contain; }
.line__name { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line__sub { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.line__sub .qty button, .line__sub .qty input { height: 34px; }
.line__sub .qty button { width: 32px; }
.line__sum { font-weight: 700; white-space: nowrap; }
.rm { border: 0; background: none; color: var(--err); cursor: pointer; font-size: 13px; padding: 4px; }
.sum { position: sticky; top: 130px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sum h3 { margin: 0; }
.sum__row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mut); }
.field input, .field textarea {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; background: var(--surface-2); outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }

/* ── our system (no price) ── */
:root[data-theme="light"] .on-dark, :root[data-theme="dark"] .on-light { display: none; }
.chip--sys { border-color: var(--teal); color: var(--teal); font-weight: 600; }
.sys {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: center;
  margin: 16px 0 6px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.sys__shot { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.sys__shot img { width: 100%; height: auto; }
.sys__tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 600; }
.sys h2 { margin: 8px 0 6px; font-size: 20px; line-height: 1.5; }
.sys p { margin: 0; color: var(--mut); }
.sys__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gal--sys { background: var(--surface); }
.gal--sys .gal__main { aspect-ratio: auto; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.gal--sys .gal__main img { height: auto; }
.gal--sys .gal__thumbs button { width: 74px; height: 50px; padding: 2px; background: var(--surface-2); border-color: var(--line); }
.gal--sys .gal__thumbs button.on { border-color: var(--teal); }
.gal--sys .gal__thumbs img { object-fit: cover; border-radius: 6px; }
.gal__cap { margin: 10px 0 0; font-size: 14px; color: var(--mut); }
.gal__cap b { color: var(--text); }
.lead { color: var(--mut); margin: 0; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.plan span { color: var(--mut); font-size: 13px; }
.ticks { margin: 12px 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.ticks li::before { content: "✓"; color: var(--teal); font-weight: 700; margin-inline-end: 8px; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.feat p { margin: 4px 0 0; color: var(--mut); font-size: 14px; }
.sec--hw { margin-bottom: 30px; }
.sec--hw .buy { margin: 12px 0 0; }

/* ── footer / toast ── */
.foot { background: var(--surface); border-top: 1px solid var(--line); padding: 22px 0; color: var(--mut); font-size: 14px; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.foot b { color: var(--text); }
.foot p { margin: 4px 0 0; }
.foot__links { display: flex; flex-direction: column; gap: 4px; }
.foot__links a:hover { color: var(--teal); }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px;
  transition: .2s; z-index: 50; max-width: calc(100% - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .pdp, .cart, .sys { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .sum { position: static; }
}
@media (max-width: 640px) {
  .top__row { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .top__acts { margin-inline-start: auto; }
  .link-site, .brand small, .cart-btn span { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card__foot { flex-direction: column; align-items: stretch; }
  .add { padding: 8px; }
  .hero { padding: 16px; }
  .hero h1 { font-size: 19px; }
}
