/* ==========================================================
   Wafarli.world — main stylesheet (RTL, Arabic)
   ========================================================== */
:root {
  --green-900: #0b3d30;
  --green-700: #0f6e55;
  --green-500: #19a67d;
  --green-100: #e3f5ee;
  --gold-500: #f4a62a;
  --gold-100: #fff3dc;
  --coral-500: #ef6b57;
  --ink: #15211d;
  --muted: #5b6b66;
  --line: #e2e8e5;
  --bg: #f7faf8;
  --white: #ffffff;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 61, 48, .08);
  --shadow-lg: 0 20px 50px rgba(11, 61, 48, .14);
  --container: 1160px;
  --font: "Segoe UI", "Noto Kufi Arabic", "Geeza Pro", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-500); }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; color: var(--green-900); }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--white); padding: 8px 14px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { inset-inline-start: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; color: var(--green-900); }
.logo img { width: 42px; height: 42px; }
.logo small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); line-height: 1.2; }
.main-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 14px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--green-100); color: var(--green-700); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; transition: .2s; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 48px; background: radial-gradient(1200px 400px at 85% -10%, var(--green-100), transparent 70%), radial-gradient(800px 300px at 0% 10%, var(--gold-100), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-grid > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow-lg); }
.hero .eyebrow { display: inline-block; background: var(--white); border: 1px solid var(--line); padding: 4px 14px; border-radius: 999px; font-size: .85rem; color: var(--green-700); font-weight: 700; margin-bottom: 14px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.hero-stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div { background: var(--white); border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow); }
.hero-stats strong { display: block; font-size: 1.4rem; color: var(--green-700); }
.hero-stats span { font-size: .85rem; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 999px; font-weight: 700; border: 0; cursor: pointer; font-family: inherit; font-size: 1rem; transition: transform .15s, box-shadow .15s, background .15s; }
.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { background: var(--green-900); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: var(--white); color: var(--green-900); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--green-500); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Sections & cards ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head p { color: var(--muted); margin: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; border: 1px solid var(--line); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media { aspect-ratio: 16 / 9; background: var(--green-100); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-tag { font-size: .78rem; font-weight: 700; color: #c2412d; margin-bottom: 6px; }
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card h3 a { color: var(--green-900); }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.card .more { margin-top: auto; font-weight: 700; font-size: .92rem; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: var(--white); border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); }
.feature .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--green-100); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); font-size: .93rem; margin: 0; }

.cta-band { background: linear-gradient(135deg, var(--green-900), var(--green-700)); color: var(--white); border-radius: 24px; padding: 40px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: #cfe9df; margin: 0; }
.cta-band .btn { background: var(--gold-500); color: var(--green-900); }

/* ---------- Article ---------- */
.breadcrumbs { font-size: .88rem; color: var(--muted); padding: 18px 0 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { margin: 0 6px; }
.article-hero { padding: 24px 0 8px; }
.article-hero h1 { max-width: 900px; }
.article-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.article-cover { margin: 0; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--white); }
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding: 40px 0 64px; }
.prose { background: var(--white); border-radius: 24px; padding: 40px 44px; border: 1px solid var(--line); }
.prose h2 { margin-top: 1.6em; padding-top: .2em; scroll-margin-top: 90px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose figure { margin: 28px 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.prose .lead { font-size: 1.12rem; color: #33443f; }
.tip, .note, .warn { border-radius: var(--radius-sm); padding: 16px 20px; margin: 22px 0; border-inline-start: 5px solid; }
.tip { background: var(--green-100); border-color: var(--green-500); }
.note { background: var(--gold-100); border-color: var(--gold-500); }
.warn { background: #fdecea; border-color: var(--coral-500); }
.tip strong, .note strong, .warn strong { display: block; margin-bottom: 4px; color: var(--green-900); }
.tip p:last-child, .note p:last-child, .warn p:last-child { margin: 0; }
.table-wrap { overflow-x: auto; margin: 22px 0; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
th, td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--green-100); color: var(--green-900); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.checklist { list-style: none; padding: 0 !important; }
.checklist li { position: relative; padding-inline-start: 34px; }
.checklist li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--green-500); color: var(--white); font-size: .8rem; display: grid; place-items: center; line-height: 1; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 10px; background: var(--bg); }
.faq summary { font-weight: 700; cursor: pointer; color: var(--green-900); }
.faq details[open] summary { margin-bottom: 8px; }
.faq details p { margin: 0; }

.sidebar { position: sticky; top: 96px; align-self: start; display: grid; gap: 20px; }
.widget { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.widget h3 { font-size: 1rem; margin-bottom: 12px; }
.toc ol { margin: 0; padding-inline-start: 1.2em; font-size: .93rem; }
.toc li { margin-bottom: 6px; }
.related a { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--ink); font-size: .93rem; font-weight: 600; }
.related a:last-child { border-bottom: 0; }
.related img { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.disclaimer-box { font-size: .85rem; color: var(--muted); background: var(--gold-100); }

/* ---------- Coupon codes ---------- */
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; }
.quick-links a { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .88rem; font-weight: 700; color: var(--green-900); }
.quick-links a:hover { border-color: var(--green-500); color: var(--green-700); }
.coupon-box, .coupon-group { scroll-margin-top: 90px; }
.coupon-box { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: 24px 26px; margin: 4px 0 28px; box-shadow: var(--shadow); }
.coupon-box h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin-bottom: 4px; }
.coupon-updated { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }
.coupon-en { display: block; }
.coupon-alts code { white-space: nowrap; }
.coupon-group h3 { font-size: 1rem; margin: 18px 0 10px; color: var(--green-700); }
.coupons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.coupon { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; border: 2px dashed var(--green-500); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--bg); }
.coupon-info { display: flex; gap: 12px; align-items: flex-start; }
.coupon-info strong { display: block; font-size: .95rem; line-height: 1.6; }
.coupon-info small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.coupon-off { flex-shrink: 0; background: var(--gold-100); color: var(--green-900); font-weight: 800; font-size: 1.15rem; border-radius: 10px; padding: 4px 10px; line-height: 1.5; }
.coupon-alts code { font-size: .8rem; font-weight: 700; color: var(--green-900); }
.coupon-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.coupon-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.05rem; font-weight: 800; letter-spacing: .04em; color: var(--green-900); background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.coupon-copy { padding: 8px 18px; font-size: .92rem; min-height: 40px; }
.coupon-copy.is-copied { background: var(--green-500); }
.coupon-note { font-size: .85rem; color: var(--muted); margin: 16px 0 0; }

