:root {
  --green-900: #1b5e20;
  --green-700: #2e7d32;
  --green-600: #43a047;
  --green-500: #4caf50;
  --green-100: #e8f5e9;
  --orange-600: #fb8c00;
  --orange-500: #ff9800;
  --orange-100: #fff3e0;
  --red-600: #e53935;
  --ink: #1c1f1a;
  --ink-soft: #5b6058;
  --line: #e3e8e1;
  --bg: #f6f9f4;
  --card: #ffffff;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 16px rgba(27, 94, 32, 0.08);
  --shadow-hover: 0 10px 26px rgba(27, 94, 32, 0.15);
}

* { box-sizing: border-box; }

.icon {
  display: inline-block;
  vertical-align: -4px;
  flex-shrink: 0;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Tajawal", "Cairo", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Top utility bar ===== */
.top-bar {
  background: var(--green-900);
  color: #fff;
  font-size: 13px;
}
.top-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 34px;
}
.top-bar a { color: #fff; opacity: 0.95; display: flex; align-items: center; gap: 6px; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  color: var(--green-700);
  flex-shrink: 0;
}
.logo .logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.logo small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
}

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 4px;
  min-width: 0;
}
.search-form input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: var(--ink);
}
.search-form button {
  background: var(--green-600);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--green-700);
}
.icon-btn .badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--orange-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ===== Category nav bar ===== */
.cat-nav {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cat-nav-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
}
.cat-nav-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.cat-chip span.ic { display: inline-flex; align-items: center; }
.cat-chip.active,
.cat-chip:hover {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}

/* ===== Hero / offers slider ===== */
.hero {
  position: relative;
  margin: 16px auto 0;
  max-width: 1180px;
  padding: 0 16px;
}
.hero-viewport {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background .2s, width .2s;
}
.hero-dot.active {
  background: var(--green-700);
  width: 22px;
}
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: center;
  background: var(--green-100);
}
.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(10,20,10,0) 0%, rgba(10,20,10,0.35) 55%, rgba(10,20,10,0.72) 100%);
}
.hero-slide-content {
  position: relative;
  z-index: 1;
  padding: 28px 30px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.25);
  max-width: 60%;
}
.hero-slide-content .eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(2px);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}
.hero-slide-content h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 4vw, 32px);
}
.hero-slide-content p {
  margin: 0 0 14px;
  font-size: 14px;
  opacity: 0.95;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-600);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn.btn-green { background: var(--green-700); }
.btn.btn-outline {
  background: #fff;
  color: var(--green-700);
  border: 1.5px solid var(--green-700);
  box-shadow: none;
}
.btn.btn-block { width: 100%; justify-content: center; }
.btn.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ===== Section headings ===== */
.section {
  padding: 30px 0 6px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 {
  font-size: 20px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head .see-all {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green-700);
}

/* ===== Category grid on home ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.cat-card {
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 14px 8px;
  text-align: center;
  transition: box-shadow .15s, transform .15s;
}
.cat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.cat-card img { width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 10px; }
.cat-card span { font-size: 12.5px; font-weight: 700; display: block; line-height: 1.3; }

/* ===== Product grid & card ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.product-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--green-100);
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red-600);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
}
.product-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  min-height: 40px;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.price {
  font-size: 17px;
  font-weight: 800;
  color: var(--green-700);
}
.price .unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.old-price {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-decoration: line-through;
}
.add-btn {
  margin-top: auto;
  background: var(--green-700);
  color: #fff;
  border-radius: 10px;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s;
}
.add-btn:hover { background: var(--green-900); }
.add-btn.added { background: var(--orange-600); }
.add-btn:disabled {
  background: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
}
.product-badge.out-of-stock { background: var(--ink-soft); }

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 14px 0 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--green-700); font-weight: 600; }

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 20px;
}
.page-title-row h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  margin: 0;
}
.page-title-row .count {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ===== Product detail page ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 20px 0 40px;
  align-items: start;
}
.product-detail-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--green-100);
  box-shadow: var(--shadow);
}
.product-detail-info h1 {
  font-size: 26px;
  margin: 0 0 10px;
}
.product-detail-info .cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.product-detail-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 18px;
}
.product-detail-price .price { font-size: 30px; }
.product-detail-info p.desc {
  color: var(--ink-soft);
  line-height: 1.9;
  font-size: 14.5px;
  margin-bottom: 22px;
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.qty-stepper button {
  width: 42px;
  height: 42px;
  background: var(--bg);
  font-size: 18px;
  font-weight: 700;
  color: var(--green-700);
}
.qty-stepper button:disabled,
.qty-stepper input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.qty-stepper input {
  width: 48px;
  height: 42px;
  text-align: center;
  border: none;
  border-inline: 1.5px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
}
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.feature-list {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ===== Cart page ===== */
.cart-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 26px;
  align-items: start;
  padding: 10px 0 50px;
}
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
}
.cart-item-thumb {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--green-100);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h3 { margin: 0 0 4px; font-size: 15px; }
.cart-item-info .unit-label { font-size: 12.5px; color: var(--ink-soft); }
.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.cart-item-actions .line-total { font-weight: 800; color: var(--green-700); }
.remove-link {
  font-size: 12.5px;
  color: var(--red-600);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.qty-stepper.small button { width: 32px; height: 32px; font-size: 15px; }
.qty-stepper.small input { width: 36px; height: 32px; font-size: 13px; }

.summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 90px;
}
.summary-card h3 { margin: 0 0 16px; font-size: 17px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--ink-soft);
}
.summary-row.total {
  color: var(--ink);
  font-weight: 800;
  font-size: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 6px;
}
.summary-row.total .price { color: var(--green-700); }
.summary-card textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
  font-size: 13.5px;
  resize: vertical;
  min-height: 64px;
  margin: 14px 0;
}
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-state .em-icon { display: flex; justify-content: center; color: var(--line); margin-bottom: 14px; }

/* ===== Footer ===== */
.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,0.9);
  margin-top: 50px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 30px;
  padding: 40px 0 20px;
}
.footer-grid h4 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.footer-grid ul li { margin-bottom: 9px; font-size: 13.5px; opacity: 0.9; }
.footer-grid p { font-size: 13.5px; line-height: 1.8; opacity: 0.9; margin: 0 0 14px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 16px;
  text-align: center;
  font-size: 12.5px;
  opacity: 0.8;
}
.wa-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
}

/* ===== Floating WhatsApp button ===== */
.wa-float {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 60;
  background: #25D366;
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 100;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Empty search / no results ===== */
.no-results {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
}
.no-results .icon { color: var(--line); margin-bottom: 10px; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cart-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .top-bar .container { font-size: 11.5px; }
  .header-row { flex-wrap: wrap; }
  .logo { order: 1; }
  .header-actions { order: 2; margin-inline-start: auto; }
  .search-form { order: 3; flex-basis: 100%; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-detail { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; padding: 30px 0 10px; }
  .hero-slide-content { max-width: 80%; padding: 20px; }
  .hero-slide { min-height: 160px; }
  .section-head h2 { font-size: 17px; }
}

@media (max-width: 420px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
