/* ============================================================
   Mathaq Al-Asala — main stylesheet
   Tokens derived from the company logo: deep teal, bright orange,
   olive green, on a warm off-white ground.
   Built with CSS logical properties so ar/ku (RTL) and en (LTR)
   share one stylesheet with no mirrored duplicate rules.
   ============================================================ */

:root {
  --teal-900: #06373d;
  --teal-800: #0a4d55;
  --teal-700: #0d6169;
  --teal-500: #0e8a93;
  --teal-100: #e3f0ef;

  --orange-600: #e06b06;
  --orange-500: #f2760a;
  --orange-100: #fdead6;

  --olive-600: #6d8f22;
  --olive-500: #7fa82a;
  --olive-100: #eef4e0;

  --cream: #faf7f1;
  --cream-deep: #f2ede2;
  --ink-900: #1c231f;
  --ink-700: #3d443f;
  --ink-500: #656d66;
  --line: #e2dccd;
  --white: #ffffff;

  --font: "Cairo", "Noto Kufi Arabic", sans-serif;

  --container: 1180px;
  --radius-s: 4px;
  --radius-m: 10px;
}

/* Kurdish (Sorani) reads better in a font tuned for the full Arabic-script
   range — Cairo's Kurdish letterforms (ڕ ژ چ پ ڵ ڤ گ) are thin/inconsistent
   at small sizes. Noto Sans Arabic covers them cleanly on any screen. */
html[lang="ku"] { --font: "Noto Sans Arabic", "Cairo", sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 28px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

:focus-visible {
  outline: 2.5px solid var(--orange-500);
  outline-offset: 3px;
}

/* ---------- Section rhythm ---------- */
section { padding-block: 92px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teal-700);
  margin-block-end: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--orange-500);
  display: inline-block;
}
h1, h2, h3 { font-weight: 800; line-height: 1.22; margin: 0; color: var(--teal-900); }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); max-width: 20ch; }
p { margin: 0; }
.lede { font-size: 1.08rem; color: var(--ink-700); max-width: 56ch; margin-block-start: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 46px; height: 46px; }
.brand-name { font-weight: 800; font-size: 1.05rem; color: var(--teal-900); line-height: 1.2; }
.brand-name small { display: block; font-weight: 600; font-size: 0.72rem; color: var(--ink-500); }

.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink-700);
  padding-block: 4px;
  border-block-end: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.main-nav a:hover { color: var(--teal-800); border-color: var(--orange-500); }

.header-tools { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 30px 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-800);
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'><path d='M5 8l5 5 5-5' stroke='%230d6169' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 10px center;
  background-size: 12px;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.lang-switch:focus { outline: none; border-color: var(--teal-500); }
[dir="rtl"] .lang-switch { padding: 7px 16px 7px 30px; background-position: left 10px center; }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block-start: 64px;
  padding-block-end: 80px;
  overflow: hidden;
  color: var(--white);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  inset: 0;
}
.hero::before {
  background-image: var(--hero-image, url("../images/iStock-1488883191-scaled.jpg"));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  animation: heroZoom 16s ease-in-out infinite alternate;
  z-index: 0;
}
.hero::after {
  background: linear-gradient(120deg, rgba(6, 55, 61, 0.9) 0%, rgba(6, 55, 61, 0.68) 45%, rgba(6, 55, 61, 0.32) 100%);
  z-index: 1;
}
@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.14); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
}
.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero .eyebrow { color: #ffcf9e; }
.hero-copy h1 { font-size: clamp(2.3rem, 4.3vw, 3.5rem); max-width: 15ch; color: var(--white); }
.hero-copy .lede { max-width: 46ch; color: #dcece9; }
.hero-cta { display: flex; gap: 16px; margin-block-start: 30px; flex-wrap: wrap; }
.hero .btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: var(--white); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange-500); color: var(--white); }
.btn-primary:hover { background: var(--orange-600); }
.btn-ghost { background: transparent; border-color: var(--teal-700); color: var(--teal-800); }
.btn-ghost:hover { background: var(--teal-100); }

