/* =====================================================================
   متجر سلطان — هوية "إشراق"  (RTL)
   لوحة جديدة مستقلة: نيلي بنفسجي + مرجاني — تصميم أصلي غير مقتبس
   ===================================================================== */

:root {
  --brand:       #5546c9;   /* النيلي البنفسجي الأساسي */
  --brand-dark:  #3d2fa0;
  --brand-soft:  #eceafb;   /* تظليل فاتح */
  --accent:      #f2643f;   /* المرجاني — للشارات والتمييز */
  --accent-soft: #ffe9e2;
  --gold:        #f6a935;   /* لمسة دافئة للنجوم */
  --ink:         #241a4d;   /* النص الداكن */
  --muted:       #7a76a0;
  --line:        #e7e5f2;
  --bg:          #f6f5fb;
  --surface:     #ffffff;
  --radius:      18px;
  --radius-sm:   12px;
  --shadow:      0 14px 40px rgba(36,26,77,.10);
  --shadow-sm:   0 6px 18px rgba(36,26,77,.07);
}

* { box-sizing: border-box; }

body {
  font-family: "Tajawal", "Cairo", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--surface);
  margin: 0;
  line-height: 1.75;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.container-xl { max-width: 1240px; }
.text-teal { color: var(--brand) !important; } /* توافق مع الأصناف القديمة */

/* -------------------- الشريط العلوي الترويجي -------------------- */
.topbar {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; font-size: .95rem; text-align: center;
  padding: .6rem 1rem; position: relative; letter-spacing: .2px;
}
.topbar .close-x {
  position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%);
  cursor: pointer; opacity: .9; border: 0; background: transparent; color: #fff; font-size: 1.1rem;
}

/* -------------------- الهيدر -------------------- */
.site-header {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: .85rem 0; position: sticky; top: 0; z-index: 1020;
}
.brand-logo { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--brand); }
.brand-logo svg { width: 46px; height: 46px; }
.brand-logo .brand-word { font-size: 1.15rem; color: var(--ink); line-height: 1.1; }
.brand-logo .brand-word span { color: var(--brand); }

.search-box { position: relative; flex: 1; max-width: 560px; }
.search-box input {
  width: 100%; border: 1.5px solid var(--line); background: #faf9ff;
  border-radius: 999px; padding: .7rem 2.6rem .7rem 1.2rem; font-size: .95rem;
}
.search-box input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.search-box .search-ic { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--brand); }

.header-action { display: flex; align-items: center; gap: .4rem; color: var(--ink); font-size: .9rem; }
.header-action .ic { color: var(--brand); font-size: 1.25rem; }
.cart-badge {
  background: var(--accent); color:#fff; border-radius: 50%; font-size: .7rem;
  width: 18px; height: 18px; display:inline-flex; align-items:center; justify-content:center;
}

