/* Gold/Navy theme + Cairo font */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');
:root {
  --primary: #0b1a3b; /* Navy */
  --secondary: #caa24c; /* Gold */
  --bg: #f8f8fb;
  --text: #222;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; font-family: 'Cairo', sans-serif; background: var(--bg); color: var(--text); }
a { text-decoration: none; color: inherit; }
.container { width: min(1200px, 92%); margin: 0 auto; }

/* ========== NAVBAR ========== */
.navbar { background: var(--primary); color:#fff; position: sticky; top:0; z-index:100; }
.navbar .container { display:flex; align-items:center; gap:20px; padding:10px 0; justify-content: space-between; }
.brand { display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.5px; }
.brand img { height:42px; width:auto; border-radius:10px; }
.navlinks { margin-inline-start:auto; display:flex; gap:14px; }
.navlinks a { padding:10px 14px; border-radius:10px; transition:.2s transform; color:#fff; }
.navlinks a:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.lang-toggle { background: var(--secondary); color:#111 !important; padding:8px 12px; border-radius:10px; }

/* ========== HERO ========== */
.hero { background: linear-gradient(120deg, var(--primary), #132a5e 60%); color:#fff; padding:50px 0; }
.hero .wrap { display:grid; grid-template-columns: 1.2fr 1fr; gap:24px; align-items:center; }
.hero h1 { font-size: clamp(26px, 4vw, 44px); margin:0 0 8px; }
.hero p { opacity:.9; margin:0 0 16px; }
.btn { display:inline-block; padding:12px 16px; border-radius:14px; border:2px solid var(--secondary); color: #111; background: var(--secondary); font-weight:700; transition:.2s transform, .2s box-shadow; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,.15); }

/* ========== SECTIONS/CARDS ========== */
.section { padding:40px 0; }
.section h2 { margin:0 0 20px; color: var(--primary); font-size: clamp(22px, 3vw, 32px); }
.grid { display:grid; gap:16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background:#fff; border-radius:18px; overflow:hidden; box-shadow:0 6px 18px rgba(0,0,0,.06); transition:.2s transform; }
.card:hover { transform: translateY(-3px); }
.card img { width:100%; height:170px; object-fit:cover; display:block; }
.card .pad { padding:12px; }
.price { color: var(--secondary); font-weight:900; font-size: 18px; }

/* ========== FOOTER ========== */
.footer { background:#0c1836; color:#ccd; padding:30px 0; }
.footer .cols { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap:20px; }
.footer a { color:#dde; display:block; margin:6px 0; }
.footer small { display:block; opacity:.8; margin-top:14px; }

/* ========== ADMIN ========== */
.admin-wrap { display:grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background:#0f2049; color:#fff; padding:18px; }
.sidebar a { display:block; padding:10px 12px; border-radius:10px; color:#fff; margin:6px 0; }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.12); }
.admin-content { background:#f4f6fb; padding:20px; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { background:#fff; padding:10px; border-bottom:1px solid #eee; text-align: start; }
.form-row { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:12px; margin:10px 0; }
input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="password"], select, textarea {
  width:100%; padding:10px; border-radius:10px; border:1px solid #ddd; background:#fff;
}
.badge { display:inline-block; padding:4px 8px; border-radius:999px; background:#eef; color:#113; }
.actions { display:flex; gap:6px; }
.alert { padding:10px 12px; border-radius:10px; background:#e6ffe7; color:#09360d; border:1px solid #b6f0bb; margin:10px 0; }
.danger { background:#ffe7e7; color:#360909; border-color:#f0b6b6; }

/* ========== MOBILE NAV (Hamburger + Drawer) ========== */
.hamburger { display:none; margin-inline-start:auto; background:transparent; border:0; padding:8px; cursor:pointer; }
.hamburger span { display:block; width:24px; height:2px; background:#fff; margin:5px 0; transition:.2s; border-radius:2px; }

.mobile-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(1px);
  opacity: 0; transition: opacity .25s ease;
  z-index: 98;
}
.mobile-menu {
  position: fixed; top:0; bottom:0;
  width: 78%;
  max-width: 340px;
  background: #0f2049; /* navy */
  color:#fff;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  z-index: 99;
  transform: translateX(var(--off, -100%));
  transition: transform .25s ease;
  display: grid; align-content: start; gap: 8px;
  inset-inline-start: 0; /* منطقي: يفتح من اليسار افتراضيًا */
}
:root:dir(rtl) .mobile-menu { inset-inline-start:auto; inset-inline-end:0; transform: translateX(var(--off, 100%)); }
.mobile-menu a { color:#fff; padding:12px; border-radius:10px; }
.mobile-menu a:hover { background: rgba(255,255,255,.12); }

/* حالة الفتح */
.mobile-backdrop.open { opacity: 1; }
.mobile-menu.open { --off: 0; }

/* ========== RESPONSIVE (<= 900px) ========== */
@media (max-width: 900px) {
  .navlinks { display: none !important; }   /* أخفِ روابط الديسكتوب */
  .hamburger { display: inline-block; }     /* أظهر زر 3 الخطوط */
  .navbar .container { gap:10px; }

  .hero .wrap { grid-template-columns: 1fr; }
  .hero .wrap > div:first-child { order: 2; text-align: center; }
  .hero .wrap > div:last-child  { order: 1; }
  .hero h1 { font-size: clamp(22px, 6vw, 30px); line-height: 1.3; }
  .hero p  { font-size: 14px; }
  .hero .btn { display:block; width:100%; text-align:center; margin:8px 0; }

  .container { width: min(1200px, 96%); }
  .card img, .hero img { width:100%; height:auto; }
}
/* ==== Mobile Drawer base ==== */
.mobile-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(1px);
  opacity: 0; transition: opacity .25s ease;
  z-index: 98;
  pointer-events: none;              /* لا تلتقط النقرات وهي مغلقة */
}
.mobile-menu {
  position: fixed; top:0; bottom:0;
  width:78%; max-width:340px;
  background:#0f2049; color:#fff;
  padding:18px; box-shadow:0 10px 30px rgba(0,0,0,.3);
  z-index:99;
  transform: translateX(var(--off, -100%));
  transition: transform .25s ease;
  display:grid; align-content:start; gap:8px;
  inset-inline-start:0;
  pointer-events: none;              /* لا تلتقط النقرات وهي مغلقة */
}
:root:dir(rtl) .mobile-menu { inset-inline-start:auto; inset-inline-end:0; transform: translateX(var(--off, 100%)); }
.mobile-menu a { color:#fff; padding:12px; border-radius:10px; }
.mobile-menu a:hover { background: rgba(255,255,255,.12); }

/* Open state */
.mobile-backdrop.open { opacity:1; pointer-events:auto; }
.mobile-menu.open { --off:0; pointer-events:auto; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .navlinks { display:none !important; }
  .hamburger { display:inline-block; }
  .navbar .container { gap:10px; }

  .hero .wrap { grid-template-columns:1fr; }
  .hero .wrap > div:first-child { order:2; text-align:center; }
  .hero .wrap > div:last-child  { order:1; }
  .hero h1 { font-size:clamp(22px,6vw,30px); line-height:1.3; }
  .hero p  { font-size:14px; }
  .hero .btn { display:block; width:100%; text-align:center; margin:8px 0; }

  .container { width:min(1200px,96%); }
  .card img, .hero img { width:100%; height:auto; }
}

/* ===== Desktop hard-fallback (أجبِر الإخفاء) ===== */
@media (min-width: 901px) {
  .mobile-menu,
  .mobile-backdrop { display:none !important; }
}
/* اجعل hidden يُخفي أي عنصر مهما كانت أنماطه */
[hidden] { display: none !important; }

/* زر الهامبرغر */
.hamburger { display:none; margin-inline-start:auto; background:transparent; border:0; padding:8px; cursor:pointer; }
.hamburger span { display:block; width:24px; height:2px; background:#fff; margin:5px 0; border-radius:2px; }

/* الخلفية */
.mobile-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  opacity: 0; transition: opacity .25s ease; z-index: 98;
}
.mobile-backdrop.open { opacity: 1; }

/* الدرج الجانبي — يختبئ يمينًا افتراضيًا ويظهر عند الفتح */
.mobile-menu {
  position: fixed; top:0; bottom:0;
  width: 78%; max-width: 340px;
  background: #0f2049; color:#fff; padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  z-index: 99;
  /* ثبِّته على اليمين دائمًا (RTL/LTR) */
  inset-inline-start: auto; inset-inline-end: 0;

  display: grid; align-content: start; gap: 8px;

  /* مخفي خارج الشاشة إلى اليمين */
  transform: translateX(100%);
  transition: transform .25s ease;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a { color:#fff; padding:12px; border-radius:10px; }
.mobile-menu a:hover { background: rgba(255,255,255,.12); }

/* نقاط التوقف */
@media (max-width: 900px) {
  .navbar .navlinks { display: none !important; }
  .hamburger { display: inline-block; }
  .navbar .container { gap:10px; }

  .hero .wrap { grid-template-columns: 1fr; }
  .hero .wrap > div:first-child { order: 2; text-align: center; }
  .hero .wrap > div:last-child  { order: 1; }
  .hero h1 { font-size: clamp(22px, 6vw, 30px); line-height: 1.3; }
  .hero .btn { display:block; width:100%; text-align:center; margin:8px 0; }

  .container { width: min(1200px, 96%); }
  .card img, .hero img { width:100%; height:auto; }
}
/* أخفِ أي عنصر عليه hidden مهما كان */
[hidden] { display: none !important; }

/* امنع أي تمرير أفقي على الصفحة كلها */
html, body { overflow-x: hidden; }

/* الخلفية: لا تتلقى نقرات وهي مغلقة */
.mobile-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  opacity: 0; transition: opacity .25s ease; z-index: 98;
  pointer-events: none;
}
.mobile-backdrop.open { opacity: 1; pointer-events: auto; }

/* الدرج الجانبي (مخفي بالكامل يمين الشاشة) */
.mobile-menu {
  position: fixed; top:0; bottom:0;
  width: 78%; max-width: 340px;
  background: #0f2049; color:#fff; padding: 18px;
  /* ثبّته يمينًا دائمًا */
  inset-inline-start: auto; inset-inline-end: 0;

  display: grid; align-content: start; gap: 8px;
  z-index: 99;

  /* اخفاؤه بالكامل + بدون ظل + لا تفاعُل */
  transform: translateX(calc(100% + 80px)); /* أبعد من عرض الشاشة */
  transition: transform .25s ease;
  box-shadow: none;                /* الظل هو الذي كان ظاهرًا */
  pointer-events: none;            /* لا يغطّي الصور وهو مغلق */
}
.mobile-menu.open {
  transform: translateX(0);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  pointer-events: auto;
}

/* احتياطي: لو أي عنصر داخل الهيرو يخرج، قصّه */
.hero { overflow: hidden; }

/* الموبايل */
@media (max-width: 900px) {
  .navbar .navlinks { display: none !important; }
  .hamburger { display: inline-block; }
  .container { width: min(1200px, 96%); }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .wrap > div:first-child { order: 2; text-align: center; }
  .hero .wrap > div:last-child  { order: 1; }
  .hero h1 { font-size: clamp(22px, 6vw, 30px); line-height: 1.3; }
  .hero .btn { display:block; width:100%; text-align:center; margin:8px 0; }
  .card img, .hero img { width:100%; height:auto; }
}

/* حاوية أزرار الموبايل (يمين/يسار حسب الاتجاه) */
.mobile-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

/* زر الهامبرغر موجود لديك سابقًا */

/* زر اللغة المصغّر للجوال */
.lang-ico{
  display: none;            /* مخفي على الديسكتوب */
  background: var(--secondary);
  color: #111; font-weight: 700;
  padding: 8px 10px; border-radius: 10px;
}
@media (max-width: 900px){
  .navbar .navlinks { display: none !important; } /* إخفاء روابط الديسكتوب */
  .lang-ico{ display: inline-block; }             /* إظهار زر اللغة للموبايل */
}

/* تبويبات/فلاتر الأقسام */
.menu-tabs{
  display:flex; gap:10px; align-items:center;
  overflow-x: auto; padding: 6px 0 10px;
  scrollbar-width: thin;
}
.menu-tabs .tab{
  flex: 0 0 auto;
  padding: 8px 12px; border-radius: 999px;
  background: #e9ecf6; color:#0b1a3b; font-weight:700;
  border: 1px solid #d8dff0; transition:.15s;
}
.menu-tabs .tab:hover{ transform: translateY(-1px); }
.menu-tabs .tab.active{
  background: var(--secondary); color:#111; border-color: var(--secondary);
}
@media (max-width: 900px){
  .menu-tabs{ margin-top: 8px; }
}
/* اجبر محتوى الكرت يلتزم بالإطار */
.card{ position:relative; overflow:hidden; }
.card .pad{ padding:14px; }

/* رأس العرض + الأسعار */
.offer-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }

/* اجعل منطقة الأسعار في سطر واحد وتتعامل جيدًا مع RTL */
.price-wrap{
  display:flex; align-items:center; gap:8px; flex-wrap:nowrap;
  direction:ltr;           /* مهم مع العربية حتى لا يتبعثر الخط المشطوب */
}

/* السعر قبل الخصم: شطب واضح ولا يتأثر بأي أنماط سابقة */
.price-before{
  text-decoration-line: line-through !important;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(0,0,0,.45);
  opacity:.75;
}

/* السعر بعد الخصم */
.price-after{
  font-weight:800;
  background: var(--secondary);
  color:#111;
  padding:2px 8px;
  border-radius:8px;
}
.price-single{ font-weight:700; }

/* اجعل الوصف لا يتمدّد خارج الكرت */
.offer-desc{
  white-space: normal;         /* لا أسطر طويلة */
  overflow-wrap: anywhere;     /* اكسر الكلمات الطويلة */
  word-break: break-word;
  margin:8px 0 10px;
}

/* صور/نص داخل الكرت دائمًا 100% من العرض المتاح */
.offer-thumb{ display:block; padding:0; border:0; background:none; cursor:pointer; width:100%; }
.offer-thumb img{ display:block; width:100%; height:170px; object-fit:cover; }

/* تخطيط الفوتر */
.footer { background:#0b1a3b; color:#fff; padding:28px 0; margin-top:40px; }
.footer-grid { display:grid; grid-template-columns: 1.2fr 1fr 1fr; gap:20px; }
.footer .f-col h3 { margin:0 0 10px; }
.footer .footer-title { font-size:14px; opacity:.9; margin:6px 0 6px; }

/* روابط الفوتر */
.footer-links, .footer-pages { list-style:none; margin:0; padding:0; }
.footer-links li, .footer-pages li { margin:6px 0; }
.footer a { color:#fff; opacity:.95; }
.footer a:hover { text-decoration:underline; opacity:1; }

/* شبكة متجاوبة */
@media (max-width:900px){
  .footer-grid { grid-template-columns: 1fr; }
}

/* زر واتساب العائم (سبق أضفناه، نعيده هنا إن لم يوجد) */
.whatsapp-fab{
  position: fixed; left: 14px; bottom: 18px; width:56px; height:56px;
  border-radius:50%; background:#25D366; color:#fff; display:flex; align-items:center; justify-content:center;
  box-shadow: 0 10px 24px rgba(0,0,0,.25); z-index: 120; transition: transform .2s ease, box-shadow .2s ease;
}
.whatsapp-fab i{ font-size:26px; }
.whatsapp-fab:hover{ transform: translateY(-2px) scale(1.03); }
@media (max-width:420px){ .whatsapp-fab{ left:10px; bottom:16px; width:52px; height:52px; } }