/* Coupon cards with "reveal code" button */
.coupon-group-title { font-size: 1rem; margin: 18px 0 10px; color: var(--green-700); }
.coupon-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
a.coupon-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 2px dashed var(--green-500); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
a.coupon-card:hover { border-color: var(--green-700); box-shadow: var(--shadow); color: var(--ink); }
.coupon-top { display: flex; align-items: center; gap: 8px; }
.coupon-top .brand { font-weight: 800; color: var(--green-900); font-size: .9rem; }
.coupon-top .discount { background: var(--gold-100); color: var(--green-900); font-weight: 800; border-radius: 8px; padding: 2px 10px; font-size: 1rem; }
.coupon-top .type { margin-inline-start: auto; font-size: .75rem; font-weight: 700; color: var(--green-700); border: 1px solid var(--green-500); border-radius: 999px; padding: 1px 10px; }
a.coupon-card h3 { font-size: .95rem; line-height: 1.6; margin: 0; color: var(--ink); }
.coupon-button { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; background: var(--green-700); color: var(--white); font-weight: 800; }
.coupon-button .code-text { display: none; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .05em; background: var(--white); color: var(--green-900); border: 2px dashed var(--green-500); border-radius: 999px; padding: 6px 18px; }
a.coupon-card .more-details { font-size: .8rem; color: var(--muted); text-decoration: underline; text-align: center; }

/* ---------- Static pages ---------- */
.page-hero { padding: 48px 0 24px; text-align: center; }
.page-hero p { color: var(--muted); max-width: 680px; margin-inline: auto; }
.page-body { padding: 16px 0 64px; }
.page-body .prose { max-width: 880px; margin-inline: auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.form-grid { display: grid; gap: 16px; }
.form-grid label { font-weight: 700; font-size: .93rem; display: block; margin-bottom: 6px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 1rem; background: var(--bg); }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { outline: 2px solid var(--green-500); border-color: transparent; }
.form-status { font-size: .92rem; color: var(--green-700); min-height: 1.4em; }
.contact-list { list-style: none; padding: 0 !important; }
.contact-list li { display: flex; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.contact-list a[dir="ltr"] { unicode-bidi: isolate; }
.legal-facts { margin: 18px 0 8px; }
.legal-facts td:first-child { white-space: nowrap; font-weight: 700; color: var(--green-900); width: 38%; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #bcd9ce; padding: 48px 0 24px; font-size: .93rem; }
.site-footer a { color: #e6f4ee; }
.site-footer a:hover { color: var(--gold-500); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: var(--white); font-size: 1rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.footer-logo { display: flex; gap: 10px; align-items: center; color: var(--white); font-weight: 800; font-size: 1.2rem; margin-bottom: 10px; }
.footer-logo img { width: 36px; height: 36px; }
.footer-legal {
  font-style: normal;
  font-size: .85rem;
  line-height: 1.75;
  margin: 16px 0 0;
  color: #9ec4b6;
}
.footer-legal strong { color: #e6f4ee; display: block; margin-bottom: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; }
.link-btn { background: none; border: 0; color: #e6f4ee; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 200;
  max-width: 760px; margin-inline: auto;
  background: var(--white); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.22);
  border: 1px solid var(--line); padding: 22px 24px;
  display: none;
}
.cookie-banner.is-visible { display: block; animation: slideUp .35s ease; }
.cookie-banner h2 { font-size: 1.1rem; margin-bottom: 6px; }
.cookie-banner p { font-size: .92rem; color: var(--muted); margin-bottom: 14px; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions .btn { padding: 10px 20px; font-size: .93rem; }
.cookie-prefs { display: none; margin: 4px 0 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cookie-prefs.is-open { display: block; }
.cookie-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; font-size: .92rem; }
.cookie-row small { display: block; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5d1; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green-500); }
.switch input:checked + span::before { transform: translateX(-20px); }
[dir="ltr"] .switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: .6; cursor: not-allowed; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .main-nav { position: absolute; top: 72px; inset-inline: 0; background: var(--white); border-bottom: 1px solid var(--line); display: none; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; padding: 10px 20px 18px; }
  .hero-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .cards, .features { grid-template-columns: 1fr; }
  .prose { padding: 26px 20px; }
  .coupons { grid-template-columns: minmax(0, 1fr); }
  .coupon-cards { grid-template-columns: minmax(0, 1fr); }
  .quick-links { flex-wrap: nowrap; overflow-x: auto; margin: -10px -20px 12px; padding: 2px 20px 4px; scrollbar-width: none; }
  .quick-links::-webkit-scrollbar { display: none; }
  .quick-links a { white-space: nowrap; padding: 5px 12px; font-size: .82rem; }
  .coupon-box { padding: 18px 16px; margin-top: 0; }
  .cta-band { grid-template-columns: 1fr; padding: 28px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