.hero-stats {
  display: flex;
  gap: 34px;
  margin-block-start: 44px;
  padding-block-start: 28px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.25);
  flex-wrap: wrap;
}
.hero-stat .num { font-size: 1.55rem; font-weight: 800; color: var(--white); display: block; }
.hero-stat .label { font-size: 0.82rem; color: #b9d4d2; margin-block-start: 2px; }

/* Hero visual: rotating product ads, with the badge underneath */
.hero-visual { position: relative; width: 100%; max-width: 470px; margin-inline-start: auto; }
.hero-ads {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--teal-900);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.hero-ad {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s;
  color: var(--white);
}
.hero-ad.active { opacity: 1; visibility: visible; }
.hero-ad img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 4.5s ease; }
.hero-ad.active img { transform: scale(1); }
.hero-ad::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 55, 61, 0) 35%, rgba(6, 55, 61, 0.92) 100%);
}
.hero-ad-body { position: absolute; inset-inline: 0; inset-block-end: 0; padding: 24px 24px 40px; z-index: 1; }
.hero-ad-label {
  display: inline-block;
  background: var(--orange-500);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}
.hero-ad h3 { color: var(--white); font-size: 1.45rem; margin-block: 10px 4px; }
.hero-ad p { color: #dcece9; font-size: 0.9rem; }
.hero-ad-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: 14px; flex-wrap: wrap; }
.hero-ad-price { font-size: 1.2rem; font-weight: 800; color: #ffcf9e; }
.hero-ad-cta { font-size: 0.86rem; font-weight: 700; color: var(--white); border-block-end: 1.5px solid var(--orange-500); }
[dir="rtl"] .hero-ad-cta { unicode-bidi: plaintext; }
.hero-ad-dots { position: absolute; inset-block-end: 14px; inset-inline: 0; display: flex; justify-content: center; gap: 7px; z-index: 2; }
.hero-ad-dots button {
  width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px;
  background: rgba(255, 255, 255, 0.45); cursor: pointer; transition: width 0.25s ease, background 0.25s ease;
}
.hero-ad-dots button.active { width: 22px; background: var(--orange-500); }

.hero-badge {
  margin-block-start: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px 16px;
  box-shadow: 0 14px 34px -18px rgba(6, 55, 61, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--olive-500); flex-shrink: 0; }
.hero-badge span { font-size: 0.82rem; font-weight: 700; color: var(--ink-700); }

/* ---------- About ---------- */
.about { background: var(--white); border-block: 1px solid var(--line); }
.about .container { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 64px; }
.about-text .lede { color: var(--ink-700); margin-block-start: 18px; }
.about-text p + p { margin-block-start: 14px; }
.about-points { display: flex; flex-direction: column; gap: 0; }
.about-point {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  padding-block: 22px;
  border-block-end: 1px solid var(--line);
}
.about-point:first-child { padding-block-start: 4px; }
.about-point .idx { font-weight: 800; color: var(--orange-500); font-size: 1.05rem; }
.about-point h3 { font-size: 1.05rem; color: var(--teal-900); margin-block-end: 6px; }
.about-point p { color: var(--ink-700); font-size: 0.95rem; }

/* ---------- Categories: editorial offset grid, not identical cards ---------- */
.categories .container > .lede { margin-block-end: 46px; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 128px;
  gap: 14px;
}
.cat-card {
  grid-column: span 3;
  grid-row: span 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--white);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.cat-card:hover { border-color: var(--teal-500); transform: translateY(-3px); }
.cat-card:nth-child(1) { grid-column: span 4; grid-row: span 2; background: var(--teal-900); border-color: var(--teal-900); }
.cat-card:nth-child(1) h3, .cat-card:nth-child(1) p { color: var(--white); }
.cat-card:nth-child(1) .cat-icon { color: var(--orange-500); }
.cat-card:nth-child(2) { grid-column: span 2; grid-row: span 2; background: var(--olive-100); border-color: var(--olive-500); }
.cat-card:nth-child(3) { grid-column: span 3; }
.cat-card:nth-child(4) { grid-column: span 3; }
.cat-card:nth-child(5) { grid-column: span 3; }
.cat-card:nth-child(6) { grid-column: span 3; }

.cat-icon { width: 30px; height: 30px; color: var(--teal-700); }
.cat-card h3 { font-size: 1.05rem; margin-block-end: 4px; }
.cat-card p { font-size: 0.86rem; color: var(--ink-500); }
.cat-card:nth-child(1) p { color: #cfe7e5; }

.products-heading { font-size: 1.1rem; color: var(--teal-900); margin-block: 48px 18px; }

/* Product grid: every product, shown at once */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.product-card { flex: 0 0 100%; width: 100%; }
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--teal-800);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(6, 55, 61, 0.4);
  z-index: 2;
}
.carousel-nav:hover { border-color: var(--teal-500); color: var(--teal-700); }
.carousel-nav.prev { inset-inline-start: 0; }
.carousel-nav.next { inset-inline-end: 0; }

