/* ============================================================
   دليلك — styles.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Amiri:wght@400;700&display=swap');

:root {
  --brand-blue: #2A3FB8;
  --brand-blue-dark: #1F2F8C;
  --accent: #F2C94C;
  --accent-dark: #E0B73E;
  --ink: #0F1438;
  --bg-main: #F6F7FB;
  --bg-soft: #EEF1F8;
  --text-primary: #1A1F35;
  --text-secondary: #4A5168;
  --text-muted: #8B91A8;
  --border-color: #E2E6F0;
  --shadow-sm: 0 1px 3px rgba(15,20,56,0.08);
  --shadow-md: 0 4px 12px rgba(15,20,56,0.1);
  --shadow-lg: 0 10px 30px rgba(15,20,56,0.15);
  --shadow-blue: 0 6px 20px rgba(42,63,184,0.25);
  --shadow-yellow: 0 6px 20px rgba(242,201,76,0.35);
  --header-height: 70px;
  --ticker-height: 38px;
  --banner-height: 60px;
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* =========== الهيدر =========== */
.top-header {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
.logo { display: flex; align-items: center; gap: 14px; }
.logo-img { height: 52px; width: auto; display: block; }

.header-actions { display: flex; align-items: center; gap: 16px; }

.subscribe-btn {
  background: var(--accent);
  color: var(--ink);
  border: 2px solid var(--accent);
  border-radius: 11px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: var(--shadow-yellow);
}
.subscribe-btn:hover {
  background: var(--brand-blue);
  color: var(--accent);
  border-color: var(--brand-blue);
  transform: translateY(-2px);
}
.subscribe-btn svg { width: 16px; height: 16px; }

.social-icons { display: flex; gap: 8px; }
.social-link {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-blue);
  transition: var(--transition);
  text-decoration: none;
}
.social-link:hover { background: var(--brand-blue); color: #fff; transform: translateY(-2px); }
.social-link svg { width: 16px; height: 16px; }

/* =========== شريط الأخبار المتحرك =========== */
.news-ticker-wrap {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0;
  height: var(--ticker-height);
  background: var(--ink);
  display: flex;
  align-items: center;
  z-index: 999;
  border-bottom: 1px solid #000;
}
.ticker-label {
  background: var(--accent);
  color: var(--ink);
  padding: 8px 18px;
  font-weight: 800;
  font-size: 13px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  border-left: 2px solid var(--ink);
}
.news-ticker {
  flex: 1;
  overflow: hidden;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  position: relative;
}
.ticker-track {
  display: inline-block;
  padding-right: 100%;
  animation: tickerScroll 90s linear infinite;
  white-space: nowrap;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}
.ticker-link:hover {
  color: #FFFFFF;
  text-decoration: underline;
}
.ticker-event { color: var(--accent); }
.ticker-offer { color: #FFD96B; font-weight: 700; }
@keyframes tickerScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* =========== بانر الإعلانات =========== */
.ads-banner {
  position: fixed;
  top: calc(var(--header-height) + var(--ticker-height));
  left: 0; right: 0;
  height: var(--banner-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  z-index: 998;
  font-weight: 700;
  transition: background 0.5s, color 0.5s;
}
.banner-icon { font-size: 24px; }
.banner-text { flex: 1; }
.banner-title { font-size: 15px; font-weight: 800; }
.banner-subtitle { font-size: 12px; opacity: 0.85; }

/* ⭐ البانر المميز (مدفوع) — يظهر تحت بانر الإعلانات */
.featured-ads-banner {
  position: fixed;
  top: calc(var(--header-height) + var(--ticker-height) + var(--banner-height));
  left: 0; right: 0;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #0F1438;
  padding: 8px 24px;
  z-index: 997;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  border-bottom: 2px solid #D97706;
  cursor: pointer;
  transition: filter 0.2s;
  font-weight: 700;
}
.featured-ads-banner:hover { filter: brightness(1.05); }
.featured-ads-banner .feat-tag {
  background: #0F1438;
  color: #FFD700;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.featured-ads-banner .feat-image {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background-size: cover;
  background-position: center;
  background-color: rgba(15,20,56,0.1);
  flex-shrink: 0;
}
.featured-ads-banner .feat-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.featured-ads-banner .feat-title {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}
.featured-ads-banner .feat-subtitle {
  font-size: 11.5px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.featured-ads-banner .feat-close {
  background: rgba(15,20,56,0.15);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  color: #0F1438;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-ads-banner .feat-close:hover { background: rgba(15,20,56,0.3); }

/* عند ظهور البانر المميز، المحتوى الرئيسي ينزل أكثر */
.main-container.has-featured-ad {
  top: calc(var(--header-height) + var(--ticker-height) + var(--banner-height) + 60px);
}
@media (max-width: 600px) {
  .featured-ads-banner { padding: 6px 12px; gap: 8px; }
  .featured-ads-banner .feat-tag { font-size: 10px; padding: 2px 6px; }
  .featured-ads-banner .feat-image { width: 30px; height: 30px; }
  .featured-ads-banner .feat-title { font-size: 12.5px; }
  .featured-ads-banner .feat-subtitle { font-size: 10.5px; }
  .main-container.has-featured-ad {
    top: calc(var(--header-height) + var(--ticker-height) + var(--banner-height) + 48px);
  }
}

/* =========== الحاوية الرئيسية =========== */
.main-container {
  position: fixed;
  top: calc(var(--header-height) + var(--ticker-height) + var(--banner-height));
  left: 0; right: 0; bottom: 0;
  display: flex;
}

/* =========== الشريط الجانبي =========== */
.sidebar {
  width: 280px;
  background: #fff;
  overflow-y: auto;
  border-left: 1px solid var(--border-color);
  padding: 16px;
}
.sidebar-section { margin-bottom: 18px; }
.sidebar-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-right: 8px;
  border-right: 3px solid var(--accent);
}

.mobile-close { display: none; }

.style-buttons, .layer-buttons { display: flex; flex-direction: column; gap: 6px; }
.style-buttons { flex-direction: row; gap: 6px; }
.style-btn {
  flex: 1;
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.style-btn svg { width: 19px; height: 19px; }
.style-btn:hover { background: #fff; border-color: var(--brand-blue); color: var(--brand-blue); }
.style-btn.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  box-shadow: 0 3px 9px rgba(42,63,184,0.28);
}

.layer-btn {
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  width: 100%;
}
.layer-btn svg { width: 18px; height: 18px; }
.layer-btn:hover { background: #fff; border-color: var(--brand-blue); color: var(--brand-blue); }
.layer-btn.active { background: var(--brand-blue); color: #fff; }
.layer-btn.active svg { stroke: var(--accent); }

/* ✨ زر "دليلك للرحلات" - تصميم خاص جذاب */
.layer-btn-tours {
  position: relative;
  background: linear-gradient(135deg, rgba(242,201,76,0.15), rgba(42,63,184,0.08));
  border: 1px solid rgba(242,201,76,0.4);
}
.layer-btn-tours .layer-btn-badge {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.layer-btn-tours:hover {
  background: linear-gradient(135deg, rgba(242,201,76,0.25), rgba(42,63,184,0.12));
  border-color: var(--accent);
}
.layer-btn-tours.active {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark, #1E2C8E));
  color: #fff;
}
.layer-btn-tours.active .layer-btn-badge {
  background: var(--accent);
  color: var(--ink);
}

/* ✨ سيارة الرحلة المتحركة (Leaflet marker) */
.tour-car-marker {
  width: 44px !important;
  height: 44px !important;
  margin-left: -22px !important;
  margin-top: -22px !important;
}
.tour-car-marker .car-body {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent, #F2C94C), #E5B83C);
  border: 3px solid var(--brand-blue, #2A3FB8);
  border-radius: 12px 12px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 18px rgba(42,63,184,0.45), 0 2px 6px rgba(0,0,0,0.3);
  animation: tourCarBob 1.4s ease-in-out infinite;
  position: relative;
}
.tour-car-marker .car-body::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 8px;
  background: rgba(15,20,56,0.30);
  border-radius: 50%;
  filter: blur(3px);
}
@keyframes tourCarBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ✨ نقاط محطات الرحلة */
.tour-stop-marker {
  width: 38px !important;
  height: 38px !important;
  margin-left: -19px !important;
  margin-top: -38px !important;
}
.tour-stop-marker .stop-pin {
  width: 38px;
  height: 38px;
  background: var(--brand-blue, #2A3FB8);
  border: 3px solid var(--accent, #F2C94C);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(42,63,184,0.4);
}
.tour-stop-marker .stop-pin .stop-num {
  color: var(--accent, #F2C94C);
  font-weight: 900;
  font-size: 15px;
  transform: rotate(45deg);
  font-family: 'Cairo', sans-serif;
}

/* ✨ خط مسار الرحلة (يُطبَّق على leaflet polyline عبر className) */
.tour-route-path {
  filter: drop-shadow(0 0 6px rgba(242,201,76,0.5));
}

/* ✨ بانل اختيار المسارات */
.tours-panel {
  position: fixed;
  /* احسبها من أعلى عبر CSS vars التي يضبطها الـ JS */
  top: calc(var(--header-height, 60px) + var(--ticker-height, 36px) + var(--banner-height, 48px) + 16px);
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - var(--header-height, 60px) - var(--ticker-height, 36px) - var(--banner-height, 48px) - 40px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 50px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  z-index: 900;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(242,201,76,0.3);
}
.tours-panel-header {
  background: linear-gradient(135deg, var(--brand-blue, #2A3FB8), var(--brand-blue-dark, #1E2C8E));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tours-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tours-panel-header h3 .accent-dot { color: var(--accent, #F2C94C); }
.tours-panel-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.tours-panel-close:hover { background: rgba(255,255,255,0.28); }
.tours-panel-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}
/* ✨ حاوية تبديل الدولة في الأسفل — أقل بروزاً، صغيرة الحجم */
.tours-country-tabs-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border, #E5E7EB);
}
.tours-country-tabs-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted, #6B7280);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.tours-country-tabs {
  display: flex;
  gap: 6px;
  /* قابل للتمرير الأفقي على كل المنصات */
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* إخفاء scrollbar على معظم المتصفحات */
  scrollbar-width: thin;
}
.tours-country-tabs::-webkit-scrollbar { height: 4px; }
.tours-country-tabs::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
.tours-country-tab {
  background: var(--bg-soft, #F3F4F6);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-secondary, #4B5563);
  transition: var(--transition, all 0.2s);
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
}
.tours-country-tab:hover {
  background: #fff;
  border-color: var(--brand-blue, #2A3FB8);
  color: var(--brand-blue, #2A3FB8);
}
.tours-country-tab.active {
  background: var(--brand-blue, #2A3FB8);
  color: #fff;
}

/* بطاقة المسار */
.tour-route-card {
  background: var(--bg-soft, #F9FAFB);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tour-route-card:hover {
  border-color: var(--accent, #F2C94C);
  box-shadow: 0 6px 18px rgba(42,63,184,0.10);
  transform: translateY(-2px);
}
.tour-route-card.active {
  background: linear-gradient(135deg, rgba(242,201,76,0.12), rgba(42,63,184,0.06));
  border-color: var(--accent, #F2C94C);
}
.tour-route-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink, #0F1438);
  margin: 0 0 6px;
  line-height: 1.4;
}
.tour-route-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.tour-route-card-tag {
  background: rgba(42,63,184,0.10);
  color: var(--brand-blue, #2A3FB8);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.tour-route-card-tag.accent {
  background: rgba(242,201,76,0.20);
  color: #8B6914;
}
.tour-route-card-desc {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary, #4B5563);
  margin: 0 0 10px;
}
.tour-route-card-path {
  font-size: 12px;
  color: var(--brand-blue, #2A3FB8);
  font-weight: 700;
  background: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(42,63,184,0.25);
  margin-bottom: 10px;
}
.tour-route-card-btn {
  width: 100%;
  background: var(--brand-blue, #2A3FB8);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 9px;
  font-family: inherit;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tour-route-card-btn:hover {
  background: var(--brand-blue-dark, #1E2C8E);
}
.tour-route-card.active .tour-route-card-btn {
  background: var(--accent, #F2C94C);
  color: var(--ink, #0F1438);
}

/* بانل تفاصيل المحطة (Popup داخل الخريطة) — تصميم محدّث بصورة */
.tour-stop-popup .leaflet-popup-content-wrapper {
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  padding: 0;
  overflow: hidden;
}
.tour-stop-popup .leaflet-popup-content {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  min-width: 280px;
  width: 300px !important;
}
.tour-stop-popup .leaflet-popup-close-button {
  z-index: 5;
  color: #fff !important;
  width: 28px !important;
  height: 28px !important;
  font-size: 20px !important;
  background: rgba(15,20,56,0.55) !important;
  border-radius: 50% !important;
  top: 8px !important;
  left: 8px !important;
  right: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
}
/* ✨ صورة المحطة في الأعلى — مع بديل متدرّج اللون واسم المدينة */
.tour-stop-content { direction: rtl; text-align: right; }
.tour-stop-img {
  width: 100%;
  height: 150px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* البديل الافتراضي: تدرّج أزرق-ذهبي أنيق */
  background-image: linear-gradient(135deg, #2A3FB8 0%, #1E2C8E 60%, #F2C94C 200%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tour-stop-img-label {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  font-family: 'Cairo', sans-serif;
  transition: opacity 0.3s;
  padding: 0 12px;
  text-align: center;
}
/* عند تحميل صورة حقيقية، نخفي الاسم النصّي ونضيف تظليلاً سفلياً */
.tour-stop-img.has-image .tour-stop-img-label { opacity: 0; }
.tour-stop-img.has-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.25), transparent 50%);
}
.tour-stop-body { padding: 12px 16px 16px; }
.tour-stop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-direction: row-reverse;
}
.tour-stop-content h4 {
  margin: 0;
  color: var(--brand-blue, #2A3FB8);
  font-size: 16px;
  font-weight: 800;
}
.tour-stop-content .stop-duration {
  font-size: 11px;
  background: var(--accent, #F2C94C);
  color: var(--ink, #0F1438);
  padding: 3px 9px;
  border-radius: 7px;
  font-weight: 800;
  display: inline-block;
  white-space: nowrap;
}
.tour-stop-content p {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text, #1F2937);
  margin: 0 0 10px;
  text-align: right;
}
/* ✨ قائمة المعالم: نقاط صفراء + أسماء بالأزرق الداكن العريض */
.tour-stop-highlights {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tour-stop-highlights li {
  position: relative;
  padding-right: 18px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-blue, #2A3FB8);
  line-height: 1.5;
  text-align: right;
}
.tour-stop-highlights li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent, #F2C94C);
  box-shadow: 0 1px 3px rgba(242,201,76,0.5);
}

@media (max-width: 600px) {
  /* ✨ على الموبايل: البانل يصبح bottom-sheet في الأسفل بدلاً من تغطية الشاشة */
  .tours-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: none;
    max-height: 50vh;
    border-radius: 18px 18px 0 0;
    border: none;
    border-top: 2px solid rgba(242,201,76,0.3);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
    transition: transform 0.3s ease-out, max-height 0.3s ease-out;
  }
  /* الحالة المطوية: يبقى الهيدر فقط في الأسفل ليُعاد فتحه بالضغط */
  .tours-panel.collapsed {
    max-height: 56px;
    overflow: hidden;
  }
  .tours-panel.collapsed .tours-panel-body { display: none; }
  .tours-panel.collapsed .tours-panel-collapse-icon { transform: rotate(180deg); }
  /* مقبض البانل (handle bar) في أعلى البانل على الموبايل */
  .tours-panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
    z-index: 2;
    pointer-events: none;
  }
  .tours-panel-header {
    padding-top: 18px;
    cursor: pointer;
  }
  .tours-country-grid { grid-template-columns: 1fr 1fr !important; }
}

/* زر المطّ/الطيّ (يظهر بجانب X) */
.tours-panel-collapse {
  display: none;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  margin-left: 6px;
}
.tours-panel-collapse:hover { background: rgba(255,255,255,0.28); }
.tours-panel-collapse-icon {
  display: inline-block;
  transition: transform 0.25s ease;
}
@media (max-width: 600px) {
  .tours-panel-collapse { display: inline-flex; }
}

/* ✨ شبكة بطاقات الدول داخل بانل اختيار الدولة */
.tours-country-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.tours-country-card {
  background: linear-gradient(135deg, var(--bg-soft, #F9FAFB), #fff);
  border: 2px solid var(--border, #E5E7EB);
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  position: relative;
}
.tours-country-card:hover {
  border-color: var(--accent, #F2C94C);
  box-shadow: 0 8px 22px rgba(42,63,184,0.18);
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(242,201,76,0.10), #fff);
}
.tours-country-card .tcc-flag {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.tours-country-card .tcc-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink, #0F1438);
  margin-bottom: 4px;
}
.tours-country-card .tcc-count {
  font-size: 10.5px;
  color: var(--brand-blue, #2A3FB8);
  background: rgba(42,63,184,0.10);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  font-weight: 700;
}

/* ✨ زر "دليل رحلتك التفاعلي" داخل رأس بطاقة الدولة — حجم مدمج */
.country-card-tours-cta {
  background: linear-gradient(135deg, var(--accent, #F2C94C), #E5B83C);
  color: var(--ink, #0F1438);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 9px;
  padding: 6px 11px;
  width: 100%;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(242,201,76,0.4), 0 0 0 0 rgba(242,201,76,0.6);
  position: relative;
  overflow: hidden;
  animation: cccPulse 2.5s ease-in-out infinite;
  -webkit-tap-highlight-color: rgba(242,201,76,0.3);
  line-height: 1.2;
}
@keyframes cccPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(242,201,76,0.4), 0 0 0 0 rgba(242,201,76,0.5); }
  50%      { box-shadow: 0 2px 8px rgba(242,201,76,0.5), 0 0 0 5px rgba(242,201,76,0); }
}
.country-card-tours-cta:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #F4D366, #EAB939);
  animation: none;
  box-shadow: 0 4px 14px rgba(242,201,76,0.55);
}
.country-card-tours-cta:active { transform: translateY(0); }
.country-card-tours-cta .ccc-icon {
  font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  flex-shrink: 0;
}
.country-card-tours-cta .ccc-arrow {
  font-size: 13px;
  opacity: 0.7;
  margin-right: auto;
  transition: transform 0.2s, opacity 0.2s;
  flex-shrink: 0;
}
.country-card-tours-cta:hover .ccc-arrow {
  opacity: 1;
  transform: translateX(-2px);
}
[dir="ltr"] .country-card-tours-cta .ccc-arrow {
  transform: rotate(180deg);
  margin-right: 0;
  margin-left: auto;
}
[dir="ltr"] .country-card-tours-cta:hover .ccc-arrow {
  transform: rotate(180deg) translateX(-2px);
}
/* في الموبايل، تصغير أكثر */
@media (max-width: 600px) {
  .country-card-tours-cta {
    font-size: 11px;
    padding: 5px 9px;
    border-radius: 8px;
  }
  .country-card-tours-cta .ccc-icon { font-size: 13px; }
  .country-card-tours-cta .ccc-arrow { font-size: 12px; }

  /* ✨ أزرار نمط الخريطة مدمجة أكثر على الموبايل لتوفير المساحة */
  .style-btn {
    padding: 7px 4px;
    font-size: 10.5px;
    border-radius: 9px;
    gap: 3px;
  }
  .style-btn svg { width: 17px; height: 17px; }
  .sidebar-section { margin-bottom: 12px; }
  .sidebar-title { margin-bottom: 7px; font-size: 11px; }
}

.countries-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.country-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 0;
}
.country-item:hover { background: var(--bg-soft); transform: translateX(-3px); }
.country-flag { font-size: 20px; flex-shrink: 0; }
.country-info { flex: 1; min-width: 0; overflow: hidden; }
.country-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-capital { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-mini {
  background: var(--bg-soft);
  border-radius: 11px;
  padding: 12px 8px;
  text-align: center;
  border-right: 3px solid var(--accent);
}
.stat-mini .num {
  font-size: 22px;
  font-weight: 900;
  color: var(--brand-blue);
  line-height: 1;
  font-family: 'Cairo', sans-serif;
}
.stat-mini .lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ✨ تمييز إحصائية السكان (الأرقام الكبيرة) */
.stat-mini.stat-highlight {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--brand-blue), #1E2C8E);
  border-right: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
  padding: 14px 10px;
}
.stat-mini.stat-highlight .num {
  color: var(--accent);
  font-size: 26px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.stat-mini.stat-highlight .lbl {
  color: rgba(255,255,255,0.85);
  font-weight: 700;
  font-size: 12px;
}

/* ✨ بطاقة الإحصائيات التسويقية الكبيرة */
.stat-mini.stat-hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #1E2C8E 50%, var(--brand-blue) 100%);
  border: 3px solid var(--accent);
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(42,63,184,0.25);
  position: relative;
  overflow: hidden;
}
.stat-mini.stat-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(242,201,76,0.15), transparent 70%);
  pointer-events: none;
}
.stat-mini.stat-hero .num-big {
  position: relative;
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 3px 10px rgba(0,0,0,0.3);
  line-height: 1;
  font-family: 'Cairo', sans-serif;
  margin-bottom: 8px;
}
.stat-mini.stat-hero .lbl-big {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 6px;
}
.stat-mini.stat-hero .lbl-tagline {
  position: relative;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* =========== حاوية الخريطة =========== */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#map { width: 100%; height: 100%; }

/* تنسيق Popups الخريطة */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 4px;
  font-family: 'Cairo', sans-serif;
}
.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 13px;
  direction: rtl;
}
.leaflet-popup-content h3 {
  margin: 0 0 8px;
  color: var(--brand-blue);
  font-size: 15px;
  font-weight: 800;
}
.leaflet-popup-content p { margin: 4px 0; font-size: 12px; }
.popup-nav-btn {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 9px;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  transition: var(--transition);
}
.popup-nav-btn:hover { background: var(--brand-blue-dark); transform: translateY(-1px); }

/* ماركرات الدول */
.country-marker-wrapper {
  background: transparent !important;
  border: none !important;
  /* مهم: يسمح للمحتوى بأن يتجاوز حجم iconSize ليظهر الاسم كاملاً */
  overflow: visible !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.country-marker {
  background: var(--accent);
  color: var(--ink);
  padding: 5px 11px;
  border-radius: 18px;
  border: 2.5px solid var(--brand-blue);
  font-weight: 800;
  font-size: 11.5px;
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(42, 63, 184, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  /* يجعل الماركر يتمركز فوق الإحداثيات تماماً */
  position: relative;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: rgba(42, 63, 184, 0.2);
  /* ضمان عدم التداخل مع الحاوي */
  width: max-content;
}
.country-marker:hover {
  transform: scale(1.08);
  background: var(--brand-blue);
  color: var(--accent);
  z-index: 1000;
}
.country-marker:active {
  transform: scale(0.95);
}
.country-marker .flag-emoji { font-size: 14px; }

/* ماركرات عامة */
.custom-marker-wrapper { background: transparent !important; border: none !important; }
.custom-marker {
  width: 36px; height: 36px;
  border-radius: 50% 50% 50% 0;
  background: var(--brand-blue);
  border: 3px solid var(--accent);
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-blue);
}
.custom-marker.marker-yellow { background: var(--accent); border-color: var(--brand-blue); }
.custom-marker.marker-dark { background: var(--ink); border-color: var(--accent); }
.custom-marker-icon {
  transform: rotate(45deg);
  color: #fff;
  font-size: 14px;
}
.custom-marker.marker-yellow .custom-marker-icon { color: var(--ink); }

/* =========== زر الموبايل =========== */
.mobile-toggle {
  display: none;
  position: absolute;
  top: 16px;        /* ✨ من الأعلى بدلاً من الأسفل */
  left: 16px;       /* ✨ من اليسار حتى لا يتداخل مع أدوات اليمين */
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--brand-blue);
  color: var(--accent);
  border: none;
  font-size: 22px;
  cursor: pointer;
  z-index: 500;
  box-shadow: var(--shadow-blue);
  font-weight: bold;
}
.mobile-toggle:active {
  transform: scale(0.95);
}

/* =========== أدوات الخريطة (يمين) =========== */
.map-tools {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
}
.map-tool-btn {
  width: 46px; height: 46px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}
.map-tool-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.map-tool-btn:hover { background: var(--brand-blue); color: #fff; transform: translateY(-2px); }
.map-tool-btn.active { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.tool-label {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: var(--ink);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  font-weight: 600;
}
.map-tool-btn:hover .tool-label { opacity: 1; transform: translateY(-50%) translateX(-12px); }
.tools-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* ✨ زر "دليلك للرحلات" المميّز في الأدوات العائمة */
.map-tool-btn-tours {
  background: linear-gradient(135deg, var(--brand-blue, #2A3FB8), var(--brand-blue-dark, #1E2C8E)) !important;
  color: #fff !important;
  border-color: var(--accent, #F2C94C) !important;
  border-width: 2px !important;
  box-shadow: 0 4px 16px rgba(42,63,184,0.35), 0 0 0 3px rgba(242,201,76,0.15) !important;
  animation: toursButtonPulse 2.6s ease-in-out infinite;
}
.map-tool-btn-tours:hover {
  background: linear-gradient(135deg, var(--accent, #F2C94C), #E5B83C) !important;
  color: var(--ink, #0F1438) !important;
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 8px 22px rgba(242,201,76,0.5) !important;
}
.map-tool-btn-tours.active {
  background: linear-gradient(135deg, var(--accent, #F2C94C), #E5B83C) !important;
  color: var(--ink, #0F1438) !important;
}
.map-tool-btn-tours svg { stroke-width: 2.2 !important; }
.map-tool-btn-tours .tool-badge-new {
  position: absolute;
  top: -7px;
  left: -10px;
  background: var(--accent, #F2C94C);
  color: var(--ink, #0F1438);
  font-size: 9px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 8px;
  letter-spacing: 0.2px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-family: 'Cairo', sans-serif;
  animation: toursBadgeBob 1.8s ease-in-out infinite;
}
@keyframes toursButtonPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(42,63,184,0.35), 0 0 0 3px rgba(242,201,76,0.15); }
  50% { box-shadow: 0 4px 18px rgba(42,63,184,0.45), 0 0 0 6px rgba(242,201,76,0.25); }
}
@keyframes toursBadgeBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-2px) rotate(3deg); }
}

/* =========== نوافذ الأدوات (تظهر يمين، بجانب الأدوات) =========== */
.popup-panel {
  position: absolute;
  top: 16px;
  right: 76px;
  width: 340px;
  max-height: calc(100vh - var(--header-height) - var(--ticker-height) - var(--banner-height) - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 500;
  display: none;
}
.popup-panel.active { display: block; }
.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.popup-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--brand-blue);
}
.popup-title-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.popup-close {
  background: var(--bg-soft);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 800;
}
.popup-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
.popup-panel select, .popup-panel input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg-soft);
  margin-bottom: 8px;
  font-weight: 600;
}
.popup-panel select:focus, .popup-panel input:focus {
  outline: none;
  border-color: var(--brand-blue);
  background: #fff;
}
.hint { font-size: 11px; color: var(--text-muted); margin-top: 10px; text-align: center; }
.hint-small { font-size: 11px; opacity: 0.8; }

/* البوصلة */
.compass-circle {
  display: flex; justify-content: center; padding: 18px 0;
}
.compass-rose {
  width: 180px; height: 180px;
  border: 3px solid var(--brand-blue);
  border-radius: 50%;
  position: relative;
  background: var(--bg-soft);
}
.dir {
  position: absolute;
  font-weight: 800;
  color: var(--brand-blue);
}
.dir.n { top: 8px; left: 50%; transform: translateX(-50%); color: #DC2626; }
.dir.s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.dir.e { right: 10px; top: 50%; transform: translateY(-50%); }
.dir.w { left: 10px; top: 50%; transform: translateY(-50%); }
.compass-needle {
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 70px;
  background: linear-gradient(to top, transparent 0%, transparent 50%, #DC2626 50%, #DC2626 100%);
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%);
  transition: transform 0.3s;
}
.compass-info { text-align: center; }
.compass-info strong { color: var(--brand-blue); font-size: 18px; }

/* القبلة */
.qibla-display {
  text-align: center;
  background: var(--bg-soft);
  padding: 18px;
  border-radius: 12px;
  margin-top: 12px;
}
.qibla-arrow-wrap {
  width: 120px; height: 120px;
  margin: 0 auto 12px;
  border: 3px dashed var(--brand-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qibla-arrow {
  font-size: 50px;
  transition: transform 0.5s;
}
.qibla-info { display: flex; justify-content: space-around; font-size: 13px; }
.qibla-info strong { color: var(--brand-blue); font-weight: 800; }

/* العملات */
.currency-row {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-bottom: 10px;
}
.currency-field { flex: 1; }
.currency-field label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: block;
  font-weight: 700;
}
.currency-field select, .currency-field input { margin-bottom: 0; }
.swap-currencies {
  background: var(--accent);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0;
}
.currency-rate-info {
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  margin-top: 6px;
}
.currency-rate-info strong { color: var(--accent); font-weight: 800; }

/* قياس المسافة / الوقود / الطقس */
.distance-result, .weather-result {
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-top: 10px;
}
.distance-result .big, .weather-result .big {
  font-size: 30px;
  font-weight: 900;
  color: var(--accent);
  margin: 4px 0;
  font-family: 'Cairo', sans-serif;
}
.distance-result .lbl, .weather-result .lbl {
  font-size: 12px;
  opacity: 0.85;
}
.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.weather-cell {
  background: var(--bg-soft);
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  border-right: 3px solid var(--accent);
}
.weather-cell .ico { font-size: 22px; margin-bottom: 4px; }
.weather-cell .val { font-weight: 800; color: var(--brand-blue); font-size: 15px; }
.weather-cell .lbl { font-size: 11px; color: var(--text-muted); }

.fuel-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fuel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  padding: 12px 14px;
  border-radius: 10px;
  border-right: 4px solid var(--brand-blue);
}
.fuel-row.premium { border-right-color: var(--accent); }
.fuel-row.diesel { border-right-color: var(--ink); }
.fuel-row .name { font-weight: 700; font-size: 13px; }
.fuel-row .price { font-weight: 900; color: var(--brand-blue); font-size: 18px; font-family: 'Cairo'; }
.fuel-row .unit { font-size: 11px; color: var(--text-muted); margin-right: 4px; }

/* ============================================================
   بطاقة الدولة (تظهر على اليسار - الجهة المقابلة للأدوات)
   ============================================================ */
.country-card {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 460px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%) translateX(-30px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.country-card.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.card-header {
  background: var(--brand-blue);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 3px solid var(--accent);
}
.card-flag {
  font-size: 30px;
  flex-shrink: 0;
  line-height: 1;
}
.card-title-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.15;
}
.card-capital { display: none; } /* تمت إزالته توفيراً للمساحة */
.card-close {
  background: rgba(255,255,255,0.15);
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 800;
  flex-shrink: 0;
  align-self: flex-start;
  line-height: 1;
}
.card-close:hover { background: var(--accent); color: var(--ink); }

/* التبويبات */
.card-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 10px 14px 0;
  background: #fff;
  border-bottom: 2px solid var(--border-color);
  /* ✨ سطر واحد قابل للتمرير الأفقي */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-blue) transparent;
}
.card-tabs::-webkit-scrollbar {
  height: 4px;
}
.card-tabs::-webkit-scrollbar-thumb {
  background: var(--brand-blue);
  border-radius: 4px;
}
.card-tabs::-webkit-scrollbar-track {
  background: transparent;
}
.card-tab {
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  border-radius: 10px 10px 0 0;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-bottom: -2px;
  flex-shrink: 0; /* لا يتقلّص داخل الـ flex */
}
.card-tab:hover { background: #fff; color: var(--brand-blue); }
.card-tab.active {
  background: #fff;
  color: var(--brand-blue);
  border-color: var(--border-color);
  border-bottom-color: #fff;
  font-weight: 800;
}

.card-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

/* نظرة عامة */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.ov-cell {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  border-right: 3px solid var(--brand-blue);
}
.ov-icon { font-size: 24px; margin-bottom: 6px; }
.ov-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.ov-value { font-weight: 800; color: var(--brand-blue); font-size: 13px; }

/* ✨ نسخة مدمجة (بطاقات صغيرة) — للنظرة العامة بعد زر السفر */
.overview-grid-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.ov-cell-mini {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  border-right: 2px solid var(--brand-blue);
}
.ov-icon-mini { font-size: 18px; margin-bottom: 2px; }
.ov-label-mini { font-size: 9px; color: var(--text-muted); margin-bottom: 2px; line-height: 1.2; }
.ov-value-mini { font-weight: 800; color: var(--brand-blue); font-size: 11px; line-height: 1.2; }

/* ✨ زر متطلبات السفر */
.travel-req-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42,63,184,0.35) !important;
}

@media (max-width: 500px) {
  .overview-grid-compact { grid-template-columns: repeat(2, 1fr); }
  .ov-cell-mini { padding: 6px 4px; }
  .ov-icon-mini { font-size: 16px; }
  .ov-label-mini { font-size: 8px; }
  .ov-value-mini { font-size: 10px; }
}

.ov-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: 10px;
}
.ov-cities-list { display: flex; flex-wrap: wrap; gap: 6px; }
.city-chip {
  background: var(--accent);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.city-chip:hover { background: var(--brand-blue); color: var(--accent); transform: translateY(-1px); }

/* قائمة العناصر (سياحة، مطاعم، ...) */
.list-items { display: flex; flex-direction: column; gap: 10px; }
.list-card {
  background: var(--bg-soft);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid transparent;
}
.list-card:hover {
  background: #fff;
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-md);
}
.list-card-body {
  padding: 12px 14px;
  cursor: pointer;
}
.list-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}
.list-meta .tag {
  background: var(--brand-blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.list-meta .tag-soft {
  background: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.rating-stars {
  background: var(--accent) !important;
  color: var(--ink) !important;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 800;
}
.goto-btn {
  width: 100%;
  background: var(--brand-blue);
  color: #fff;
  border: none;
  padding: 11px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.goto-btn:hover { background: var(--brand-blue-dark); }
.goto-btn svg { width: 16px; height: 16px; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* الهواتف */
.phones-grid { display: flex; flex-direction: column; gap: 8px; }
.phone-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  padding: 14px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  border-right: 4px solid var(--accent);
}
.phone-card:hover { background: #fff; transform: translateX(-3px); box-shadow: var(--shadow-md); }
.phone-icon { font-size: 26px; }
.phone-info { flex: 1; }
.phone-name { font-weight: 800; font-size: 14px; }
.phone-cat { font-size: 11px; color: var(--text-muted); }
.phone-num {
  font-weight: 900;
  font-size: 18px;
  color: var(--brand-blue);
  font-family: 'Cairo';
}

/* العروض */
.offers-grid { display: flex; flex-direction: column; gap: 10px; }
.offer-card {
  background: var(--accent);
  color: var(--ink);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.offer-discount {
  position: absolute;
  top: 12px;
  left: 14px;
  background: var(--ink);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 900;
}
.offer-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
  margin-left: 70px;
}
.offer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.offer-meta .tag {
  background: var(--ink);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 700;
}
.offer-valid { font-weight: 700; }

/* مواقيت الصلاة */
.prayer-wrap { }
.prayer-header {
  background: var(--brand-blue);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
}
.prayer-city { font-size: 17px; font-weight: 800; color: var(--accent); }
.prayer-date { font-size: 12px; opacity: 0.9; margin-top: 4px; }
.prayer-list { display: flex; flex-direction: column; gap: 8px; }
.prayer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  padding: 14px 16px;
  border-radius: 11px;
  border-right: 3px solid var(--brand-blue);
  transition: var(--transition);
}
.prayer-row.prayer-active {
  background: var(--accent);
  color: var(--ink);
  border-right-color: var(--ink);
  transform: scale(1.02);
  box-shadow: var(--shadow-yellow);
}
.prayer-row .p-name { font-weight: 800; font-size: 14px; }
.prayer-row .p-time {
  font-weight: 900;
  font-size: 16px;
  color: var(--brand-blue);
  font-family: 'Cairo';
}
.prayer-row.prayer-active .p-time { color: var(--ink); }
.prayer-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
}

/* =========== Responsive (موبايل) =========== */
@media (max-width: 900px) {
  .top-header { padding: 0 12px; }
  .logo-img { height: 42px; }
  .subscribe-btn { padding: 7px 12px; font-size: 12px; }
  .subscribe-btn svg { width: 13px; height: 13px; }
  .social-icons { display: flex; gap: 6px; }
  .social-link { width: 34px; height: 34px; }

  .sidebar {
    position: fixed;
    top: calc(var(--header-height) + var(--ticker-height) + var(--banner-height));
    bottom: 0;
    right: -300px;
    width: 280px;
    transition: right 0.3s;
    z-index: 800;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
  }
  .sidebar.mobile-open { right: 0; }
  .mobile-close {
    display: block;
    position: absolute;
    top: 10px; left: 10px;
    background: var(--ink); color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    cursor: pointer;
    font-weight: 800;
  }
  .mobile-toggle { display: flex; align-items: center; justify-content: center; }

  /* ✨ بطاقة الدولة على الموبايل: مساحة أصغر للبطاقة، مساحة أكبر للخريطة */
  .country-card {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-height: 42vh;
    height: 42vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
  }
  .country-card.active {
    transform: translateY(0);
  }
  /* مقبض السحب في الأعلى (من ناحية الخريطة) */
  .country-card::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: rgba(15,20,56,0.2);
    border-radius: 3px;
  }
  /* ✨ هيدر بطاقة الدولة على الموبايل: مدمج جداً */
  .card-header {
    padding: 12px 14px 8px;
    gap: 8px;
  }
  .card-flag { font-size: 24px; }
  .card-name { font-size: 14px; }
  .card-close { width: 26px; height: 26px; font-size: 16px; }
  .card-body { padding: 10px 14px 14px; }
  /* تبويبات أصغر للموبايل */
  .card-tabs { padding: 5px 10px 0; gap: 3px; }
  .card-tab { padding: 5px 9px; font-size: 11px; }

  .popup-panel {
    width: calc(100vw - 90px);
    max-width: 340px;
  }
  .ads-banner { padding: 0 12px; }
  .banner-title { font-size: 13px; }
  .banner-subtitle { font-size: 11px; }
}

@media (max-width: 500px) {
  :root { --banner-height: 50px; }
  .ticker-label { padding: 8px 12px; font-size: 12px; }

  /* ✨ البانر على الموبايل: الأيقونة + النص في سطر واحد، بدون تجاوز للخريطة */
  .ads-banner {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    height: var(--banner-height);
    overflow: hidden;
  }
  .banner-icon {
    font-size: 18px;
    flex-shrink: 0;
  }
  .banner-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }
  .banner-title {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .banner-subtitle {
    font-size: 10px;
    line-height: 1.2;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .country-card {
    max-height: 48vh;
    height: 48vh;
  }
}

/* ============================================================
   تنسيقات إضافية: أرقام هاتف بالاتجاه الصحيح + أزرار الأدوات
   ============================================================ */
.phone-num bdi, .phone-tag bdi, p bdi {
  direction: ltr;
  unicode-bidi: embed;
  font-family: 'Cairo', monospace;
}

.popup-hint {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-right: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.btn-tool {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-tool.btn-primary {
  background: var(--brand-blue);
  color: var(--accent);
}
.btn-tool.btn-primary:hover {
  background: var(--brand-blue-dark);
  transform: translateY(-1px);
}
.btn-tool.btn-secondary {
  background: var(--bg-soft);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-tool.btn-secondary:hover {
  background: #fff;
  border-color: var(--brand-blue);
}

/* ============================================================
   زر اللغة + الوضع الإنجليزي (LTR)
   ============================================================ */
.lang-toggle-btn {
  background: transparent;
  color: var(--brand-blue);
  border: none;
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
  font-size: 18px;
  padding: 4px 6px;
  cursor: pointer;
  margin-left: 6px;
  margin-right: 6px;
  transition: opacity 0.2s, transform 0.2s;
  line-height: 1;
}
.lang-toggle-btn:hover {
  opacity: 0.6;
  transform: scale(1.08);
}

/* الوضع الإنجليزي: قلب الاتجاه */
body.lang-en {
  direction: ltr;
}
body.lang-en .country-card {
  right: auto;
  left: 24px;
}
body.lang-en .map-tools {
  right: auto;
  left: 16px;
}
body.lang-en .mobile-toggle {
  left: auto;
  right: 16px;
}
@media (max-width: 900px) {
  body.lang-en .country-card {
    left: 0;
    right: 0;
  }
}

/* ============================================================
   مواقيت الصلاة (كأداة عامة)
   ============================================================ */
.prayer-times-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 12px;
}
.prayer-row-tool {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  padding: 12px 14px;
  border-radius: 10px;
  border-right: 3px solid var(--accent);
  transition: var(--transition);
}
.prayer-row-tool .p-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.prayer-row-tool .p-time {
  font-weight: 900;
  font-size: 16px;
  color: var(--brand-blue);
  font-family: 'Cairo', sans-serif;
}
.prayer-row-tool.prayer-active {
  background: var(--brand-blue);
  border-right-color: var(--accent);
  box-shadow: var(--shadow-blue);
}
.prayer-row-tool.prayer-active .p-name,
.prayer-row-tool.prayer-active .p-time {
  color: var(--accent);
}
.prayer-note {
  background: rgba(242, 201, 76, 0.12);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: center;
  margin-top: 8px;
}
.distance-total-box {
  background: var(--brand-blue);
  border-radius: 14px;
  padding: 30px 20px;
  text-align: center;
  margin: 16px 0 14px;
  box-shadow: var(--shadow-blue);
  border: 2px solid var(--accent);
}
.distance-total-value {
  font-size: 44px;
  font-weight: 900;
  color: var(--accent);
  font-family: 'Cairo', sans-serif;
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -1px;
}
.distance-total-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.distance-hint-box {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
  font-weight: 500;
}

.distance-clear-btn {
  width: 100%;
  background: var(--ink);
  color: var(--accent);
  border: 2px solid var(--ink);
  padding: 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.distance-clear-btn:hover {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-yellow);
}

/* النقاط على الخريطة */
.distance-marker {
  background: transparent !important;
  border: none !important;
}
.dist-point {
  background: var(--accent);
  color: var(--ink);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  font-family: 'Cairo', sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ملصقات المسافة على الخطوط */
.distance-label-wrapper {
  background: transparent !important;
  border: none !important;
}
.dist-segment-label {
  background: var(--brand-blue);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 1.5px solid var(--accent);
}

/* ===== مواءمة الهيدر للهواتف الصغيرة بعد إظهار أيقونات التواصل ===== */
@media (max-width: 560px) {
  .top-header { padding: 0 10px; }
  .header-actions { gap: 8px; }
  .logo-img { height: 34px; }
  .social-icons { gap: 5px; }
  .social-link { width: 30px; height: 30px; border-radius: 8px; }
  .social-link svg { width: 15px; height: 15px; }
  .subscribe-btn span { display: none; }       /* زر الاشتراك أيقونة فقط لتوفير مساحة */
  .subscribe-btn { padding: 8px; }
  .lang-toggle-btn { font-size: 16px; margin-left: 2px; margin-right: 2px; padding: 2px 4px; }
}
