/* ===== مرسال العود — نظام التصميم ===== */
:root {
  --bg: #191008;
  --panel: #251a10;
  --panel-2: #2e2114;
  --gold: #c9973f;
  --gold-light: #e0b86a;
  --ivory: #efe6d4;
  --muted: #b6a687;
  --line: rgba(201, 151, 63, 0.22);
  --danger: #c96a4f;
  --ok: #7fae7a;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --font-brand: 'Aref Ruqaa', serif;
  --font-head: 'Amiri', serif;
  --font-body: 'IBM Plex Sans Arabic', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cpath d='M48 34 L52 44 L62 48 L52 52 L48 62 L44 52 L34 48 L44 44 Z' fill='none' stroke='%23c9973f' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E"),
    radial-gradient(1100px 500px at 85% -10%, rgba(201, 151, 63, 0.08), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(201, 151, 63, 0.05), transparent 55%);
}

img, svg { max-width: 100%; display: block; }
a { color: var(--gold-light); text-decoration: none; }
main { flex: 1; }

.container { width: min(1120px, 92%); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-head); color: var(--gold-light); font-weight: 700; line-height: 1.5; }

::selection { background: var(--gold); color: var(--bg); }

/* ===== الترويسة ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(25, 16, 8, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.7rem;
}
.brand {
  font-family: var(--font-brand);
  font-size: 1.7rem;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 0 24px rgba(201, 151, 63, 0.35);
}
.brand small { display: block; font-family: var(--font-body); font-size: 0.68rem; color: var(--muted); }
.main-nav { display: flex; align-items: center; gap: 1.4rem; }
.main-nav a { color: var(--ivory); font-size: 0.95rem; padding-block: 0.3rem; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--gold-light); border-bottom-color: var(--gold); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; }
.cart-badge {
  min-width: 1.35rem; height: 1.35rem; padding-inline: 0.3rem;
  border-radius: 999px; background: var(--gold); color: var(--bg);
  font-size: 0.75rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-badge:empty, .cart-badge[data-n="0"] { display: none; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 500; font-size: 1rem;
  padding: 0.7rem 1.8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, var(--gold), #a87826);
  color: #1d1206;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn:hover { filter: brightness(1.12); box-shadow: 0 6px 24px rgba(201, 151, 63, 0.35); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--gold-light); }
.btn-ghost:hover { background: rgba(201, 151, 63, 0.12); box-shadow: none; }
.btn-sm { padding: 0.35rem 1rem; font-size: 0.85rem; }
.btn-danger { border-color: var(--danger); background: transparent; color: var(--danger); }
.btn-danger:hover { background: rgba(201, 106, 79, 0.14); box-shadow: none; }

/* ===== الهيرو والمبخرة ===== */
.hero { padding-block: 3.5rem 4.5rem; }
.hero .container { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 1rem; }
.hero h1 .brand-word { font-family: var(--font-brand); color: var(--gold); }
.hero p.lead { color: var(--muted); font-size: 1.1rem; max-width: 34rem; margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.mabkhara-scene { position: relative; display: grid; place-items: center; min-height: 340px; }
.hero-photo {
  width: 100%; max-width: 520px; height: auto; border-radius: var(--radius);
  border: 1px solid rgba(201, 151, 63, 0.45);
  box-shadow: var(--shadow), 0 0 60px rgba(201, 151, 63, 0.18);
}
.mabkhara-glow {
  position: absolute; inset: auto; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 151, 63, 0.16), transparent 65%);
}
.smoke-wisp {
  position: absolute; bottom: 58%; left: 50%;
  width: 46px; height: 150px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(239, 230, 212, 0.28), rgba(239, 230, 212, 0.04) 70%, transparent);
  filter: blur(9px);
  opacity: 0;
  animation: smoke-rise 7s ease-out infinite;
  pointer-events: none;
}
.smoke-wisp:nth-child(2) { animation-delay: 2.3s; width: 34px; }
.smoke-wisp:nth-child(3) { animation-delay: 4.6s; width: 56px; }
@keyframes smoke-rise {
  0%   { transform: translate(-50%, 30px) scale(0.5) rotate(0deg); opacity: 0; }
  15%  { opacity: 0.85; }
  50%  { transform: translate(calc(-50% + 22px), -110px) scale(1.05) rotate(8deg); opacity: 0.45; }
  100% { transform: translate(calc(-50% - 26px), -240px) scale(1.7) rotate(-10deg); opacity: 0; }
}
.ember { animation: ember-pulse 2.6s ease-in-out infinite; transform-origin: center; }
@keyframes ember-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .smoke-wisp { animation: none; opacity: 0.35; transform: translate(-50%, -80px) scale(1.2); }
  .smoke-wisp:nth-child(3) { display: none; }
  .ember { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===== الأقسام ===== */
.section { padding-block: 3.5rem; }
.section-head { text-align: center; margin-bottom: 2.2rem; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--muted); }
.gold-rule {
  width: 190px; height: 1px; margin: 1.1rem auto 0; position: relative;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.gold-rule::after {
  content: '✦'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -52%);
  color: var(--gold-light); font-size: 0.85rem; background: var(--bg); padding-inline: 0.7rem;
  text-shadow: 0 0 14px rgba(224, 184, 106, 0.7);
}
.story .gold-rule::after, .panel .gold-rule::after { background: var(--panel); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.8rem;
  color: var(--gold); font-size: 0.85rem; font-weight: 400;
  margin-bottom: 1.1rem;
}
.eyebrow::before, .eyebrow::after { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow::after { background: linear-gradient(90deg, var(--gold), transparent); }

/* ===== بطاقات المنتجات ===== */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.4rem; }
.product-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 40%);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: inset 0 1px 0 rgba(224, 184, 106, 0.08);
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.25s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow), 0 0 0 1px rgba(201, 151, 63, 0.35); border-color: rgba(201, 151, 63, 0.55); }
.product-card .thumb { aspect-ratio: 4 / 3; background: var(--panel-2); display: block; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-card .body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.product-card h3 { font-size: 1.2rem; }
.product-card .cat { font-size: 0.78rem; color: var(--muted); }
.price { font-family: var(--font-head); font-weight: 700; color: var(--gold-light); font-size: 1.2rem; }
.price small { font-family: var(--font-body); color: var(--muted); font-weight: 300; font-size: 0.75rem; }
.product-card .actions { margin-top: auto; display: flex; gap: 0.6rem; padding-top: 0.6rem; }

/* ===== الفلاتر ===== */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 2rem; }
.filter-btn {
  font-family: var(--font-body); font-size: 0.9rem; cursor: pointer;
  padding: 0.45rem 1.3rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ivory);
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--gold); }
.filter-btn.active { background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 600; }

