/* =========================================================
   أم سلمان × DXN — واجهة أمامية Mobile-First
   الهوية مستوحاة من نسخة demo المعتمدة بصريًا:
   بيج ترابي + بني داكن + ذهبي + أخضر DXN.
   ========================================================= */

:root {
  --beige-1: #FAF6EC;
  --beige-2: #F3EFE1;
  --beige-3: #E4DCC8;
  --brown-1: #2B1D02;
  --brown-2: #5B3E10;
  --brown-3: #7A5A15;
  --gold-1: #C08B2C;
  --gold-2: #7A5A15;
  --green-1: #1FAA59;
  --green-2: #1F5C3F;
  --green-dark: #16231C;
  --danger: #9A3B22;
  --paper: #FFFEFA;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(43, 29, 2, .10);
  --shadow-lg: 0 12px 34px rgba(43, 29, 2, .16);
  --bottom-nav-h: 64px;
  --header-h: 58px;
  --maxw: 1120px;
  --font-body: 'Tajawal', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --font-head: 'Aref Ruqaa', 'Tajawal', serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--beige-2);
  color: var(--brown-1);
  line-height: 1.75;
  font-size: 16px;
  overflow-x: hidden;
}

body[dir="rtl"] { text-align: right; }

a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--brown-2); line-height: 1.4; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 16px;
}

.section { padding-block: 30px; }
.section--tight { padding-block: 18px; }
.section-title { position: relative; margin-bottom: 18px; }
.section-title::after {
  content: "";
  display: block;
  width: 54px; height: 3px;
  background: var(--gold-1);
  border-radius: 3px;
  margin-top: 8px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--brown-1);
  color: var(--beige-1);
  display: flex; align-items: center;
  box-shadow: var(--shadow);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--beige-1); font-family: var(--font-head); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand .badge-rank {
  font-family: var(--font-body);
  font-size: .62rem;
  background: var(--gold-1);
  color: var(--brown-1);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--beige-1);
  border: 0; cursor: pointer;
}

/* Desktop nav — hidden on mobile */
.desktop-nav { display: none; }

/* ---------- Drawer (mobile menu) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(22, 35, 28, .55);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 50;
}
.drawer {
  position: fixed; top: 0; inset-inline-end: 0;
  width: min(84vw, 320px); height: 100%;
  background: var(--beige-1);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 51;
  padding: 18px;
  overflow-y: auto;
}
body[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.open { transform: translateX(0); }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer a { display: block; padding: 12px 8px; color: var(--brown-1); border-bottom: 1px solid var(--beige-3); font-size: 1.02rem; }
.drawer a:hover { text-decoration: none; color: var(--green-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 48px;
  transition: transform .12s, box-shadow .12s;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--green-1); color: #fff; box-shadow: var(--shadow); }
.btn--dark { background: var(--brown-2); color: var(--beige-1); }
.btn--gold { background: var(--gold-1); color: var(--brown-1); }
.btn--ghost { background: transparent; border-color: var(--brown-2); color: var(--brown-2); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 40px; padding: 9px 16px; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(180deg, rgba(43,29,2,.03), rgba(43,29,2,.10)),
    var(--beige-1);
  padding-block: 26px 30px;
  text-align: center;
}
.hero__photo {
  width: 128px; height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--gold-1);
  margin: 0 auto 14px;
  box-shadow: var(--shadow-lg);
}
.hero__name { font-size: 1.7rem; margin-bottom: 4px; }
.hero__rank {
  display: inline-block;
  background: var(--brown-2); color: var(--beige-1);
  font-size: .78rem; padding: 4px 12px; border-radius: 999px;
  margin-bottom: 12px;
}
.hero__tag { color: var(--brown-3); max-width: 40ch; margin-inline: auto; }
.hero__cta { display: grid; gap: 10px; margin-top: 18px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--beige-3);
  display: flex; flex-direction: column;
}
.card__body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card__img { aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--beige-3); }
.card__title { font-family: var(--font-head); font-size: 1.05rem; color: var(--brown-2); }
.card__note {
  background: var(--beige-2);
  border-inline-start: 3px solid var(--gold-1);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  color: var(--brown-3);
}
.chip {
  display: inline-block;
  font-size: .74rem;
  background: var(--green-2); color: #fff;
  padding: 3px 10px; border-radius: 999px;
}
.chip--muted { background: var(--beige-3); color: var(--brown-2); }
.chip--warn { background: var(--danger); color: #fff; }

/* ---------- Feature list ---------- */
.feature-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.feature-list li {
  background: var(--paper);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--beige-3);
  display: flex; gap: 10px; align-items: flex-start;
}
.feature-list li::before { content: "✦"; color: var(--gold-1); }

