/* ==========================================================================
   أبو غوش — التنسيقات
   طابع طازج ونظيف · RTL · متجاوب
   ========================================================================== */
:root {
  --green:      #2e9e3f;
  --green-dark: #1f7d2e;
  --green-soft: #eaf7ec;
  --orange:     #ff8a1e;
  --red:        #e23b3b;
  --ink:        #1d2b21;
  --muted:      #6b7d70;
  --line:       #e4ede6;
  --bg:         #f6faf5;
  --card:       #ffffff;
  --radius:     16px;
  --shadow:     0 6px 22px rgba(30, 80, 40, .08);
  --shadow-hover: 0 10px 30px rgba(30, 80, 40, .16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, 100%); margin-inline: auto; padding-inline: 16px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--green-dark); color: #fff; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding-block: 6px; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button {
  border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff;
  border-radius: 20px; padding: 2px 12px; cursor: pointer; font-family: inherit; font-size: 12px;
}
.lang-switch button.active { background: #fff; color: var(--green-dark); font-weight: 700; }

/* ---------- Header ---------- */
.header { background: var(--card); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.header-inner { display: flex; align-items: center; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { font-size: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { color: var(--green-dark); font-size: 20px; }
.brand-text small { color: var(--muted); font-size: 12px; }

.search { flex: 1; display: flex; max-width: 560px; margin-inline: auto;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 30px; overflow: hidden; }
.search input { flex: 1; border: 0; background: transparent; padding: 11px 18px; font-family: inherit; font-size: 15px; outline: none; }
.search button { border: 0; background: var(--green); color: #fff; padding: 0 20px; font-size: 17px; cursor: pointer; }

.cart-link { position: relative; font-size: 26px; flex-shrink: 0; }
.cart-count {
  position: absolute; top: -6px; inset-inline-end: -8px; background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 10px;
  display: grid; place-items: center; padding: 0 4px;
}

/* ---------- Category bar ---------- */
.catbar { border-top: 1px solid var(--line); background: var(--card); }
.catbar-inner { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.catbar-inner::-webkit-scrollbar { display: none; }
.catchip {
  white-space: nowrap; background: var(--bg); border: 1px solid var(--line);
  padding: 7px 15px; border-radius: 20px; font-size: 14px; font-weight: 600; color: var(--ink);
  transition: .15s;
}
.catchip:hover { border-color: var(--green); color: var(--green-dark); }
.catchip.on { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Slideshow / Hero ---------- */
.slideshow {
  margin-top: 20px; position: relative; border-radius: 22px; overflow: hidden;
  height: clamp(260px, 42vw, 460px); background: var(--green-dark); box-shadow: var(--shadow);
}
.slides { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .8s ease; pointer-events: none;
}
.slide.on { opacity: 1; pointer-events: auto; }
.slide::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.55) 100%); }
.slide-content {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 3; padding: 26px clamp(18px,4vw,44px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
}
.slide-btn { pointer-events: auto; }
.slide-cap {
  color: #fff; font-weight: 800; line-height: 1.3;
  font-size: clamp(18px, 3.6vw, 34px); text-shadow: 0 2px 12px rgba(0,0,0,.7); max-width: 640px;
}
.slide-btn {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--green-dark);
  font-weight: 800; padding: 11px 26px; border-radius: 30px; font-size: 15px; transition: .15s;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.slide-btn:hover { transform: translateY(-2px); background: var(--green-soft); }
/* زر البطل القديم (يُستخدم في السلة الفارغة) */
.hero-btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--green); color: #fff;
  font-weight: 800; padding: 12px 30px; border-radius: 30px; font-size: 16px; transition: .15s;
}
.hero-btn:hover { transform: translateY(-2px); background: var(--green-dark); }
.sl-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--ink); font-size: 26px; line-height: 1;
  display: grid; place-items: center; transition: .15s;
}
.sl-nav:hover { background: #fff; }
.sl-nav.prev { inset-inline-start: 14px; }
.sl-nav.next { inset-inline-end: 14px; }
.dots { position: absolute; bottom: 12px; inset-inline-end: 16px; z-index: 4; display: flex; gap: 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.5); transition: .15s; padding: 0; }
.dot.on { background: #fff; transform: scale(1.25); }

/* ---------- Sections ---------- */
.section { margin-top: 34px; }
.sec-title { font-size: 22px; margin-bottom: 16px; color: var(--ink); }
.back { display: inline-block; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.back:hover { color: var(--green-dark); }
.empty { text-align: center; color: var(--muted); padding: 40px; font-size: 18px; }

/* ---------- Category tiles ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.cat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 10px; text-align: center; font-weight: 700; transition: .15s; box-shadow: var(--shadow);
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--green); }
.cat-ico { display: block; font-size: 40px; margin-bottom: 8px; }

/* بطاقة تصنيف بصورة تملأ المربع + اسم أسفل ظل أخضر متدرج */
.cat-tile.img {
  position: relative; padding: 0; overflow: hidden; aspect-ratio: 1 / 1;
  display: flex; align-items: flex-end; justify-content: center;
  background-size: cover; background-position: center; border-color: transparent;
}
.cat-tile.img::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(31,125,46,.92) 0%, rgba(31,125,46,.65) 28%, rgba(31,125,46,.12) 55%, transparent 78%);
}
.cat-tile-name {
  position: absolute; z-index: 1; inset-inline: 0; bottom: 0; color: #fff; font-weight: 800;
  text-align: center; padding: 0 8px 10px;
  font-size: clamp(14px, 2vw, 17px); text-shadow: 0 1px 6px rgba(0,0,0,.5);
}

/* ---------- Product grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: .15s; border: 1px solid var(--line);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-media {
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green-soft), #fff); overflow: hidden;
}
.card-media .emoji { font-size: clamp(56px, 12vw, 88px); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 10px; inset-inline-start: 10px; background: var(--red); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; z-index: 2;
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-name { font-weight: 700; font-size: 16px; }
.card-name:hover { color: var(--green-dark); }
.card-price { font-size: 15px; margin-top: auto; }
.card-price del { color: var(--muted); font-size: 13px; }
.card-price strong { color: var(--green-dark); font-size: 18px; }
.card-price .unit { color: var(--muted); font-size: 12px; }
.btn-add {
  border: 0; background: var(--green); color: #fff; padding: 10px; border-radius: 12px;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: .15s;
}
.btn-add:hover { background: var(--green-dark); }
.btn-add:active { transform: scale(.96); }
.btn-add.big { padding: 14px 26px; font-size: 16px; }

/* ---------- Product page ---------- */
.product { margin-top: 24px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.product-media {
  position: relative; background: linear-gradient(135deg, var(--green-soft), #fff);
  border-radius: 22px; aspect-ratio: 1/1; display: grid; place-items: center; box-shadow: var(--shadow);
}
.product-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }
.emoji-lg { font-size: clamp(100px, 22vw, 200px); }
.product-info h1 { font-size: 30px; margin-bottom: 12px; }
.product-price { font-size: 20px; margin-bottom: 12px; }
.product-price del { color: var(--muted); font-size: 16px; margin-inline-end: 6px; }
.product-price strong { color: var(--green-dark); font-size: 30px; }
.product-price .unit { color: var(--muted); font-size: 15px; }
.product-cat { color: var(--muted); margin-bottom: 22px; }
.product-info .btn-add { display: inline-block; }
.btn-cart-link { display: inline-block; margin-inline-start: 10px; padding: 14px 22px; border: 1.5px solid var(--green); border-radius: 12px; color: var(--green-dark); font-weight: 700; }

/* ---------- Cart ---------- */
.cart-empty { text-align: center; padding: 60px 0; }
.cart-empty p { font-size: 22px; color: var(--muted); margin-bottom: 18px; }
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.crow {
  display: grid; grid-template-columns: 60px 1fr auto auto auto; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow);
}
.crow-img { font-size: 36px; text-align: center; }
.crow-img img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; margin-inline: auto; }
.crow-name { font-weight: 700; display: flex; flex-direction: column; }
.crow-name small { color: var(--muted); font-weight: 400; font-size: 12px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  font-size: 18px; cursor: pointer; color: var(--green-dark); font-weight: 700;
}
.qty button:hover { background: var(--green-soft); }
.crow-total { font-weight: 800; color: var(--green-dark); min-width: 70px; text-align: center; }
.crow-del { border: 0; background: transparent; font-size: 20px; cursor: pointer; }