/* ===== الخط الزمني — من يوم بدينا ===== */
.timeline { list-style: none; margin-top: 2.2rem; position: relative; padding-right: 1.6rem; }
.timeline::before {
  content: ''; position: absolute; right: 5px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 15%, var(--gold) 85%, transparent);
  opacity: 0.5;
}
.timeline li { position: relative; padding-bottom: 1.6rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; right: -1.6rem; top: 0.55rem;
  width: 11px; height: 11px; transform: rotate(45deg);
  background: var(--bg); border: 1px solid var(--gold);
  box-shadow: 0 0 10px rgba(201, 151, 63, 0.5);
}
.timeline .year { font-family: var(--font-head); font-weight: 700; color: var(--gold-light); font-size: 1.15rem; display: block; }
.timeline p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ===== حكاية مرسال ===== */
.story { background: var(--panel); border-block: 1px solid var(--line); }
.story .container { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding-block: 3.5rem; }
.story h2 { font-size: 1.9rem; margin-bottom: 1rem; }
.story p { color: var(--muted); margin-bottom: 0.9rem; }
.story-marks { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.story-mark { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.story-mark strong { display: block; font-family: var(--font-head); color: var(--gold-light); font-size: 1.5rem; }
.story-mark span { color: var(--muted); font-size: 0.85rem; }

/* ===== صفحة المنتج ===== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; padding-block: 3rem; }
.product-detail .thumb { background: var(--panel); border: 1px solid rgba(201, 151, 63, 0.4); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow), 0 0 50px rgba(201, 151, 63, 0.12); aspect-ratio: 1 / 1; }
.product-detail .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-detail h1 { font-size: 2.1rem; margin-bottom: 0.4rem; }
.product-detail .cat { color: var(--muted); margin-bottom: 1rem; }
.product-detail .price { font-size: 1.6rem; display: block; margin-bottom: 1.2rem; }
.product-detail .desc { color: var(--muted); margin-bottom: 1.8rem; max-width: 36rem; }
.qty-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); }
.qty-control button {
  width: 2.6rem; height: 2.6rem; border: 0; background: transparent; color: var(--gold-light);
  font-size: 1.25rem; cursor: pointer; font-family: var(--font-body);
}
.qty-control button:hover { background: rgba(201, 151, 63, 0.14); }
.qty-control .qty { min-width: 2.6rem; text-align: center; font-weight: 600; }

/* ===== السلة ===== */
.cart-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; padding-block: 2.5rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.panel h2 { font-size: 1.4rem; margin-bottom: 1.2rem; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.cart-item:last-of-type { border-bottom: 0; }
.cart-item .thumb { width: 64px; height: 64px; background: var(--panel-2); border-radius: 10px; overflow: hidden; display: block; }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item h3 { font-size: 1.05rem; }
.cart-item .meta { font-size: 0.82rem; color: var(--muted); }
.cart-item .side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.remove-btn { background: none; border: 0; color: var(--danger); cursor: pointer; font-family: var(--font-body); font-size: 0.8rem; }
.totals-row { display: flex; justify-content: space-between; padding-block: 0.5rem; color: var(--muted); }
.totals-row.grand { color: var(--ivory); font-weight: 600; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 0.5rem; padding-top: 0.9rem; }
.tax-note { font-size: 0.78rem; color: var(--muted); text-align: center; margin-top: 0.6rem; }

/* ===== النماذج ===== */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.88rem; margin-bottom: 0.35rem; color: var(--ivory); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.65rem 0.9rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ivory);
  font-family: var(--font-body); font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(201, 151, 63, 0.5); border-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-msg { padding: 0.7rem 1rem; border-radius: 10px; font-size: 0.9rem; margin-bottom: 1rem; display: none; }
.form-msg.error { display: block; background: rgba(201, 106, 79, 0.14); border: 1px solid rgba(201, 106, 79, 0.4); color: #e8b4a5; }
.form-msg.ok { display: block; background: rgba(127, 174, 122, 0.12); border: 1px solid rgba(127, 174, 122, 0.35); color: #b9d7b5; }

/* ===== صفحة الشكر ===== */
.thanks-wrap { max-width: 560px; margin-inline: auto; text-align: center; padding-block: 4rem; }
.thanks-icon { width: 90px; height: 90px; margin: 0 auto 1.4rem; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; }
.thanks-icon.ok { background: rgba(127, 174, 122, 0.15); border: 1px solid rgba(127, 174, 122, 0.4); }
.thanks-icon.fail { background: rgba(201, 106, 79, 0.15); border: 1px solid rgba(201, 106, 79, 0.4); }
.thanks-icon.wait { background: rgba(201, 151, 63, 0.13); border: 1px solid var(--line); }
.order-ref { display: inline-block; background: var(--panel); border: 1px dashed var(--gold); border-radius: 10px; padding: 0.5rem 1.4rem; margin-block: 1rem; font-weight: 600; color: var(--gold-light); }

/* ===== حالات ===== */
.status-badge { display: inline-block; padding: 0.15rem 0.8rem; border-radius: 999px; font-size: 0.78rem; font-weight: 500; }
.status-paid { background: rgba(127, 174, 122, 0.15); color: var(--ok); border: 1px solid rgba(127, 174, 122, 0.4); }
.status-pending { background: rgba(201, 151, 63, 0.14); color: var(--gold-light); border: 1px solid var(--line); }
.status-failed { background: rgba(201, 106, 79, 0.14); color: var(--danger); border: 1px solid rgba(201, 106, 79, 0.4); }

/* ===== التذييل الكبير ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); margin-top: 3rem; }
.site-footer .brand { font-size: 1.3rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; padding-block: 2.6rem; align-items: start; }
.footer-about p { color: var(--muted); font-size: 0.85rem; margin-top: 0.7rem; max-width: 24rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.45rem; }
.footer-col h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.footer-col a, .footer-col span { color: var(--muted); font-size: 0.88rem; }
.footer-col a { transition: color 0.15s; }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; color: var(--muted); font-size: 0.8rem; }

/* ===== صفحات المحتوى ===== */
.prose { max-width: 760px; margin-inline: auto; }
.prose h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-right: 1.3rem; margin-block: 0.5rem; }
.prose .panel { margin-top: 1.5rem; }

/* ===== الأسئلة الشائعة ===== */
.faq-list { max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: 0.8rem; }
.faq-list details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.3rem; transition: border-color 0.2s; }
.faq-list details[open] { border-color: rgba(201, 151, 63, 0.5); }
.faq-list summary { cursor: pointer; font-weight: 500; color: var(--gold-light); font-size: 1.02rem; list-style: none; position: relative; padding-left: 1.6rem; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; position: absolute; left: 0; top: -0.1rem; color: var(--gold); font-size: 1.3rem; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list details p { color: var(--muted); padding-top: 0.6rem; font-size: 0.93rem; }

/* ===== تواصل ===== */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; max-width: 920px; margin-inline: auto; }
.contact-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem 1.4rem; text-align: center; transition: border-color 0.2s, transform 0.2s; }
.contact-card:hover { border-color: rgba(201, 151, 63, 0.5); transform: translateY(-3px); }
.contact-card .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.contact-card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.contact-card p { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.9rem; }

/* ===== لوحة التحكم ===== */
.admin-body { background: var(--bg); }
.login-wrap { max-width: 420px; margin: 8vh auto; }
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding-block: 2rem; align-items: start; }
.admin-nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 0.3rem; }
.admin-nav button {
  text-align: right; font-family: var(--font-body); font-size: 0.95rem; cursor: pointer;
  padding: 0.65rem 1rem; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--ivory); transition: all 0.15s;
}
.admin-nav button:hover { background: rgba(201, 151, 63, 0.1); }
.admin-nav button.active { background: var(--panel); border-color: var(--line); color: var(--gold-light); font-weight: 500; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.stat-card .num { font-family: var(--font-head); font-size: 1.7rem; color: var(--gold-light); font-weight: 700; }
.stat-card .lbl { color: var(--muted); font-size: 0.82rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 640px; }
.admin-table th, .admin-table td { padding: 0.7rem 0.9rem; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--gold-light); font-weight: 500; background: var(--panel-2); white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ===== ميسر ===== */
.mysr-form { direction: rtl; }
#moyasar-holder { margin-top: 1rem; }

/* ===== تجاوب ===== */
@media (max-width: 900px) {
  .hero .container, .story .container, .product-detail, .cart-layout { grid-template-columns: 1fr; }
  .mabkhara-scene { min-height: 300px; order: -1; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .main-nav { gap: 0.8rem; font-size: 0.85rem; flex-wrap: wrap; justify-content: center; }
  .brand { font-size: 1.35rem; }
  .form-grid { grid-template-columns: 1fr; }
  .site-header .container { flex-wrap: wrap; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}
