@font-face{
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn[wght].woff2') format('woff2-variations'),
       url('../fonts/Vazirmatn[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root{
  --bg:        #ffffff;
  --surface:   #ffffff;
  --surface-2: #f3f5f8;
  --border:    #e2e6ec;
  --text:      #16202b;
  --text-dim:  #5b6b7a;
  --text-faint:#8b98a5;
  --accent:    #2563eb;
  --accent-ink:#ffffff;
  --success:   #16a34a;
  --danger:    #dc2626;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow: 0 2px 10px rgba(16,24,40,.06);
  --maxw: 1120px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; height:100%; }

body{
  margin:0;
font-family: 'Vazirmatn', Tahoma, 'Segoe UI', Arial, sans-serif;  background:var(--bg);
  color:var(--text);
  line-height:1.8;
  font-size:15px;
  min-height:100%;
  display:flex;
  flex-direction:column;
}
main{ flex:1 0 auto; width:100%; }
.site-footer{ flex-shrink:0; }

a{ color:inherit; text-decoration:none; }
ul{ list-style:none; margin:0; padding:0; }
button{ font-family:inherit; }
img{ max-width:100%; display:block; }

.container{ max-width:var(--maxw); margin:0 auto; padding:0 16px; }

h1,h2,h3{ margin:0 0 .5em; font-weight:700; line-height:1.4; color:var(--text); }
h1{ font-size:1.5rem; }
h2{ font-size:1.2rem; }
h3{ font-size:1.05rem; color:var(--text-dim); font-weight:600; }
p{ margin:0 0 1em; color:var(--text-dim); }

/* ---------------------------- Header ---------------------------- */
.site-header{
  position:sticky; top:0; z-index:40;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  height:60px;
}
.brand{ display:flex; align-items:center; gap:8px; font-weight:700; font-size:1.15rem; color:var(--text); }
.header-start{ display:flex; align-items:center; gap:12px; min-width:0; }
.header-city{ margin:0; }
.header-city select{
  width:auto; max-width:140px; padding:5px 8px; font-size:.82rem;
  background:#eef4ff; border-color:#d7e3fb;
}
@media (max-width:640px){
  .header-start{ gap:8px; }
  .header-city select{ max-width:100px; font-size:.76rem; padding:4px 6px; }
  .brand{ font-size:1rem; }
}
.brand-mark{
  width:32px; height:32px; border-radius:8px;
  background:var(--accent); color:var(--accent-ink);
  display:flex; align-items:center; justify-content:center;
  font-weight:700;
}
.brand-text em{ color:var(--accent); font-style:normal; }

.nav-toggle{
  display:none; flex-direction:column; gap:4px;
  background:none; border:none; cursor:pointer; padding:8px;
}
.nav-toggle span{ width:22px; height:2px; background:var(--text); display:block; }

.main-nav{ display:flex; align-items:center; gap:22px; }
.main-nav a{ color:var(--text-dim); font-size:.92rem; transition:color .15s; }
.main-nav a:hover{ color:var(--text); }
.nav-cta{
  background:var(--accent); color:var(--accent-ink) !important;
  padding:8px 16px; border-radius:var(--radius-sm); font-weight:600;
}
.nav-cta--ghost{
  background:transparent; color:var(--text-dim) !important;
  border:1px solid var(--border); padding:7px 14px;
}

/* ---------------------------- PWA banner ---------------------------- */
.pwa-banner{ background:var(--surface-2); border-bottom:1px solid var(--border); }
.pwa-banner-inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:10px 16px; flex-wrap:wrap;
}
.pwa-banner-text{ display:flex; flex-direction:column; gap:2px; font-size:.85rem; color:var(--text); }
.pwa-banner-text span{ color:var(--text-dim); }
.pwa-banner-actions{ display:flex; gap:8px; }