.cart-foot { margin-top: 22px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.grand { font-size: 22px; }
.grand strong { color: var(--green-dark); }
.continue-link { color: var(--muted); font-weight: 600; }

/* ---------- WhatsApp button ---------- */
.wa-btn {
  display: inline-flex; align-items: center; gap: 8px; background: #25d366; color: #fff;
  font-weight: 800; padding: 12px 26px; border-radius: 30px; border: 0; font-family: inherit;
  font-size: 15px; cursor: pointer; transition: .15s;
}
.wa-btn:hover { background: #1eb355; transform: translateY(-2px); }
.wa-btn.big { font-size: 18px; padding: 15px 34px; }

/* ---------- Footer ---------- */
.footer { margin-top: 50px; background: var(--green-dark); color: #fff; padding-top: 30px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-bottom: 24px; }
.footer-inner strong { font-size: 18px; }
.footer-inner p { opacity: .9; margin-block: 6px; }
.footer-inner a { color: #fff; }
.footer-copy { border-top: 1px solid rgba(255,255,255,.15); padding-block: 14px; text-align: center; font-size: 13px; opacity: .85; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; inset-inline: 0; margin-inline: auto; width: fit-content;
  background: var(--ink); color: #fff; padding: 12px 24px; border-radius: 30px; font-weight: 700;
  opacity: 0; transform: translateY(20px); transition: .25s; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   الأيقونات SVG وما يتعلق بها
   ========================================================================== */
.ic { display: inline-block; vertical-align: -.16em; flex-shrink: 0; }
.brand-logo { color: var(--green); display: inline-flex; }
.topbar-msg { display: inline-flex; align-items: center; gap: 6px; }
.search button { display: inline-flex; align-items: center; justify-content: center; }
.cart-link { display: inline-flex; align-items: center; color: var(--green-dark); }
.sec-title { display: flex; align-items: center; gap: 8px; }
.sec-title .ic { color: var(--green); }
.catchip, .btn-add, .hero-btn, .wa-btn, .back, .btn-cart-link,
.continue-link, .cat-tile, .product-cat { display: inline-flex; align-items: center; gap: 6px; }
.cat-tile { flex-direction: column; justify-content: center; gap: 8px; }
.back { justify-content: flex-start; }
.catbar-inner .catchip .ic { color: inherit; }

/* أيقونة بديلة للصورة */
.ph-ico { display: grid; place-items: center; color: var(--green); opacity: .5; }
.cat-svg { opacity: 1 !important; }
.cat-img { object-fit: cover; border-radius: 8px; vertical-align: -.3em; }
.cat-ico .cat-img { border-radius: 14px; }
.catchip .cat-img { border-radius: 6px; }
.ph-ico .cat-svg { opacity: .9 !important; }
.card-media .ph-ico, .product-media .ph-ico { width: 100%; height: 100%; }
.cat-ico { color: var(--green-dark); display: inline-grid; place-items: center; }
.big-ico { color: var(--green); opacity: .5; display: block; margin-bottom: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px; font-size: 18px; }
.empty .ic { color: var(--green); opacity: .5; }

/* الشارات: خصم / نفد */
.badge { display: inline-flex; align-items: center; gap: 3px; }
.badge.out { background: var(--muted); }
.low { background: #fff3e0; color: var(--orange); font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px; margin-inline-start: 8px; }

/* بطاقة نافدة المخزون */
.card.is-out .card-media { filter: grayscale(.5); opacity: .7; }
.btn-add:disabled { background: var(--muted); cursor: not-allowed; }
.btn-add:disabled:hover { background: var(--muted); }

.crow-img { display: grid; place-items: center; color: var(--green); }
.crow-img .ph-ico { width: 44px; height: 44px; }

/* نموذج إتمام الطلب */
.checkout { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.checkout .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(560px, 100%); }
.checkout input {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px;
  font-family: inherit; font-size: 15px; background: var(--card); outline: none;
}
.checkout input:focus { border-color: var(--green); }

/* ---------- شاهد المزيد + قسم التصنيف ---------- */
.sec-link { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.sec-link:hover { color: var(--green-dark); }
.more-wrap { text-align: center; margin-top: 18px; }
.more-btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft);
  color: var(--green-dark); font-weight: 800; padding: 11px 26px; border-radius: 30px;
  border: 1.5px solid var(--green); transition: .15s;
}
.more-btn:hover { background: var(--green); color: #fff; }

/* ---------- خريطة جوجل ---------- */
.map-wrap {
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
  aspect-ratio: 21 / 9; background: var(--green-soft);
}
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--green-dark);
  font-weight: 700;
}
.map-link:hover { text-decoration: underline; }
@media (max-width: 600px) { .map-wrap { aspect-ratio: 4 / 3; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .brand-text small { display: none; }
  .sl-nav { width: 34px; height: 34px; font-size: 22px; }
  .product-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .crow { grid-template-columns: 44px 1fr auto; grid-template-areas: "img name total" "img qty del"; row-gap: 6px; }
  .crow-img { grid-area: img; } .crow-name { grid-area: name; } .qty { grid-area: qty; }
  .crow-total { grid-area: total; text-align: end; } .crow-del { grid-area: del; }
  .btn-cart-link { margin: 12px 0 0; }
  .checkout .fields { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card-name { font-size: 14px; }
}
