/* =======================================
   1. GLOBAL & FONT SETTINGS
======================================= */
/* تنظیم فونت روی کل صفحه برای ارث بری صحیح */
html, body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    direction: rtl; /* مطمئن شدن از راست به چپ بودن در سطح سراسری */
    text-align: right;
    margin: 0;
    padding: 0;
}

/* حذف تمامی Override های فونت در هدر برای جلوگیری از تداخل */
/* این کدها را حذف کردم:
.site-header, .site-header *, .navbar, .navbar *, header, header * {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}
*/

/* Reset ساده برای Clearfix */
.row:after {
    content: "";
    display: table;
    clear: both;
}

/* =======================================
   2. FOOTER STYLES (فوتر)
======================================= */
.footer-section,
.site-footer {
  background-color: #003c3a;
  color: #dfeeee;
  padding: 30px 0;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  text-align: right;
  /* برای اعمال حداکثر عرض در صفحاتی که کانتینر ندارند */
  max-width: 1200px; 
  margin: 0 auto;
  padding: 0 15px;
}

.footer-col {
  flex: 0 0 30%;
  padding: 10px;
}

.site-footer h3,
.site-footer p,
.site-footer a {
  color: #dfeeee;
  /* ارث بری فونت از body بدون نیاز به تعریف مجدد */
  font-family: inherit; 
}

.site-footer ul {
    list-style: none;
    padding-right: 0;
}
.site-footer ul li a {
  color: #dfeeee;
  text-decoration: none;
}

.site-footer ul li a:hover {
  color: #00c4b4;
}

/* موبایل فوتر */
@media (max-width: 768px) {
  .footer-col {
    flex: 0 0 100%;
    text-align: center;
    margin-bottom: 15px;
  }
}

/* =======================================
   3. DESKTOP HEADER (هدر دسکتاپ)
======================================= */
.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #001031;
  color: white;
  padding: 6px 10px;
  height: 60px;
  gap: 8px;
  position: relative;
  z-index: 10;
}

.col-5  { flex: 0 0 5%; max-width: 5%; }
.col-10 { flex: 0 0 10%; max-width: 10%; }
.col-50 { flex: 0 0 50%; max-width: 50%; }
.col-50n { flex: 0 0 50%; max-width: 50%; }
.col-90 { flex: 0 0 90%; max-width: 90%; }

.col-inline { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

.header-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 6px 8px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.header-link {
  color: white;
  text-decoration: none;
  display: inline-block;
  width: 100%;
}

.search-row { display: flex; gap: 8px; width: 100%; align-items: center; }
.search-row select, .search-row input {
  height: 30px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  color: white;
  /* فونت ارث‌بری شود و فقط رنگ و ظاهر عوض شود */
  font-family: inherit; 
}
.search-row select { min-width: 110px; }
.search-row input { flex: 1; min-width: 120px; }
.search-icon { cursor: pointer; padding: 6px; }

.badge {
  display: inline-block;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 12px;
  background: #ffb703;
  color: #001031;
  font-weight: 600;
  font-size: 12px;
  vertical-align: middle;
}

.mobile-menu-btn { display: none; font-size: 22px; background: none; border: none; color: white; cursor: pointer; }

/* =======================================
   4. MOBILE SIDEBAR (سایدبار موبایل)
======================================= */
.mobile-sidebar {
  display: none;
  position: absolute;
  top: 60px;
  right: 0;
  width: 80%;
  background-color: #001031;
  flex-direction: column;
  align-items: flex-end;
  padding: 10px;
  z-index: 9;
}
.mobile-sidebar.open {
  display: flex;
}
.mobile-sidebar .menu-item {
  width: 100%;
  text-align: right;
  margin-bottom: 8px;
}
.mobile-sidebar .search-row {
  display: flex;
  width: 100%;
  justify-content: flex-end;
  gap: 8px;
}


/* =======================================
   5. SIDENAV MENU (منوی کشویی)
======================================= */
#mySidenav {
  position: fixed !important; /* بهتر است fixed باشد */
  top: 50px;
  right: 12px;
  min-width: 220px;
  max-width: 88%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  padding: 10px 12px;
  box-sizing: border-box;
  z-index: 2147483000 !important;
  display: none;
  direction: rtl;
}

/* وقتی باز است */
#mySidenav.open {
  display: block;
}

/* نمای داخلی */
#mySidenav .sidenav-row { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
#mySidenav a { 
    color: #007e7a; 
    text-decoration: none; 
    font-weight: 600; 
    /* فونت برای این بخش هم ارث‌بری می‌شود */
    font-family: inherit;
}
#mySidenav a:hover { color: #00c4b4; text-decoration: underline; }

/* اندازه موبایل سایدنِیو */
@media (max-width: 480px){
  #mySidenav { right: 8px; left: 8px; top: 8px; max-width: calc(100% - 16px); padding: 8px; }
  #mySidenav .sidenav-row { gap: 6px; }
}

/* Overlay */
#mySidenavOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  z-index: 2147482000;
  display: none;
}
#mySidenavOverlay.open { display: block; }

/* =======================================
   6. RESPONSIVE (ریسپانسیو)
======================================= */
@media (max-width: 900px){
  .col-10, .col-5, .col-50 { display: none; }
  .col-50n { flex: 0 0 90%; max-width: 90%; }
  .mobile-menu-btn { display: inline-block; }
  .row-header { height: auto; align-items: flex-start; padding: 8px; flex-wrap: wrap; }
}
