:root {
  --green: #1a514b;
  --green-2: #1d7164;
  --mint: #12b195;
  --mint-soft: #e6f6f2;
  --ink: #17231f;
  --muted: #64736e;
  --bg: #f4f6f5;
  --card: #fff;
  --line: #e2e8e5;
  --amber: #f0954b;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: "Tajawal", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.ic { width: 20px; height: 20px; flex: none; }

/* أزرار */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid transparent;
  font: 700 15px/1.4 inherit; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn-line { border-color: var(--line); background: #fff; color: var(--green); }
.btn-line:hover { border-color: var(--mint); }
.btn-wa { background: #1fae5b; color: #fff; }
.btn-wa:hover { background: #17994e; }
.btn-main { background: var(--green); color: #fff; padding: 12px 34px; }
.btn-main:hover { background: var(--green-2); }
.btn-lg { padding: 13px 26px; font-size: 17px; }

/* الهيدر */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand b { display: block; font-size: 19px; font-weight: 800; color: var(--green); line-height: 1.25; white-space: nowrap; }
.brand small { display: block; font-size: 11px; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; }
.top-actions { display: flex; gap: 8px; }

/* الواجهة */
.hero { padding: 22px 0 6px; }
.slider { position: relative; border-radius: 24px; overflow: hidden; }
.slides { display: flex; transition: transform .55s cubic-bezier(.4, 0, .2, 1); touch-action: pan-y; }
.slide { flex: 0 0 100%; min-width: 0; }
.hero-box {
  background: linear-gradient(120deg, var(--green) 0%, #14403b 100%);
  color: #fff; padding: 40px 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  position: relative; overflow: hidden;
}
.dots { position: absolute; bottom: 12px; inset-inline-start: 0; inset-inline-end: 0; display: flex; justify-content: center; gap: 7px; z-index: 2; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: rgba(255, 255, 255, .5); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); transition: width .25s, background .25s; }
.dot.on { width: 26px; border-radius: 999px; background: var(--mint); }

/* شريحة الخريطة */
.map-slide {
  position: relative; border: 0; padding: 0; cursor: pointer; font-family: inherit; text-align: start;
  background-color: #e9ecef; background-size: cover; background-position: center;
  display: flex; align-items: center;
}
.map-slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(26, 81, 75, .9) 0%, rgba(26, 81, 75, .7) 28%, rgba(26, 81, 75, 0) 52%); }
.map-pin { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -54px 0 0 -27px; color: #d9482b; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.map-pin svg { width: 100%; height: 100%; position: relative; }
.map-pin i { position: absolute; left: 50%; top: 100%; width: 22px; height: 10px; margin: -7px 0 0 -11px; border-radius: 50%; background: rgba(217, 72, 43, .45); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(3.2); opacity: 0; } }
.map-card { position: relative; z-index: 1; color: #fff; padding: 40px 44px; max-width: 420px; display: flex; flex-direction: column; gap: 4px; }
.map-card b { font-size: clamp(24px, 3.6vw, 36px); font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.map-place { font-size: 17px; font-weight: 700; }
.map-addr { font-size: 14.5px; color: #cfe3de; }
.map-btn { align-self: flex-start; margin-top: 16px; background: var(--mint); color: #0d2b27; pointer-events: none; }
.map-btn .ic { width: 18px; height: 18px; }
.map-slide:hover .map-btn { background: #0fa087; }
.map-credit { position: absolute; bottom: 6px; inset-inline-end: 10px; font-size: 10.5px; color: #4a5a55; background: rgba(255, 255, 255, .75); padding: 0 6px; border-radius: 4px; }

/* قائمة تطبيقات الملاحة */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(13, 30, 27, .55); }
.sheet-box {
  position: relative; width: min(440px, 100%); background: #fff; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 8px;
  animation: sheet-up .25s ease-out;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-title { text-align: center; font-size: 17px; font-weight: 800; color: var(--green); margin-bottom: 4px; }
.nav-app { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 14px; font-weight: 700; font-size: 16px; }
.nav-app:hover { border-color: var(--mint); background: var(--mint-soft); }
.nav-app small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.nav-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.nav-ic svg { width: 26px; height: 26px; }
.nav-google { background: #eef3fd; }
.nav-apple { background: #f1f1f3; color: #1d1d1f; }
.nav-waze { background: #e7f6fb; color: #05c8f7; }
.nav-geo { background: var(--mint-soft); color: var(--green-2); }
.sheet-cancel { border: 0; background: var(--bg); border-radius: 14px; padding: 12px; font: 700 16px inherit; font-family: inherit; color: var(--muted); cursor: pointer; margin-top: 4px; }
@media (min-width: 761px) {
  .sheet { align-items: center; }
  .sheet-box { border-radius: 22px; padding-bottom: 16px; }
}
.hero-box::after {
  content: ""; position: absolute; inset-inline-end: -90px; top: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(18, 177, 149, .35), transparent);
}
.hero-text { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(27px, 4.4vw, 44px); font-weight: 800; line-height: 1.3; }
.hero-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; }
.hero-tags li {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  padding: 5px 16px; border-radius: 999px; font-weight: 500; font-size: 15.5px;
}
.hero-addr { display: flex; align-items: center; gap: 7px; color: #cfe3de; font-size: 15.5px; }
.hero-addr .ic { color: var(--mint); }
.hero-logo {
  position: relative; z-index: 1; width: 170px; height: 170px; object-fit: contain; flex: none;
  background: #fff; border-radius: 50%; padding: 22px;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .08);
}

/* أدوات القائمة */
.shop { padding: 22px 0 60px; }
.tools { display: flex; gap: 10px; margin-bottom: 14px; }
.search {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 18px; color: var(--muted);
}
.search:focus-within { border-color: var(--mint); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 16px inherit; font-family: inherit; padding: 12px 0; color: var(--ink); }
#sort {
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  padding: 0 16px; font: 500 15px inherit; font-family: inherit; color: var(--ink); cursor: pointer;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 16px; font: 700 14.5px inherit; font-family: inherit; cursor: pointer;
}
.chip small { color: var(--muted); font-weight: 500; margin-inline-start: 2px; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip.on small { color: #b9d9d2; }
.count { color: var(--muted); font-size: 14.5px; margin: 6px 2px 12px; }

/* البطاقات */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(26, 81, 75, .12); border-color: var(--mint); }
.card-img { position: relative; display: block; aspect-ratio: 1; background: #fff; border-bottom: 1px solid var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.noimg { background: #fff url(logo-mark.png) center / 42% no-repeat; }
.noimg.card-img, .noimg.gallery-main { background-color: #f7faf9; }
.tag {
  position: absolute; top: 10px; inset-inline-start: 10px; font-style: normal;
  font-size: 12.5px; font-weight: 700; padding: 2px 11px; border-radius: 999px; color: #fff;
}
.tag-out { background: #7c8985; }
.tag-sale { background: #d9482b; }
.card.is-out .card-img img { opacity: .5; }
.card-link { display: flex; flex-direction: column; flex: 1; }
.card-link .card-name { margin: 12px 14px 0; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 8px 14px 14px; }
.card-name {
  font-weight: 500; font-size: 15px; line-height: 1.55; direction: auto; unicode-bidi: plaintext; text-align: start;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.1em;
}
.card-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-price b { color: var(--green); font-size: 17.5px; font-weight: 800; }
.card-price s, .pd-price s { color: var(--muted); font-size: 13.5px; }
.ask { color: var(--green-2) !important; font-size: 15px !important; }
.none, .empty { text-align: center; color: var(--muted); padding: 50px 16px; }
.empty b { display: block; font-size: 22px; color: var(--green); margin-bottom: 6px; }
.empty a { color: var(--green-2); font-weight: 700; }
.more { text-align: center; margin-top: 26px; }

/* صفحة المنتج */
.pd { padding: 20px 0 60px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--green-2); font-weight: 700; margin-bottom: 16px; }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.gallery-main { background: #fff; border: 1px solid var(--line); border-radius: 20px; aspect-ratio: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: none; width: 72px; height: 72px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px; cursor: pointer; }
.thumb.on { border-color: var(--mint); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-brand { display: inline-block; background: var(--mint-soft); color: var(--green-2); font-weight: 700; font-size: 13.5px; padding: 2px 14px; border-radius: 999px; margin-bottom: 10px; }
.pd-info h1 { font-size: clamp(21px, 2.6vw, 28px); font-weight: 800; line-height: 1.5; unicode-bidi: plaintext; text-align: start; }
.pd-price { display: flex; align-items: baseline; gap: 12px; margin: 14px 0 6px; }
.pd-price b { font-size: 30px; font-weight: 800; color: var(--green); }
.pd-price s { font-size: 17px; }
.pd-price small { color: var(--muted); font-size: 15px; }
.pd-en { color: var(--muted); font-size: 14.5px; text-align: end; margin-top: 2px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.specs div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; }
.specs dt { color: var(--muted); font-size: 13px; }
.specs dd { font-weight: 700; font-size: 15px; unicode-bidi: plaintext; text-align: start; }
.stock { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.stock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.stock.in { color: #17994e; }
.stock.out { color: #b0483a; }
.pd-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0 22px; }
.pd-desc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.pd-desc h2 { font-size: 18px; font-weight: 800; color: var(--green); margin-bottom: 8px; }
.pd-desc div { color: #33423d; unicode-bidi: plaintext; text-align: start; overflow-wrap: anywhere; }
.pd-desc ul, .pd-desc ol { padding-inline-start: 22px; }
.pd-desc li + li { margin-top: 3px; }
.pd-desc p + p { margin-top: 8px; }
.rel-title { font-size: 22px; font-weight: 800; color: var(--green); margin: 44px 0 16px; }

/* الفوتر */
.foot { background: var(--green); color: #dcebe7; margin-top: 10px; }
.foot-in { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 40px 0 28px; align-items: start; }
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-logo { background: #fff; border-radius: 50%; padding: 10px; flex: none; }
.foot-logo img { width: 54px; height: 54px; object-fit: contain; }
.foot-brand b { font-size: 20px; font-weight: 800; color: #fff; }
.foot-brand p { color: #b9d9d2; font-size: 15px; }
.foot-list { list-style: none; display: grid; gap: 10px; }
.foot-list li { display: flex; align-items: center; gap: 10px; }
.foot-list .ic { color: var(--mint); }
.foot-list a:hover { color: #fff; text-decoration: underline; }
.foot-copy { border-top: 1px solid rgba(255, 255, 255, .12); padding: 16px 0 20px; font-size: 14px; color: #a9cbc4; text-align: center; }

@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .top-in { height: 62px; }
  .brand img { width: 40px; height: 40px; }
  .brand b { font-size: 16px; }
  .brand small { font-size: 9.5px; }
  .top-actions .btn { padding: 9px; }
  .top-actions .btn span { display: none; }
  .slider { border-radius: 20px; }
  .hero-box { padding: 28px 22px; }
  .hero-logo { display: none; }
  .map-slide { align-items: flex-end; min-height: 340px; background-size: auto 120%; background-position: 50% calc(50% - 60px); }
  .map-pin { top: calc(50% - 60px); }
  .map-slide::before { background: linear-gradient(0deg, rgba(26, 81, 75, .9) 0%, rgba(26, 81, 75, .6) 45%, rgba(26, 81, 75, 0) 75%); }
  .map-card { padding: 22px 22px 30px; max-width: none; }
  .map-addr { display: none; }
  .map-btn { margin-top: 10px; }
  .hero-tags li { font-size: 14px; padding: 4px 13px; }
  .tools { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  #sort { flex: 1; padding: 10px 16px; }
  .card-name { font-size: 14px; }
  .card-price b { font-size: 16px; }
  .card-link .card-name { margin: 10px 11px 0; }
  .card-body { padding: 6px 11px 12px; gap: 8px; }
  .top-actions { gap: 6px; }
  .specs { grid-template-columns: 1fr; }
  .cart-ctl-lg, .pd-cta .cart-off { flex-basis: 100%; }
  .pd-grid, .foot-in { grid-template-columns: 1fr; gap: 20px; }
  .pd-cta .btn { flex: 1; }
  .pd-price b { font-size: 26px; }
}

/* ============================ السلة ============================ */
.btn-cart { position: relative; background: var(--green); color: #fff; }
.btn-cart:hover { background: var(--green-2); }
.cart-n {
  position: absolute; top: -6px; inset-inline-start: -6px; min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: 999px; background: var(--amber); color: #fff; border: 2px solid #fff;
  font: 800 12px/17px inherit; font-family: inherit; font-style: normal; text-align: center;
}

/* زر الإضافة والعدّاد */
.cart-ctl { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.btn-add { width: 100%; background: var(--mint-soft); color: var(--green); border-color: transparent; padding: 8px 12px; font-size: 14.5px; }
.btn-add:hover { background: var(--mint); color: #fff; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--mint); border-radius: 999px; background: #fff; overflow: hidden; }
.qty button { width: 36px; height: 36px; border: 0; background: none; cursor: pointer; font: 700 20px/1 inherit; font-family: inherit; color: var(--green); }
.qty button:hover { background: var(--mint-soft); }
.qty b { min-width: 28px; text-align: center; font-weight: 800; font-size: 15.5px; }
.in-cart { color: var(--green-2); font-weight: 700; font-size: 13.5px; }
.cart-off { color: #b0483a; font-weight: 700; font-size: 14px; min-height: 40px; display: flex; align-items: center; }
.cart-ctl-lg .btn-add { width: auto; padding: 13px 30px; font-size: 17px; background: var(--green); color: #fff; }
.cart-ctl-lg .btn-add:hover { background: var(--green-2); }
.cart-ctl-lg .qty button { width: 46px; height: 46px; }
.cart-ctl-lg .qty b { min-width: 38px; font-size: 18px; }

/* لوحة السلة */
.cart { position: fixed; inset: 0; z-index: 60; }
.cart-bg { position: absolute; inset: 0; background: rgba(13, 30, 27, .55); }
.cart-box {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(430px, 100%);
  background: var(--bg); display: flex; flex-direction: column; animation: cart-in .25s ease-out;
  box-shadow: 0 0 40px rgba(0, 0, 0, .25);
}
@keyframes cart-in { from { transform: translateX(-60px); opacity: 0; } }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.cart-head b { font-size: 19px; font-weight: 800; color: var(--green); }
.cart-x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--bg); font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.cart-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.cart-empty b { display: block; font-size: 20px; color: var(--green); margin-bottom: 6px; }
.cart-note { text-align: center; color: var(--muted); font-size: 14.5px; padding: 10px; }
.ci { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.ci-img { flex: none; width: 76px; height: 76px; border-radius: 10px; border: 1px solid var(--line); background-color: #fff; overflow: hidden; }
.ci-img img { width: 100%; height: 100%; object-fit: contain; }
.ci-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ci-name { font-weight: 700; font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-price { color: var(--muted); font-size: 13.5px; }
.ci-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ci-row .qty button { width: 32px; height: 32px; font-size: 18px; }
.ci-sum { color: var(--green); font-weight: 800; font-size: 15.5px; }
.ci-del { margin-inline-start: auto; border: 0; background: none; color: #b0483a; font: 700 13.5px inherit; font-family: inherit; cursor: pointer; padding: 6px; }
.ci.is-out { background: #fbf6f5; }
.ci.is-out .ci-price { color: #b0483a; }
.ci.is-out .ci-img { opacity: .5; }
.cart-foot { background: #fff; border-top: 1px solid var(--line); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; }
.cart-total b { font-size: 24px; font-weight: 800; color: var(--green); }
.cart-clear { border: 0; background: none; color: var(--muted); font: 500 14px inherit; font-family: inherit; cursor: pointer; text-decoration: underline; justify-self: center; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: var(--green); color: #fff; font-weight: 700; padding: 10px 24px; border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .25); animation: sheet-up .2s ease-out;
}