.product-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.product-card:hover { border-color: var(--teal-500); transform: translateY(-3px); }
.product-img { aspect-ratio: 4 / 3; background: var(--cream); overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { padding: 14px 16px 18px; }
.product-cat { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--orange-600); }
.product-body h4 { font-size: 0.98rem; margin-block: 5px 4px; color: var(--teal-900); }
.product-body p { font-size: 0.84rem; color: var(--ink-500); }
.product-price { display: block; margin-block-start: 10px; font-size: 0.95rem; font-weight: 800; color: var(--teal-800); }

@media (max-width: 620px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-body { padding: 12px 12px 14px; }
}

/* ---------- Process ---------- */
.process { background: var(--teal-900); color: var(--white); }
.process .eyebrow { color: var(--orange-500); }
.process .eyebrow::before { background: var(--orange-500); }
.process h2 { color: var(--white); }
.process-steps {
  margin-block-start: 50px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.process-step {
  padding-inline-end: 28px;
  border-inline-start: 1.5px solid rgba(255,255,255,0.18);
  padding-inline-start: 26px;
  position: relative;
}
.process-step:first-child { border-inline-start: none; padding-inline-start: 0; }
.process-step .step-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--orange-500);
  display: block;
  margin-block-end: 14px;
}
.process-step h3 { color: var(--white); font-size: 1.08rem; margin-block-end: 8px; }
.process-step p { color: #b9d4d2; font-size: 0.9rem; }

/* ---------- Contact ---------- */
.contact .container { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 60px; }
.contact-info { display: flex; flex-direction: column; gap: 22px; margin-block-start: 30px; }
.info-row { display: flex; gap: 16px; align-items: flex-start; }
.info-row .icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--teal-100); color: var(--teal-700);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.info-row .icon svg { width: 19px; height: 19px; }
.info-row .label { font-size: 0.78rem; color: var(--ink-500); font-weight: 600; }
.info-row .value { font-size: 1.02rem; font-weight: 700; color: var(--teal-900); margin-block-start: 2px; }
.info-row .value a { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.contact-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field label { display: block; font-size: 0.86rem; font-weight: 700; color: var(--teal-900); margin-block-end: 7px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.96rem;
  background: var(--cream);
  color: var(--ink-900);
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal-500); background: var(--white); }
.form-note { font-size: 0.8rem; color: var(--ink-500); }
.form-status { font-size: 0.88rem; font-weight: 700; color: var(--olive-600); display: none; }
.form-status.show { display: block; }
.form-status.error { color: var(--orange-600); }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-900); color: #cfe0de; padding-block-start: 40px; border-block-start: 4px solid var(--orange-500); }
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  padding-block-end: 30px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.14);
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 34px; height: 34px; }
.footer-brand .tagline { font-size: 0.86rem; color: #9dbab7; }
.footer-nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; font-size: 0.88rem; font-weight: 600; }
.footer-nav a { color: #cfe0de; }
.footer-nav a:hover { color: var(--orange-500); }
.footer-contact-btn { padding: 10px 22px; font-size: 0.88rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 22px;
  font-size: 0.82rem;
  color: #9dbab7;
}
.footer-bottom-links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.footer-bottom-links a { color: #cfe0de; }
.footer-bottom-links a:hover { color: var(--orange-500); }
.footer-credit a { font-weight: 700; }

@media (max-width: 620px) {
  .footer-top, .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Single product page ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-700); font-weight: 700; font-size: 0.9rem; margin-block: 30px 10px; }
.back-link:hover { color: var(--orange-600); }
.product-detail { padding-block-end: 70px; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding-block-start: 20px; }
.product-detail-img { border-radius: var(--radius-m); overflow: hidden; aspect-ratio: 4 / 3; background: var(--cream); }
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-detail-info h1 { font-size: 2rem; margin-block: 10px 14px; color: var(--teal-900); }
.product-detail-note { font-size: 1.02rem; color: var(--ink-700); margin-block-end: 20px; }
.product-detail-price { display: block; font-size: 1.5rem; font-weight: 800; color: var(--teal-800); margin-block-end: 26px; }
.product-missing { font-size: 1.1rem; color: var(--ink-500); padding-block: 60px 20px; text-align: center; }

@media (max-width: 760px) {
  .product-detail-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about .container, .contact .container { grid-template-columns: 1fr; gap: 40px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .cat-card, .cat-card:nth-child(1), .cat-card:nth-child(2), .cat-card:nth-child(3),
  .cat-card:nth-child(4), .cat-card:nth-child(5), .cat-card:nth-child(6) {
    grid-column: span 1; grid-row: span 1; min-height: 150px;
  }
  .process-steps { grid-template-columns: 1fr 1fr; gap: 30px; }
  .process-step { border-inline-start: none; padding-inline-start: 0; padding-block-start: 22px; border-block-start: 1.5px solid rgba(255,255,255,0.18); }
  .process-step:nth-child(1), .process-step:nth-child(2) { border-block-start: none; padding-block-start: 0; }
}

@media (max-width: 760px) {
  section { padding-block: 60px; }
  .main-nav { position: fixed; inset-inline: 0; top: 70px; background: var(--cream); flex-direction: column; align-items: flex-start; padding: 22px 28px; gap: 18px; border-block-end: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: 0.18s ease; }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); cursor: pointer; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { max-width: none; margin-block-start: 8px; }
  .hero-ads { aspect-ratio: 4 / 3.4; }
  .hero-ad h3 { font-size: 1.2rem; }
  .hero-badge { position: static; max-width: none; box-shadow: none; margin-block-start: 14px; }
  .process-steps { grid-template-columns: 1fr; }
  .process-step { border-inline-start: none !important; padding-inline-start: 0 !important; border-block-start: 1.5px solid rgba(255,255,255,0.18) !important; padding-block-start: 22px !important; }
  .process-step:first-child { border-block-start: none !important; padding-block-start: 0 !important; }

  .container { padding-inline: 18px; }
  .site-header .container { gap: 10px; }
  .brand { gap: 8px; }
  .brand img { width: 36px; height: 36px; }
  .brand-name { font-size: 0.92rem; }
  .brand-name small { display: none; }
  .header-tools { gap: 8px; }
  .lang-switch { padding: 6px 24px 6px 12px; font-size: 0.76rem; background-position: right 8px center; }
  [dir="rtl"] .lang-switch { padding: 6px 12px 6px 24px; background-position: left 8px center; }
  .nav-toggle { width: 36px; height: 36px; }
}