/* ---------------------------- Buttons ---------------------------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:10px 18px; border-radius:var(--radius-sm); border:1px solid transparent;
  font-size:.9rem; font-weight:600; cursor:pointer; transition:.15s;
  background:var(--surface-2); color:var(--text); border-color:var(--border);
}
.btn:hover{ background:#e9edf3; }
.btn-accent{ background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.btn-accent:hover{ background:#1d4fd1; }
.btn-ghost{ background:#ffffff; color:var(--text-dim); border-color:var(--border); }
.btn-ghost:hover{ background:var(--surface-2); color:var(--text); }
.btn-danger{ background:#ffffff; color:var(--danger); border-color:rgba(220,38,38,.35); }
.btn-danger:hover{ background:rgba(220,38,38,.06); }
.btn-success{ background:#ffffff; color:var(--success); border-color:rgba(22,163,74,.35); }
.btn-success:hover{ background:rgba(22,163,74,.06); }
.btn-sm{ padding:6px 12px; font-size:.8rem; }
.btn-block{ width:100%; }
.btn[disabled], .btn.is-disabled{ opacity:.45; cursor:not-allowed; }
.btn-group{ display:flex; gap:6px; flex-wrap:wrap; }

/* ---------------------------- Forms ---------------------------- */
.field{ margin-bottom:16px; }
.field label{ display:block; margin-bottom:6px; font-size:.85rem; color:var(--text-dim); }
.field .hint{ display:block; margin-top:4px; font-size:.75rem; color:var(--text-faint); }
input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=search], select, textarea{
  width:100%; padding:11px 12px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  color:var(--text); font-family:inherit; font-size:.92rem;
}
textarea{ min-height:100px; resize:vertical; }
input:focus, select:focus, textarea:focus{
  outline:none; border-color:var(--accent); background:#ffffff;
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
}
select{ cursor:pointer; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.grid-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.input-with-btn{ display:flex; gap:8px; }
.input-with-btn input{ flex:1; }
.add-inline{ display:flex; gap:8px; align-items:center; }
.add-inline select{ flex:1; }
.add-inline .plus-btn{
  width:38px; height:38px; flex:none; border-radius:var(--radius-sm);
  background:var(--surface-2); border:1px solid var(--border); color:var(--accent);
  font-size:1.2rem; cursor:pointer; line-height:1;
}

/* ---------------------------- Cards / Surfaces ---------------------------- */
.card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px; margin-bottom:20px;
  box-shadow:var(--shadow);
}
.card-title{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.card-title h2{ margin:0; }

/* ---------------------------- Alerts ---------------------------- */
.alert{
  padding:12px 16px; border-radius:var(--radius-sm); margin:16px 0;
  font-size:.88rem; border:1px solid transparent;
}
.alert-error{ background:rgba(220,38,38,.06); color:#b42318; border-color:rgba(220,38,38,.25); }
.alert-success{ background:rgba(22,163,74,.07); color:#0f7a37; border-color:rgba(22,163,74,.25); }
.alert-info{ background:rgba(37,99,235,.07); color:#1d4ed8; border-color:rgba(37,99,235,.22); }

.disclaimer{
  background:rgba(220,38,38,.05); border:1px solid rgba(220,38,38,.2);
  color:#b42318; padding:12px 16px; border-radius:var(--radius-sm);
  font-size:.82rem; text-align:center; line-height:1.9; margin:18px 0;
}

/* ---------------------------- Hero / Search ---------------------------- */
.hero{ padding:34px 0 10px; text-align:center; }
.hero h1{ font-size:1.6rem; margin-bottom:6px; }
.hero p{ max-width:480px; margin:0 auto; }

.search-box{ display:flex; gap:8px; margin:18px 0; }
.search-box input{ flex:1; }

.adv-toggle{
  display:flex; align-items:center; justify-content:center; gap:6px;
  color:var(--accent); font-size:.85rem; cursor:pointer; margin:6px 0 18px;
  background:none; border:none; width:100%;
}
.adv-panel{ display:none; }
.adv-panel.open{ display:block; }
.adv-panel .grid-4{ margin-bottom:6px; }

/* ---------------------------- Tables (responsive -> cards on mobile) ---------------------------- */
.table-wrap{ overflow-x:auto; border-radius:var(--radius); border:1px solid var(--border); }
table{ width:100%; border-collapse:collapse; background:var(--surface); font-size:.88rem; }
thead th{
  background:var(--surface-2); color:var(--text-dim); font-weight:600;
  text-align:right; padding:12px 14px; white-space:nowrap;
}
thead th.sortable{ cursor:pointer; user-select:none; }
thead th.sortable:hover{ color:var(--accent); }
tbody td{ padding:12px 14px; border-top:1px solid var(--border); vertical-align:middle; color:var(--text); }
tbody tr:hover{ background:#f8fafc; }
.table-actions{ display:flex; gap:6px; flex-wrap:wrap; }
.status-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-inline-end:6px; }
.status-dot.active{ background:var(--success); }
.status-dot.inactive{ background:var(--danger); }

@media (max-width:720px){
  .table-wrap{ border:none; }
  table, thead, tbody, th, td, tr{ display:block; width:100%; }
  thead{ display:none; }
  tbody tr{
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--radius); margin-bottom:10px; padding:6px 0;
    box-shadow:var(--shadow);
  }
  tbody td{
    display:flex; justify-content:space-between; align-items:center;
    gap:10px; border-top:none; padding:9px 14px; text-align:left;
  }
  tbody td::before{
    content:attr(data-label); color:var(--text-dim); font-size:.78rem; font-weight:600;
  }
  tbody td:not(:last-child){ border-bottom:1px dashed var(--border); }
}

/* ---------------------------- Result group rows (home search) ---------------------------- */
.result-group{
  display:flex; align-items:center; justify-content:space-between;
  background:#eef4ff; border:1px solid #d7e3fb;
  border-radius:var(--radius); padding:14px 16px; margin-bottom:10px;
  box-shadow:var(--shadow); cursor:pointer;
}
.result-group:hover{ background:#e3ecff; }
.result-group .rg-name{ font-weight:600; color:var(--text); }
.result-group .rg-count{ color:var(--text-dim); font-size:.82rem; }
.result-group .rg-actions{ display:flex; align-items:center; gap:14px; }

/* ---------------------------- Product detail ---------------------------- */
.product-spec-list{ max-width:420px; margin:20px auto 0; text-align:center; }
.product-spec-list div{
  display:flex; justify-content:space-between; padding:9px 4px;
  border-bottom:1px dashed var(--border); font-size:.92rem;
}
.product-spec-list div:last-child{ border-bottom:none; }
.product-spec-list span{ color:var(--text-dim); }
.product-spec-list strong{ color:var(--text); font-weight:600; }
.price-tag{ font-size:1.6rem; font-weight:700; color:var(--accent); }
.price-tag small{ font-size:.9rem; color:var(--text-dim); font-weight:500; margin-inline-start:6px; }

/* ---------------------------- Store page ---------------------------- */
.store-header{
  display:flex; align-items:center; gap:16px; padding:22px 0;
  border-bottom:1px solid var(--border); margin-bottom:20px; flex-wrap:wrap;
}
.store-logo{
  width:64px; height:64px; border-radius:var(--radius); object-fit:cover;
  background:var(--surface-2); border:1px solid var(--border);
}
.store-meta{ color:var(--text-dim); font-size:.86rem; display:flex; flex-wrap:wrap; gap:4px 16px; }

/* ---------------------------- Panel (dashboard) tabs ---------------------------- */
.panel-tabs{ display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.panel-tabs a{
  padding:9px 16px; border-radius:var(--radius-sm); background:var(--surface);
  border:1px solid var(--border); color:var(--text-dim); font-size:.86rem;
}
.panel-tabs a.active{ background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:600; }
.panel-user{ color:var(--text-dim); font-size:.85rem; margin-bottom:14px; }
.panel-user strong{ color:var(--accent); }

/* ---------------------------- Auth pages ---------------------------- */
.auth-wrap{ max-width:400px; margin:40px auto; }
.auth-wrap .card{ padding:28px 24px; }
.auth-switch{ text-align:center; margin-top:14px; font-size:.86rem; color:var(--text-dim); }
.auth-switch a{ color:var(--accent); font-weight:600; }

/* ---------------------------- Footer ---------------------------- */
.site-footer{ border-top:1px solid var(--border); margin-top:50px; padding:24px 0 32px; background:var(--surface-2); }
.footer-disclaimer{
  text-align:center; color:var(--text-faint); font-size:.76rem;
  line-height:1.9; max-width:640px; margin:0 auto 16px;
}
.footer-row{
  display:flex; align-items:center; justify-content:center; gap:18px;
  font-size:.82rem; color:var(--text-faint); flex-wrap:wrap;
}
.footer-row a{ color:var(--text-dim); }
.footer-row a:hover{ color:var(--accent); }
.footer-admin-link{ opacity:.7; }
@media (max-width:480px){ .footer-row{ gap:10px; font-size:.74rem; } }
.page-card{ max-width:720px; margin:20px auto; line-height:2.1; }
.page-card h1{ text-align:center; margin-bottom:18px; }
.page-card h3{ color:var(--text); margin:18px 0 4px; }
.page-card p{ color:var(--text); }
.page-card a{ color:var(--accent); font-weight:600; }

/* ---------------------------- Badges ---------------------------- */
.badge{
  display:inline-block; padding:3px 10px; border-radius:20px;
  font-size:.72rem; font-weight:600; background:var(--surface-2); color:var(--text-dim);
}
.badge-accent{ background:rgba(37,99,235,.1); color:var(--accent); }
.badge-danger{ background:rgba(220,38,38,.1); color:var(--danger); }
.badge-success{ background:rgba(22,163,74,.1); color:var(--success); }
.badge-boost{ background:#fff3c4; color:#8a5b00; margin-inline-start:6px; }

/* ---------------------------- Boosted listings ---------------------------- */
tr.is-boosted{ background:#fff9e6 !important; }
tr.is-boosted:hover{ background:#fff3c4 !important; }
.boost-flag{
  display:inline-block; background:#f5b400; color:#3a2900; font-weight:700;
  font-size:.68rem; padding:2px 8px; border-radius:12px; margin-inline-start:6px;
}
.result-group.is-boosted{ background:#fffaf0; border-color:#f0d385; }

/* ---------------------------- Empty state ---------------------------- */
.empty-state{ text-align:center; padding:50px 16px; color:var(--text-faint); }

/* ---------------------------- Responsive ---------------------------- */
@media (max-width:860px){
  .grid-4{ grid-template-columns:1fr 1fr; }
  .grid-3{ grid-template-columns:1fr 1fr; }
}
@media (max-width:640px){
  .nav-toggle{ display:flex; }
  .main-nav{
    position:absolute; inset-inline:0; top:60px; background:var(--bg);
    border-bottom:1px solid var(--border);
    flex-direction:column; align-items:stretch; gap:0; padding:8px 16px 16px;
    display:none;
    box-shadow:var(--shadow);
  }
  .main-nav.open{ display:flex; }
  .main-nav a{ padding:12px 4px; border-bottom:1px solid var(--border); }
  .main-nav .nav-cta{ margin-top:10px; text-align:center; }
  .grid-2, .grid-3, .grid-4{ grid-template-columns:1fr; }
  .search-box{ flex-direction:column; }
  .search-box button{ width:100%; }
  .store-header{ flex-direction:column; text-align:center; }
  .store-meta{ justify-content:center; }
  .result-group{ flex-direction:column; align-items:stretch; gap:8px; }
  .result-group .rg-actions{ justify-content:space-between; }
}

/* ---------------------------- Help page video ---------------------------- */
.help-video{ position:relative; width:100%; padding-top:56.25%; border-radius:var(--radius-sm); overflow:hidden; background:#000; }
.help-video iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

/* ---------------------------- Modal (تایید نردبان) ---------------------------- */
.help-modal{
  position:fixed; inset:0; z-index:100; background:rgba(15,23,42,.55);
  display:none; align-items:center; justify-content:center; padding:20px;
}
.help-modal.is-open{ display:flex; }
.help-modal-inner{
  background:var(--surface); border-radius:var(--radius-lg); border:1px solid var(--border);
  max-width:640px; width:100%; padding:24px; position:relative; box-shadow:0 20px 50px rgba(0,0,0,.2);
}
.help-modal-close{
  position:absolute; top:14px; left:14px; background:var(--surface-2); border:1px solid var(--border);
  border-radius:50%; width:32px; height:32px; cursor:pointer; color:var(--text-dim); font-size:.9rem;
}

/* ---------------------------- Enamad ---------------------------- */
.footer-enamad{ display:flex; justify-content:center; margin-top:14px; }
.footer-enamad img{ max-width:100px; }

/* ---------------------------- Install page ---------------------------- */
.install-hero{ max-width:620px; margin:20px auto; text-align:center; background:linear-gradient(135deg,#f3f6fb,#eef2f9); }
.install-hero-icon{
  width:56px; height:56px; border-radius:16px; background:linear-gradient(135deg,#7b61ff,#5b3df0);
  color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.6rem; margin:0 auto 14px;
}
.install-btn-row{ display:flex; gap:12px; margin-top:22px; flex-wrap:wrap; }
.install-btn{
  flex:1 1 150px; display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:16px 18px; border-radius:var(--radius); color:#fff !important; text-align:right;
}
.install-btn strong{ display:block; font-size:.95rem; }
.install-btn small{ display:block; font-size:.76rem; opacity:.85; margin-top:2px; }
.install-btn-icon{ font-size:1.3rem; }
.install-btn-myket{ background:#1676f3; }
.install-btn-bazaar{ background:#17a84b; }
.install-btn-apk{ background:#6c3cf0; }
@media (max-width:640px){ .install-btn-row{ flex-direction:column; } }
