/* ============================================
   بازار خرازی — تم آگهی‌محور
   ============================================ */
:root {
  --primary: #6200ee;
  --primary-dark: #4a00b3;
  --primary-light: #f0e8fd;
  --secondary: #4a00b3;
  --text: #212529;
  --text-muted: #6c757d;
  --bg: #f5f6f7;
  --border: #e0e0e0;
  --success: #2e7d32;
  --warning: #f9a825;
  --danger: #c62828;
  --radius: 10px;
}

html {
  min-height: 100%;
  height: 100%;
}

body {
  font-family: 'IranYekan', 'Vazirmatn', Tahoma, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
  width: 100%;
}
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* فونت فارسی */
@font-face {
  font-family: 'IranYekan';
  src: url('../css/fonts/iranyekanwebregularfanum.woff2') format('woff2');
  font-weight: 400;
}
@font-face {
  font-family: 'IranYekan';
  src: url('../css/fonts/iranyekanwebboldfanum.woff2') format('woff2');
  font-weight: 700;
}

a { text-decoration: none; color: inherit; }

/* ===== هدر بالا ===== */
.topbar {
  background: var(--primary-dark);
  color: #fff;
  font-size: 13px;
  padding: 6px 0;
}
.topbar a { color: rgba(255,255,255,0.9); }
.topbar a:hover { color: #fff; }

.navbar-main {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-toggler {
  background-color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(98, 0, 238, 0.25);
}
.navbar-toggler .menu-icon {
  display: block;
}
.navbar-toggler-icon {
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%236200ee' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.brand-logo { font-size: 22px; font-weight: 700; color: var(--primary); }
.brand-logo span { color: var(--secondary); }

.search-bar {
  display: flex;
  border: 2px solid var(--primary);
  border-radius: 8px;
  overflow: hidden;
}
.search-bar input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}
.search-bar button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 22px;
  font-size: 15px;
  font-weight: 600;
}

.nav-link-main {
  color: var(--text);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
}
.nav-link-main:hover { color: var(--primary); background: var(--primary-light); }

/* ===== کارت آگهی ===== */
.item-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: transform .15s, box-shadow .15s;
  height: 100%;
}
.item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.item-card a { display: block; color: inherit; }
.item-card .item-img { position: relative; }
.item-card .item-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.item-card .item-body { padding: 12px; }
.item-card .item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  min-height: 42px;
}
.item-card .item-price { color: var(--primary); font-weight: 700; font-size: 14px; }
.item-card .item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.badge-featured {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--warning);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ===== دسته‌بندی‌ها ===== */
.cat-pill {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text);
  margin: 3px;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== فیلترها ===== */
.filter-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ===== صفحه جزئیات ===== */
.detail-img img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
}
.detail-carousel {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.detail-carousel .carousel-item img {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: #fff;
}
@media (max-width: 767.98px) {
  .detail-carousel .carousel-item img { height: 260px; }
}
.detail-info { background: #fff; border-radius: var(--radius); padding: 20px; }
.detail-price { font-size: 22px; font-weight: 700; color: var(--primary); }
.info-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }

/* ===== دکمه‌ها ===== */
.btn-primary-c {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
}
.btn-primary-c:hover { background: var(--primary-dark); color: #fff; }

/* ===== بخش‌ها ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}

/* ===== فوتر ===== */
.site-footer {
  background: var(--primary-dark);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 40px;
}
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer a:hover { color: #fff; }
.copyright { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 16px; margin-top: 24px; font-size: 13px; }

/* ===== ادمین ===== */
.admin-sidebar {
  background: #1a1a2e;
  min-height: 100vh;
  color: #fff;
  padding: 0;
}
.admin-sidebar .admin-logo {
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar a {
  display: block;
  color: rgba(255,255,255,0.85);
  padding: 12px 20px;
  font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.admin-content { background: var(--bg); min-height: 100vh; }
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card .stat-value { font-size: 24px; font-weight: 700; }
.stat-card .stat-label { color: var(--text-muted); font-size: 13px; }

/* ===== جدول ادمین ===== */
.table-admin {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.table-admin th {
  background: var(--primary-light);
  font-size: 13px;
}
.table-admin td { font-size: 13px; vertical-align: middle; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.status-pending { background: #fff8e1; color: #f57f17; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #fdecea; color: #c62828; }
.status-incomplete { background: #eceff1; color: #546e7a; }

/* ===== اعلان‌های فلش ===== */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.flash-error { background: #fdecea; color: #c62828; border: 1px solid #ef9a9a; }
.flash-info { background: #e3f2fd; color: #08457e; border: 1px solid #90caf9; }
