:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #f1f3f7;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e6e8ee;
  --brand: #5b2a86;
  --brand-dark: #4a2168;
  --brand-soft: #f3ecf8;
  --price: #b4231f;
  --wa: #25d366;
  --wa-dark: #1ebe5b;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(31, 36, 48, 0.08);
  --maxw: 1200px;
  --header-h: 66px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: .18s ease; font-size: 15px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); transform: translateY(-1px); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.wa-icon { flex: none; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--brand); }
.brand img { height: 60px; }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 15px; }
.nav a:hover, .nav a.active { color: var(--brand); }
.search { margin-inline-start: auto; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; min-width: 200px; background: #fff; }
.search input { border: 0; outline: 0; font: inherit; font-size: 14px; width: 100%; background: transparent; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-btn { border: 0; background: #fff; color: var(--muted); padding: 6px 10px; font-size: 13px; cursor: pointer; font-weight: 600; }
.lang-btn.is-active { background: var(--brand); color: #fff; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ===== Hero ===== */
.hero { background: linear-gradient(120deg, #f3ecf8, #ffffff 60%); padding: 54px 0; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.badge { display: inline-block; background: var(--brand-soft); color: var(--brand); font-weight: 700;
  font-size: 13px; padding: 5px 12px; border-radius: 999px; letter-spacing: .03em; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.15; margin: 14px 0; }
.hero .lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; max-width: 42ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { list-style: none; display: flex; gap: 28px; padding: 0; margin: 32px 0 0; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 24px; color: var(--brand); }
.hero-stats span { color: var(--muted); font-size: 14px; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ===== Section ===== */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0; }

/* ===== Category cards ===== */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cat-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff;
  transition: .18s ease; display: block; }
.cat-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.cat-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.cat-body { padding: 14px 16px 18px; }
.cat-body h3 { margin: 0 0 4px; font-size: 17px; }
.cat-body p { margin: 0; color: var(--muted); font-size: 13px; }

/* ===== Product grid (shared) ===== */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff;
  display: flex; flex-direction: column; transition: .18s ease; }
.product-card:hover { box-shadow: var(--shadow); }
.product-thumb { position: relative; aspect-ratio: 1/1; background: var(--surface-2); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stock-badge { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--wa); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.product-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-body h3 { margin: 0; font-size: 14.5px; line-height: 1.35; min-height: 2.7em; }
.product-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.product-meta b { color: var(--text); font-weight: 600; }
.product-price { margin-top: 4px; }
.product-price .from { font-size: 12px; color: var(--muted); }
.product-price .amt { font-size: 20px; font-weight: 800; color: var(--price); }
.product-price .per { font-size: 12px; color: var(--muted); }
.product-actions { display: flex; gap: 8px; margin-top: 8px; }
.product-actions .btn { flex: 1; justify-content: center; padding: 8px 10px; font-size: 13px; }
.product-supply { font-size: 12px; color: var(--brand); text-align: center; margin-top: 2px; }

/* ===== Filter bar ===== */
.filterbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.filterbar .count { color: var(--muted); font-size: 14px; }
.select { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font: inherit; background: #fff; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

/* ===== Pagination ===== */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 30px; }
.pager .btn { min-width: 96px; justify-content: center; }
.pager .pagenum { font-size: 14px; color: var(--muted); }

/* ===== Breadcrumb ===== */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumb a:hover { color: var(--brand); }

/* ===== Category banner ===== */
.cat-banner { background: linear-gradient(120deg, var(--brand), var(--brand-dark)); color: #fff; padding: 34px 0; }
.cat-banner .small { font-size: 13px; opacity: .85; letter-spacing: .04em; text-transform: uppercase; }
.cat-banner h1 { font-size: clamp(24px, 3.4vw, 34px); margin: 6px 0 0; }

/* ===== Product detail ===== */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.gallery .main-img { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1/1; background: var(--surface-2); }
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.thumbs img.active { border-color: var(--brand); }
.detail-info h1 { font-size: 26px; margin: 0 0 10px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { font-size: 12px; background: var(--brand-soft); color: var(--brand); padding: 3px 10px; border-radius: 999px; }
.detail-spec-row { display: flex; gap: 8px; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.detail-spec-row .k { color: var(--muted); min-width: 96px; }
.detail-price { margin: 16px 0; }
.detail-price .amt { font-size: 30px; font-weight: 800; color: var(--price); }
.detail-price .from { color: var(--muted); font-size: 13px; }
.detail-cta { display: flex; gap: 12px; margin: 18px 0; }
.detail-cta .btn { flex: 1; justify-content: center; }
.detail-desc { margin-top: 18px; color: #374151; }
.detail-block { margin-top: 26px; }
.detail-block h2 { font-size: 20px; margin: 0 0 12px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 10px 12px; border: 1px solid var(--border); font-size: 14px; }
.spec-table td:first-child { background: var(--surface); color: var(--muted); width: 40%; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ===== Features ===== */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.feature .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); color: #fff;
  display: grid; place-items: center; margin: 0 auto 12px; font-size: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ===== CTA band ===== */
.cta-band { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 36px; text-align: center; }
.cta-band h2 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); }
.cta-band p { margin: 0 0 20px; color: rgba(255,255,255,.85); }

/* ===== Footer ===== */
.site-footer { background: #15171f; color: #cbd5e1; padding: 40px 0 24px; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer-brand { display: grid; gap: 10px; }
.footer-brand .brand { color: #fff; }
.footer-brand p { margin: 0; color: #94a3b8; font-size: 14px; max-width: 32ch; }
.footer-col h4 { margin: 0 0 12px; color: #fff; font-size: 15px; }
.footer-col a { display: block; color: #cbd5e1; font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; }
.footer-col .wa { color: var(--wa); font-weight: 600; }
.footer-copy { grid-column: 1 / -1; border-top: 1px solid #262a36; margin-top: 18px; padding-top: 16px;
  color: #64748b; font-size: 13px; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-inner, .detail { grid-template-columns: 1fr; }
  .product-grid, .related-grid, .cat-grid, .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-media { order: -1; }
}
@media (max-width: 760px) {
  .nav { position: absolute; top: var(--header-h); inset-inline: 0; background: #fff; flex-direction: column;
    gap: 0; border-bottom: 1px solid var(--border); display: none; padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; }
  .search { display: none; }
  .lang-switch { display: none; }
  .nav-toggle { display: flex; }
}
@media (max-width: 520px) {
  .product-grid, .related-grid, .cat-grid, .feature-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-stats { gap: 16px; }
}

/* ===== RTL (Arabic) ===== */
[dir="rtl"] .nav { margin-inline-start: 0; margin-inline-end: auto; }
[dir="rtl"] .search { margin-inline-start: 0; margin-inline-end: auto; }
[dir="rtl"] .product-meta, [dir="rtl"] .detail-spec-row { padding: 0; }
