/* ============================================================
   متجر الذهب والمجوهرات — تصميم فاخر (أوف وايت + كحلي + ذهبي)
   RTL | Responsive: جوال / تابلت / كمبيوتر
   ============================================================ */
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik/Rubik-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik/Rubik-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik/Rubik-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik/Rubik-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* لوحة الألوان الحالية مؤقتة — تُحدد اللوحة النهائية في الخطوة التالية.
     غيّر القيم من هذا المكان الواحد فقط. */
  --primary: #1b2a4a;          /* كحلي */
  --secondary: #2c3e67;        /* كحلي فاتح */
  --gold: #b8860b;             /* ذهبي */
  --gold-light: #d4af37;       /* ذهبي فاتح */
  --gold-soft: #f7ecd0;        /* ذهبي شاحب للخلفيات */
  --background: #faf7f0;       /* أوف وايت */
  --background-soft: #f3ecdd;
  --surface: #ffffff;          /* سطح البطاقات */
  --text: #2b2b2b;
  --muted-text: #7a7466;
  --border: #e7dcc3;
  --success: #1e7e46;
  --whatsapp: #1e7e46;
  --whatsapp-dark: #166638;

  /* أسماء متوافقة مع بقية الملف — مربوطة بالمتغيرات أعلاه */
  --navy: var(--primary);
  --navy-soft: var(--secondary);
  --bg: var(--background);
  --bg-soft: var(--background-soft);
  --card: var(--surface);
  --muted: var(--muted-text);
  --radius: 16px;
  --shadow: 0 8px 28px rgba(27, 42, 74, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Rubik", "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
}

h1, h2, h3, .brand-name {
  font-family: "Rubik", "Segoe UI", Tahoma, sans-serif;
}

/* الخط المحلي المعتمد للموقع بالكامل: أزرار وحقول ونوافذ وفوتر */
button, input, select, textarea, .btn {
  font-family: inherit;
}

/* ---------- الشريط العلوي ---------- */
.topbar {
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #fff;
  padding: 28px 16px 22px;
  border-bottom: 4px solid var(--gold-light);
}
.topbar__inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.brand-name { margin: 0; font-size: 2rem; color: var(--gold-light); }
.brand-sub { margin: 6px 0 0; color: #f3ecdd; font-size: 1rem; }
.gold-line {
  width: 120px; height: 3px; margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  border-radius: 99px;
}

/* ---------- أدوات البحث والفلترة ---------- */
.toolbar {
  max-width: 1200px; margin: -0px auto 0; padding: 20px 16px 0;
}
.toolbar__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-box { flex: 1 1 260px; position: relative; }
.search-box input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-size: 1rem; background: var(--bg);
}
.search-box input:focus { outline: 2px solid var(--gold-light); border-color: var(--gold-light); }
.btn {
  border: none; border-radius: 12px; padding: 12px 20px;
  font-size: 0.95rem; cursor: pointer; font-weight: 700;
}
.btn--ghost { background: var(--bg-soft); color: var(--navy); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--gold-soft); }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-soft); }
.btn--gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #fff; }
.btn--gold:hover { filter: brightness(1.05); }

.filters-row {
  display: grid; gap: 12px; margin-top: 14px;
  grid-template-columns: 1fr;
}
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.field select {
  width: 100%; padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--bg); font-size: 0.95rem;
}
.results-line {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 2px 0; color: var(--navy); font-weight: 700;
}
.results-count {
  background: var(--navy); color: #fff; border-radius: 99px;
  padding: 4px 14px; font-size: 0.9rem;
}

