@font-face{font-family:Vazirmatn;font-style:normal;font-weight:400;font-display:swap;src:url('/static/fonts/Vazirmatn-Regular.ttf') format('truetype');}
@font-face{font-family:Vazirmatn;font-style:normal;font-weight:700;font-display:swap;src:url('/static/fonts/Vazirmatn-Bold.ttf') format('truetype');}
/* ============ reset & vars ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #4f46e5; --primary-2: #7c3aed; --accent: #ff7a1a; --accent-2: #ff4d6d;
  --ink: #171b33; --bg: #f5f6fb; --card: #fff; --muted: #6b7280;
  --line: #e8eaf2; --ok: #10b981; --err: #ef4444; --warn: #f59e0b;
  --dark: #171b33; --radius: 16px;
}
html { scroll-behavior: smooth; }
body {
  font-family: Tahoma, "Segoe UI", Vazirmatn, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.9; direction: rtl;
  padding-bottom: 64px; /* room for bottom bar */
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ============ top utility bar ============ */
.topbar { background: var(--dark); color: #cdd2f0; font-size: 12.5px; }
.topbar-row { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 12px; }
.topbar-row .tb-left { display: flex; align-items: center; gap: 6px; }
.topbar-links { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar-links a:hover { color: #fff; }
.topbar-links .hl { color: #ffd166; }

/* ============ main header ============ */
header.site { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 60; }
.hrow { display: flex; align-items: center; gap: 18px; padding: 14px 0; }
.logo { font-weight: 900; font-size: 22px; color: var(--primary); white-space: nowrap; }
.logo span { color: var(--accent); }
.logo small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; line-height: 1; }
.search { flex: 1; display: flex; max-width: 640px; }
.search input {
  flex: 1; border: 2px solid var(--primary); border-left: none;
  border-radius: 0 14px 14px 0; padding: 11px 16px; font-family: inherit; outline: none; font-size: 14px;
}
.search button {
  border: none; background: var(--primary); color: #fff; padding: 0 24px;
  border-radius: 14px 0 0 14px; cursor: pointer; font-weight: 700; font-size: 14px;
}
.search button:hover { background: var(--primary-2); }
.h-actions { display: flex; gap: 10px; }
.hbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f1f2fa; border-radius: 14px; padding: 7px 14px; font-size: 12.5px;
  color: #3a3f5c; min-width: 76px; text-align: center; line-height: 1.5;
}
.hbtn b { font-size: 15px; }
.hbtn:hover { background: #e7e9fb; color: var(--primary); }
.hbtn.cart { background: var(--primary); color: #fff; }
.hbtn.cart:hover { background: var(--primary-2); }

/* ============ category strip ============ */
.catbar { background: #fff; border-top: 1px solid var(--line); box-shadow: 0 4px 14px rgba(23,27,51,.05); }
.catbar nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 16px; scrollbar-width: none; }
.catbar nav::-webkit-scrollbar { display: none; }
.catbar a {
  font-size: 13.5px; padding: 7px 15px; border-radius: 999px; white-space: nowrap;
  color: #454b66; transition: .15s;
}
.catbar a:hover { background: var(--primary); color: #fff; }
.catbar a.promo { background: linear-gradient(90deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 700; }
.catbar a.promo:hover { filter: brightness(1.07); }

/* ============ alerts ============ */
.flash { padding: 12px 18px; border-radius: 12px; margin: 16px 0; font-size: 14.5px; }
.flash.ok { background: #d1fae5; color: #065f46; }
.flash.err { background: #fee2e2; color: #991b1b; }

/* ============ hero grid + slider ============ */
.hero-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin: 20px 0 8px; }
.slider { position: relative; border-radius: 22px; overflow: hidden; min-height: 300px; background: #222; }
.slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease;
  display: flex; flex-direction: column; justify-content: center; padding: 40px 44px; color: #fff;
}
.slide.active { opacity: 1; z-index: 2; }
.slide h2 { font-size: 30px; line-height: 1.6; margin-bottom: 10px; text-shadow: 0 2px 12px rgba(0,0,0,.18); }
.slide p { font-size: 15.5px; opacity: .95; max-width: 460px; }
.slide .s-cta {
  display: inline-block; margin-top: 20px; background: #fff; color: var(--ink);
  padding: 10px 26px; border-radius: 999px; font-weight: 800; font-size: 14.5px; width: fit-content;
}
.slide .s-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.slide .s-emoji { position: absolute; left: 36px; bottom: -26px; font-size: 120px; opacity: .3; transform: rotate(-10deg); }
.s1 { background: linear-gradient(115deg, #4f46e5, #9333ea); }
.s2 { background: linear-gradient(115deg, #ff4d6d, #ff7a1a); }
.s3 { background: linear-gradient(115deg, #0ea5e9, #10b981); }
.s-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--ink); font-size: 18px; font-weight: 900;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.s-arrow:hover { background: #fff; }
.s-arrow.s-prev { right: 14px; }
.s-arrow.s-next { left: 14px; }
.s-dots { position: absolute; bottom: 14px; right: 50%; transform: translateX(50%); display: flex; gap: 7px; z-index: 5; }
.s-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; transition: .2s; }
.s-dots .dot.active { background: #fff; width: 24px; border-radius: 99px; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 16px; }
.side-banner {
  border-radius: 20px; padding: 22px; color: #fff; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden;
}
.side-banner .sb-emoji { position: absolute; left: 10px; bottom: -14px; font-size: 74px; opacity: .35; }
.side-banner b { font-size: 17px; }
.side-banner span { font-size: 12.5px; opacity: .92; }
.side-banner .sb-btn {
  background: rgba(255,255,255,.92); color: var(--ink); border-radius: 999px;
  padding: 6px 16px; font-size: 12.5px; font-weight: 800; width: fit-content; margin-top: 8px;
}
.sb-a { background: linear-gradient(120deg, #7c3aed, #4f46e5); }
.sb-b { background: linear-gradient(120deg, #f59e0b, #ff4d6d); }

/* ============ ticker ============ */
.ticker {
  background: var(--dark); color: #ffe8cc; border-radius: 999px; overflow: hidden;
  margin: 16px 0 4px; position: relative; font-size: 13.5px;
}
.ticker-track { display: flex; gap: 44px; white-space: nowrap; padding: 9px 0; width: max-content; animation: slide-lr 26s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes slide-lr { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ============ section head ============ */
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 14px; }
.section-head h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.section-head h2::before { content: ""; width: 6px; height: 22px; border-radius: 4px; background: linear-gradient(var(--primary), var(--accent)); }
.section-head a { color: var(--primary); font-size: 13.5px; font-weight: 700; }
.section-head a:hover { color: var(--accent); }

/* ============ circles (categories) ============ */
.circles-wrap { position: relative; }
.circles { display: flex; gap: 18px; overflow-x: auto; scroll-behavior: smooth; padding: 6px 2px 10px; scrollbar-width: none; }
.circles::-webkit-scrollbar { display: none; }
.circle {
  flex: 0 0 auto; width: 96px; text-align: center; font-size: 12.5px; color: #3a3f5c;
}
.circle .cc {
  width: 84px; height: 84px; margin: 0 auto 7px; border-radius: 50%; display: grid; place-items: center;
  font-size: 34px; background: #fff; border: 2px solid var(--line); transition: .18s;
  box-shadow: 0 6px 16px rgba(23,27,51,.06);
}
.circle:hover .cc { transform: translateY(-5px); border-color: var(--primary); }
.rail-btn {
  position: absolute; top: 30px; z-index: 6; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: #fff; box-shadow: 0 6px 16px rgba(23,27,51,.16); cursor: pointer;
  font-size: 16px; font-weight: 900; color: var(--ink); display: grid; place-items: center;
}
.rail-btn:hover { background: var(--primary); color: #fff; }
.rail-btn.next { right: -8px; }
.rail-btn.prev { left: -8px; }

/* ============ horizontal rails (carousels) ============ */
.rail-wrap { position: relative; }
.rail {
  display: flex; gap: 14px; overflow-x: auto; scroll-behavior: smooth; padding: 6px 2px 14px;
  scrollbar-width: none; scroll-snap-type: x mandatory;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 216px; scroll-snap-align: start; }

/* ============ product card ============ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .2s; position: relative; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(23,27,51,.1); }
.card .thumb { aspect-ratio: 1; background: #eee; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 14px; font-weight: 700; height: 48px; overflow: hidden; line-height: 1.8; }
.card h3 a:hover { color: var(--primary); }
.price { color: var(--primary); font-weight: 900; font-size: 16.5px; margin-top: 6px; }
.price small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 12.5px; margin-right: 7px; font-weight: 400; }
.stock-tag {
  position: absolute; top: 10px; right: 10px; background: #fff; z-index: 3;
  font-size: 11px; padding: 3px 9px; border-radius: 999px; box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.stock-tag.in { color: var(--ok); } .stock-tag.out { color: var(--err); }
.off-tag {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #fff; font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 800;
}
.btn {
  display: inline-block; border: none; cursor: pointer; font-family: inherit;
  background: var(--primary); color: #fff; padding: 10px 18px;
  border-radius: 12px; font-size: 14px; font-weight: 700; text-align: center; white-space: nowrap;
}
.btn:hover { background: var(--primary-2); }
.btn.ghost { background: #eef2ff; color: var(--primary); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.block { display: block; width: 100%; margin-top: auto; padding-top: 9px; }
.btn.danger { background: #fee2e2; color: var(--err); }
.btn.ok { background: #d1fae5; color: #047857; }
.btn.accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.card .btn.block { margin-top: 10px; }

/* ============ middle promo banner + countdown ============ */
.promo-banner {
  background: linear-gradient(110deg, #171b33, #4f46e5 65%, #9333ea);
  border-radius: 24px; color: #fff; padding: 34px 40px; margin: 30px 0 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.promo-banner::after { content: "🔥"; position: absolute; left: 24px; top: -18px; font-size: 110px; opacity: .18; }
.promo-banner h2 { font-size: 24px; margin-bottom: 6px; }
.promo-banner p { opacity: .9; font-size: 14.5px; }
.countdown { display: flex; gap: 10px; direction: ltr; }
.cd-box {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 14px;
  min-width: 72px; padding: 8px 10px; text-align: center; backdrop-filter: blur(4px);
}
.cd-box b { display: block; font-size: 24px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.cd-box span { font-size: 11px; opacity: .8; }
.cd-box.cd-main { background: #fff; color: var(--ink); border: none; }

/* ============ trust strip ============ */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0 6px; }
.trust .t-item {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  display: flex; align-items: center; gap: 12px; font-size: 13.5px;
}
.trust .t-item b { display: block; font-size: 14px; }
.trust .t-item span { color: var(--muted); font-size: 12px; }
.trust .t-ic { font-size: 26px; }

/* ============ brands ============ */
.brands { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.brands::-webkit-scrollbar { display: none; }
.brand-chip {
  flex: 0 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 26px; font-weight: 800; color: #565c7d; font-size: 14.5px; filter: grayscale(1); opacity: .8;
}
.brand-chip:hover { filter: none; opacity: 1; border-color: var(--primary); color: var(--primary); }

/* ============ grid ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 16px; }

/* ============ product page ============ */
.pview { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; background: #fff;
  border: 1px solid var(--line); border-radius: 22px; padding: 26px; margin-top: 26px; }
.pview .pic { border-radius: 18px; overflow: hidden; }
.pview h1 { font-size: 22px; margin-bottom: 12px; }
.meta { color: var(--muted); font-size: 13.5px; }
.desc { margin: 16px 0; font-size: 15px; color: #3a3f57; }
.supplier-box {
  background: #f8f9ff; border: 1px dashed #c7cdf5; border-radius: 14px;
  padding: 12px 16px; font-size: 13.5px; color: #4b5170; margin-top: 14px;
}
.qty-row { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.qty-row input[type=number] {
  width: 80px; flex: 0 0 80px; padding: 10px; border: 1.5px solid var(--line);
  border-radius: 10px; text-align: center; font-family: inherit;
}

/* ============ tables / forms ============ */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; }
th, td { padding: 12px 14px; text-align: right; font-size: 14px; border-bottom: 1px solid var(--line); }
th { background: #f1f3fb; font-size: 13px; color: #4b5170; }
input[type=text], input[type=tel], input[type=number], input[type=password],
select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font-family: inherit; outline: none; background: #fff;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
label { font-size: 13.5px; font-weight: 700; color: #454b66; display: block; margin: 12px 0 6px; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }

/* ============ cart / checkout ============ */
.cart-line {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px;
}
.cart-line img { width: 64px; height: 64px; border-radius: 12px; }
.cart-line .t { flex: 1; font-size: 14.5px; font-weight: 700; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.summary .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14.5px; }
.summary .row.total { border-top: 1.5px dashed var(--line); margin-top: 8px; padding-top: 14px; font-weight: 900; font-size: 17px; color: var(--primary); }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.radio-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.radio-row label {
  margin: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 16px;
  cursor: pointer; font-weight: 400; font-size: 14px;
}
.radio-row input { margin-left: 6px; }

/* ============ admin ============ */
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 22px; padding: 24px 0 50px; }
.side {
  background: #171b33; color: #cfd3ee; border-radius: 18px; padding: 20px 14px;
  align-self: start; position: sticky; top: 130px;
}
.side a { display: block; padding: 11px 14px; border-radius: 11px; font-size: 14.5px; margin-bottom: 4px; }
.side a:hover, .side a.active { background: var(--primary); color: #fff; }
.side .head { font-size: 12px; opacity: .6; padding: 4px 14px 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat .n { font-size: 24px; font-weight: 900; color: var(--primary); }
.stat .l { font-size: 13px; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 18px; }
.panel h3 { font-size: 16px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.badge { display: inline-block; font-size: 12px; padding: 3px 11px; border-radius: 999px; font-weight: 700; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.paid { background: #dbeafe; color: #1d4ed8; }
.badge.forwarded { background: #ede9fe; color: #6d28d9; }
.badge.shipped { background: #cffafe; color: #0e7490; }
.badge.delivered { background: #d1fae5; color: #047857; }
.badge.cancelled { background: #fee2e2; color: #b91c1c; }
.code-box {
  background: #0f1226; color: #7ee7c7; direction: ltr; text-align: left;
  padding: 12px 14px; border-radius: 11px; font-size: 13px; word-break: break-all;
  font-family: Consolas, monospace; margin: 8px 0;
}
.steps { font-size: 14px; padding-right: 20px; color: #454b66; }
.steps li { margin-bottom: 8px; }

/* ============ footer ============ */
footer.site { background: var(--dark); color: #aab0d4; margin-top: 46px; padding: 40px 0 30px; font-size: 13.5px; }
.f-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 26px; }
footer .logo { color: #fff; margin-bottom: 8px; }
footer h4 { color: #fff; font-size: 14.5px; margin-bottom: 12px; }
footer ul { list-style: none; }
footer li { margin-bottom: 7px; }
footer a:hover { color: #fff; }
.f-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.f-badge { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); padding: 7px 14px; border-radius: 10px; font-size: 12px; }
.f-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 26px; padding-top: 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; opacity: .8; }

/* ============ sticky bottom bar ============ */
.bottombar {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 70;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(23,27,51,.08); display: flex; justify-content: center;
}
.bottombar .bb-inner { display: flex; width: min(680px, 100%); }
.bottombar a {
  flex: 1; text-align: center; padding: 8px 4px 7px; font-size: 11.5px; color: #6b7194;
  display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative;
}
.bottombar a b { font-size: 19px; line-height: 1.4; }
.bottombar a:hover, .bottombar a.active { color: var(--primary); }
.bottombar a .bb-badge {
  position: absolute; top: 2px; right: calc(50% - 22px); background: var(--accent-2); color: #fff;
  font-size: 10px; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; font-weight: 800;
}

/* ============ misc ============ */
.badge { display: inline-block; }
.tag { display: inline-block; background: #eef2ff; color: var(--primary); font-size: 12px; padding: 2px 10px; border-radius: 999px; }

/* ============ responsive ============ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .f-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .pview, .two-col, .admin-wrap { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .slide h2 { font-size: 23px; }
  .slide { padding: 28px 24px; }
  .hrow { flex-wrap: wrap; }
  .search { order: 3; max-width: none; width: 100%; }
  .h-actions { margin-right: auto; }
  .topbar-row .tb-left { display: none; }
  .promo-banner { padding: 26px 22px; }
}
@media (max-width: 560px) {
  .hero-side { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .f-grid { grid-template-columns: 1fr; }
}