/* -------------------- شريط التنقل -------------------- */
.main-nav { border-bottom: 1px solid var(--line); background:#fff; }
.main-nav .nav-link { color: var(--ink); font-weight: 600; padding: .9rem 1rem; font-size: .98rem; position: relative; }
.main-nav .nav-link::after {
  content:""; position:absolute; inset-inline: 1rem; bottom:.5rem; height:2px;
  background: var(--accent); border-radius:2px; transform: scaleX(0); transition: transform .18s ease;
}
.main-nav .nav-link:hover { color: var(--brand); }
.main-nav .nav-link:hover::after { transform: scaleX(1); }

/* -------------------- عناوين الأقسام -------------------- */
.section { padding: 3.75rem 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: .82rem; padding: .4rem 1rem; border-radius: 999px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.section-title {
  font-weight: 800; font-size: 2.1rem; margin: .9rem 0 .3rem; color: var(--ink);
  letter-spacing: -.5px;
}
.section-title .hl { color: var(--brand); }
.section-sub { color: var(--muted); }

/* -------------------- بطاقات الأقسام (تصميم دائري جديد) -------------------- */
.category-card { text-align: center; }
.category-card .thumb {
  width: 128px; height: 128px; margin: 0 auto;
  background: radial-gradient(circle at 30% 25%, var(--brand-soft), #fff 75%);
  border: 1.5px solid var(--line); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.category-card:hover .thumb {
  transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--brand);
}
.category-card .thumb img, .category-card .thumb svg { width: 74%; height: 74%; }
.category-card .name { margin-top: 1rem; font-weight: 700; color: var(--ink); font-size: .98rem; }

/* -------------------- تبويبات المنتجات -------------------- */
.tabs { display: inline-flex; gap: .3rem; background:#fff; padding:.35rem;
  border:1.5px solid var(--line); border-radius: 999px; margin-bottom: 2rem; flex-wrap: wrap; }
.tab-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: .5rem 1.5rem; border-radius: 999px; font-weight: 700; cursor: pointer; transition: all .15s ease;
}
.tab-btn.active { background: var(--brand); color:#fff; box-shadow: var(--shadow-sm); }
.tab-btn:hover:not(.active) { color: var(--brand); }

/* -------------------- بطاقة المنتج (غلاف متدرّج + شريط زاوية) -------------------- */
.product-card {
  border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background:#fff; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  height: 100%; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--brand-soft); }
.product-card .cover {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: linear-gradient(135deg, #2e2270 0%, var(--brand) 55%, #7b6ee0 100%);
  display:flex; align-items:center; justify-content:center;
}
.product-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.product-card .flag {
  position: absolute; top: 0; inset-inline-start: 0;
  background: var(--brand-dark); color:#fff; font-size: .72rem; font-weight: 800;
  padding: .3rem .9rem; border-end-end-radius: 12px;
}
.product-card .flag.pdf { background: var(--accent); }
.product-card .fav {
  position: absolute; top: 12px; inset-inline-end: 12px; background: rgba(255,255,255,.92);
  color: var(--accent); width: 32px; height: 32px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
}
.product-card .body { padding: 1.05rem 1.15rem 1.25rem; display:flex; flex-direction: column; gap:.5rem; flex:1; }
.product-card .badge-edit {
  align-self: flex-start; background: var(--accent-soft); color: var(--accent);
  font-size:.78rem; font-weight:800; padding:.22rem .75rem; border-radius: 999px;
}
.product-card .p-title { font-weight: 700; color: var(--ink); font-size: 1rem; margin: 0; }
.product-card .p-price { font-weight: 800; color: var(--brand); font-size: 1.2rem; }
.product-card .p-old { color: var(--muted); text-decoration: line-through; font-size: .9rem; margin-inline-start:.4rem; font-weight:400; }
.product-card .btn-buy {
  margin-top: auto; background: var(--brand); color:#fff; border:0; border-radius: 999px;
  padding:.62rem; font-weight:800; width:100%; transition: background .15s ease;
}
.product-card .btn-buy:hover { background: var(--brand-dark); color:#fff; }

.stars { color: var(--gold); font-size:.9rem; }

/* -------------------- الأزرار العامة -------------------- */
.btn-teal, .btn-brand { background: var(--brand); border-color: var(--brand); color:#fff; font-weight:800; border-radius:999px; }
.btn-teal:hover, .btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color:#fff; }
.btn-outline-teal, .btn-outline-brand { border:1.5px solid var(--brand); color: var(--brand); font-weight:800; background:#fff; border-radius:999px; }
.btn-outline-teal:hover, .btn-outline-brand:hover { background: var(--brand); color:#fff; }

/* -------------------- الفوتر -------------------- */
.site-footer { background: var(--ink); color:#cfc9e8; padding: 3.25rem 0 1.5rem; margin-top: 3rem; }
.site-footer h5 { color:#fff; font-weight:800; margin-bottom:1rem; }
.site-footer a { color:#cfc9e8; }
.site-footer a:hover { color:#fff; }
.footer-bottom { border-top:1px solid rgba(255,255,255,.12); margin-top:2rem; padding-top:1rem; font-size:.85rem; color:#9990c4; }

/* -------------------- صفحة المنتج -------------------- */
.product-hero .cover-lg {
  border-radius: var(--radius); overflow:hidden; aspect-ratio: 3/4;
  background: linear-gradient(135deg, #2e2270 0%, var(--brand) 55%, #7b6ee0 100%);
  display:flex; align-items:center; justify-content:center;
}
.product-hero .cover-lg img { width:100%; height:100%; object-fit: cover; }
.price-lg { font-size: 2.1rem; font-weight: 800; color: var(--brand); }
.price-old-lg { color: var(--muted); text-decoration: line-through; font-size:1.2rem; margin-inline-start:.5rem; }
.type-chip { display:inline-block; background: var(--brand-soft); color: var(--brand-dark); font-weight:800; padding:.32rem .9rem; border-radius:999px; font-size:.85rem; }

/* -------------------- عام -------------------- */
.card-soft { border:1.5px solid var(--line); border-radius: var(--radius); background:#fff; }
.empty-state { text-align:center; padding:3rem 1rem; color: var(--muted); }
.badge.bg-success { background: var(--brand) !important; }

@media (max-width: 767px){
  .section-title { font-size: 1.55rem; }
  .section { padding: 2.3rem 0; }
  .category-card .thumb { width: 104px; height: 104px; }
}