/* ---------- شبكة المنتجات ---------- */
.grid-section { max-width: 1200px; margin: 0 auto; padding: 18px 16px 8px; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(27,42,74,.12); }
.card__media {
  background: #fbf6ea;
  border-bottom: 1px solid var(--border);
  height: 230px; display: flex; align-items: center; justify-content: center;
  padding: 12px; text-align: center; position: relative; overflow: hidden;
}
.card__media img.product-photo {
  width: 100%; height: 100%; object-fit: contain; display: block;
  border-radius: 10px;
}
.card__media img.product-photo.is-broken { display: none; }
.img-fallback { padding: 20px 10px; }
.placeholder-icon { font-size: 2.6rem; line-height: 1; }
.placeholder-text { margin-top: 8px; color: var(--navy); font-weight: 700; }
.placeholder-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.price-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--navy); color: #fff;
  font-size: 0.75rem; padding: 5px 12px; border-radius: 99px; font-weight: 700;
}
.price-badge--fixed { background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__cat { font-size: 0.78rem; color: var(--gold); font-weight: 700; }
.card__title { margin: 0; font-size: 1.15rem; color: var(--navy); }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.78rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 11px; color: var(--navy);
}
.card__desc { font-size: 0.88rem; color: var(--muted); line-height: 1.7; margin: 0; }
.card__price { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); }
.price-value { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.price-cur { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.card__actions { display: flex; gap: 8px; margin-top: 10px; }
.card__actions .btn { flex: 1; padding: 10px 8px; font-size: 0.88rem; }
.empty {
  text-align: center; padding: 40px 16px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
}

/* ---------- الملاحظات ---------- */
.notes { max-width: 1200px; margin: 0 auto; padding: 10px 16px 30px; display: grid; gap: 12px; }
.note {
  background: var(--card); border: 1px solid var(--border);
  border-right: 5px solid var(--gold-light);
  border-radius: 12px; padding: 14px 16px; font-size: 0.9rem; line-height: 1.8;
}
.note strong { color: var(--navy); }
.note--small { font-size: 0.82rem; padding: 10px 14px; }
.footer { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 0 16px 34px; }

/* ---------- النافذة المنبثقة ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(27,42,74,.45);
  display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 18px; max-width: 520px; width: 100%;
  border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0,0,0,.2);
  overflow: hidden; max-height: 90vh; overflow-y: auto;
}
.modal__head {
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--gold-light);
}
.modal__head h3 { margin: 0; font-size: 1.2rem; color: var(--gold-light); }
.modal__close { background: transparent; border: 1px solid var(--gold-light); color: #fff; border-radius: 10px; padding: 6px 12px; cursor: pointer; }
.modal__body { padding: 18px; display: grid; gap: 10px; font-size: 0.92rem; line-height: 1.8; }
.kv { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.kv span:first-child { color: var(--muted); font-weight: 700; }
.kv span:last-child { color: var(--navy); font-weight: 700; text-align: left; }
.inquiry-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.inquiry-box textarea { width: 100%; min-height: 90px; border-radius: 10px; border: 1.5px solid var(--border); padding: 10px; font-family: inherit; resize: vertical; }
.inquiry-hint { font-size: 0.8rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .filters-row { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .brand-name { font-size: 2.6rem; }
}

/* ============================================================
   هوية متجر "الأصل للذهب" — أزرار التواصل والفوتر
   ============================================================ */
.topbar__contact {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 18px;
}
.contact-btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; border-radius: 12px; padding: 11px 24px;
  font-weight: 700; font-size: 0.95rem; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
}
.contact-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.contact-btn--call { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #fff; }
.contact-btn--call:hover { filter: brightness(1.07); }
.contact-btn--wa { background: var(--whatsapp); color: #fff; }
.contact-btn--wa:hover { background: var(--whatsapp-dark); }
.contact-btn--outline { background: transparent; color: #fff; border-color: var(--gold-light); }
.contact-btn--outline:hover { background: rgba(212, 175, 55, 0.15); }

/* ---------- قسم معلومات المتجر والتواصل ---------- */
.store-info { max-width: 1200px; margin: 0 auto; padding: 10px 16px 4px; }
.store-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 20px; text-align: center;
}
.store-card h2 { margin: 0 0 6px; color: var(--navy); font-size: 1.5rem; }
.store-card > p { color: var(--muted); font-size: 0.92rem; line-height: 1.8; margin: 0 0 14px; }
.store-rows {
  display: grid; gap: 10px; margin-bottom: 16px;
  grid-template-columns: 1fr;
}
.store-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; font-size: 0.92rem;
}
.store-row .k { color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.store-row .k svg { width: 17px; height: 17px; color: var(--gold); }
.store-row .v { color: var(--navy); font-weight: 700; direction: ltr; }
.store-row a.v { text-decoration: none; }
.store-row a.v:hover { color: var(--gold); }
.store-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.store-actions .contact-btn--outline { color: var(--navy); border-color: var(--navy); }
.store-actions .contact-btn--outline:hover { background: var(--gold-soft); }

/* ---------- فوتر المتجر ---------- */
.site-footer {
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: #f3ecdd; border-top: 4px solid var(--gold-light);
  margin-top: 18px; padding: 30px 16px 20px;
}
.site-footer__inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; gap: 22px; grid-template-columns: 1fr;
}
.site-footer h3 { margin: 0 0 10px; color: var(--gold-light); font-size: 1.3rem; }
.site-footer p { margin: 0 0 8px; font-size: 0.9rem; line-height: 1.9; }
.site-footer a { color: #f3ecdd; text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.footer-contact { display: grid; gap: 8px; font-size: 0.9rem; }
.footer-contact .row { display: flex; align-items: center; gap: 8px; }
.footer-contact svg { width: 16px; height: 16px; color: var(--gold-light); flex-shrink: 0; }
.footer-contact .ltr { direction: ltr; unicode-bidi: embed; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.9rem; }
.footer-links a::before { content: "‹ "; color: var(--gold-light); }
.footer-bottom {
  max-width: 1200px; margin: 20px auto 0; padding-top: 14px;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  font-size: 0.82rem; text-align: center; color: #cfc6ae;
}

/* ---------- شريط التواصل السريع (جوال فقط) ---------- */
.quick-contact { display: none; }
@media (max-width: 639px) {
  body { padding-bottom: 78px; } /* مساحة أمان حتى لا يغطي الشريط المحتوى */
  .quick-contact {
    display: flex; position: fixed; bottom: 0; right: 0; left: 0; z-index: 40;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(27, 42, 74, 0.12);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .quick-contact a {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border-radius: 12px; padding: 12px 8px; font-weight: 700; font-size: 0.92rem;
    text-decoration: none; font-family: inherit;
  }
  .quick-contact a svg { width: 18px; height: 18px; }
  .quick-contact .qc-call { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #fff; }
  .quick-contact .qc-wa { background: var(--whatsapp); color: #fff; }
  .store-rows { grid-template-columns: 1fr; }
}
@media (min-width: 640px) {
  .store-rows { grid-template-columns: repeat(3, 1fr); }
  .site-footer__inner { grid-template-columns: 1.2fr 1fr 1fr; }
}