/* ---------- Video embed ---------- */
.video-embed {
  position: relative; width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-attribution {
  font-size: .82rem; color: var(--brown-3);
  margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.video-attribution::before { content: "🎥"; }

/* ---------- Notices ---------- */
.notice {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .92rem;
  margin-block: 14px;
}
.notice--legal { background: #FBEAE7; border: 1px solid #E4B7AC; color: #7A2E1A; }
.notice--info { background: #E7F0E9; border: 1px solid #B7D4C1; color: var(--green-2); }
.notice--success { background: #EDF3EA; border: 1px solid var(--green-1); color: var(--green-2); }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--brown-2); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--beige-3);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: var(--paper);
  color: var(--brown-1);
  min-height: 48px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green-1);
  box-shadow: 0 0 0 3px rgba(31,170,89,.15);
}
.field-error { color: var(--danger); font-size: .84rem; margin-top: 4px; }

/* ---------- Accordion (FAQ) ---------- */
.accordion { display: grid; gap: 10px; }
.accordion details {
  background: var(--paper);
  border: 1px solid var(--beige-3);
  border-radius: var(--radius-sm);
  padding: 4px 14px;
}
.accordion summary {
  cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--brown-2);
  list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; float: inline-end; color: var(--gold-1); font-size: 1.2rem; }
.accordion details[open] summary::after { content: "−"; }

/* ---------- Bottom nav (app-like) ---------- */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  height: var(--bottom-nav-h);
  background: var(--paper);
  border-top: 1px solid var(--beige-3);
  display: flex;
  box-shadow: 0 -4px 16px rgba(43,29,2,.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: .68rem;
  color: var(--brown-3);
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a.active { color: var(--green-1); }
.bottom-nav a svg { width: 22px; height: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-dark);
  color: var(--beige-2);
  padding: 26px 0 90px;
  text-align: center;
  font-size: .9rem;
}
.social-row { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.social-row a {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: grid; place-items: center;
  color: var(--beige-1);
}
.footer-legal { opacity: .7; font-size: .8rem; margin-top: 10px; }

main { min-height: 50vh; padding-bottom: 20px; }
.page-head { background: var(--beige-1); padding-block: 22px; border-bottom: 1px solid var(--beige-3); }
.breadcrumbs { font-size: .82rem; color: var(--brown-3); margin-bottom: 4px; }

/* toolbar for products */
.filter-bar { display: grid; gap: 10px; margin-bottom: 16px; }
/* شبكة تصنيفات — كل التصنيفات ظاهرة دفعة واحدة بدون تمرير أفقي.
   على الجوال: عمودان إلى ثلاثة حسب طول النص (flex-wrap). */
.cat-scroll { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-scroll a {
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--beige-3);
  color: var(--brown-2);
  font-size: .9rem;
}
.cat-scroll a.active { background: var(--brown-2); color: var(--beige-1); }

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 700px) {
  h1 { font-size: 2rem; }
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--auto { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .hero__cta { grid-template-columns: repeat(3, 1fr); max-width: 640px; margin-inline: auto; }
  /* تابلت/سطح المكتب: أزرار التصنيفات بعرضها الطبيعي في صف يلتف عند الحاجة */
  .cat-scroll a { flex: 0 1 auto; }
}

@media (min-width: 960px) {
  :root { --header-h: 66px; }
  .desktop-nav { display: flex; gap: 18px; align-items: center; }
  .desktop-nav a { color: var(--beige-2); font-size: .95rem; }
  .desktop-nav a:hover { color: #fff; text-decoration: none; }
  .menu-toggle { display: none; }
  .bottom-nav { display: none; }
  .site-footer { padding-bottom: 26px; }
  main { padding-bottom: 40px; }
  .hero__photo { width: 160px; height: 160px; }
}
