/* ═══════════════════════════════════════════════════════
   تیلا شاپ — استایل اصلی
   فونت: Vazirmatn + Playfair Display
   تم: لاکچری تیره با لهجه طلایی-صورتی
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&display=swap');
@font-face { font-family: Vazirmatn; src: local(Tahoma); }

/* ─── متغیرها ─────────────────────────────────────── */
:root {
  --bg:         #0c0d12;
  --surface:    #13151f;
  --surface2:   #1a1d2b;
  --border:     #252a3a;
  --border2:    #2f3548;
  --text:       #e8eaf0;
  --muted:      #8891a4;
  --accent:     #ff4d8d;
  --accent2:    #ff82b3;
  --gold:       #f0b429;
  --gold2:      #ffd166;
  --green:      #00d68f;
  --red:        #ff4444;
  --blue:       #4d9fff;
  --radius:     18px;
  --radius-sm:  10px;
  --radius-lg:  28px;
  --shadow:     0 8px 40px rgba(0,0,0,.45);
  --shadow-sm:  0 2px 12px rgba(0,0,0,.3);
  --trans:      .22s cubic-bezier(.4,0,.2,1);
}

/* ─── ریست و پایه ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, 'Segoe UI', Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  direction: rtl;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── اسکرول‌بار ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── لایه‌بندی ─────────────────────────────────── */
.wrap { max-width: 1200px; margin: auto; padding: 0 20px; }
.container { max-width: 780px; margin: 0 auto; padding: 0 20px; }

/* ─── هدر ──────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12,13,18,.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  max-width: 1200px;
  margin: auto;
}

.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: color var(--trans), background var(--trans);
}
.site-nav a:hover { color: var(--text); background: var(--surface2); }
.site-nav a.active { color: var(--accent); }

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text) !important;
  border-radius: 50px;
  padding: 8px 16px !important;
  font-weight: 600;
}
.cart-btn:hover { border-color: var(--accent) !important; }
.cart-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── هیرو ──────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 24px 0 40px;
  padding: 70px 50px;
  background: linear-gradient(135deg, #1e0b1a 0%, #0d1329 50%, #1a0e25 100%);
  border: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(255,77,141,.12) 0%, transparent 70%),
              radial-gradient(ellipse 40% 60% at 20% 80%, rgba(240,180,41,.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 46px;
  line-height: 1.25;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 30%, var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { color: var(--muted); font-size: 17px; margin-bottom: 30px; }

/* ─── دکمه‌ها ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--trans);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c0156d);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,77,141,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,77,141,.5);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #d49010);
  color: #000;
  box-shadow: 0 4px 20px rgba(240,180,41,.3);
}
.btn-gold:hover { transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-danger { background: rgba(255,68,68,.15); color: var(--red); border: 1px solid rgba(255,68,68,.3); }
.btn-danger:hover { background: rgba(255,68,68,.25); }
.btn-success { background: rgba(0,214,143,.12); color: var(--green); border: 1px solid rgba(0,214,143,.25); }
.btn-success:hover { background: rgba(0,214,143,.22); }

/* ─── کارت‌ها ──────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--trans);
}
.card:hover { border-color: var(--border2); transform: translateY(-3px); box-shadow: var(--shadow); }

.card-body { padding: 18px; }
.card-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface2); }

/* ─── گرید محصولات ──────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.product-card { display: flex; flex-direction: column; }
.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface2);
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.06); }

.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
}
.product-badge.badge-gold { background: var(--gold); color: #000; }

.product-info { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.product-cat { font-size: 12px; color: var(--muted); }
.product-title { font-weight: 700; font-size: 15px; line-height: 1.4; }

.product-prices { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.price-main { color: var(--gold2); font-weight: 800; font-size: 17px; }
.price-old { color: var(--muted); font-size: 13px; text-decoration: line-through; }
.price-num { font-weight: 800; }
.price-unit { font-size: 12px; color: var(--muted); }

.product-actions { padding: 0 14px 14px; display: flex; gap: 8px; }
.product-actions .btn { flex: 1; justify-content: center; }

/* ─── بج‌های وضعیت ───────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
}
.badge-green { background: rgba(0,214,143,.15); color: var(--green); border: 1px solid rgba(0,214,143,.3); }
.badge-red   { background: rgba(255,68,68,.12);  color: var(--red);   border: 1px solid rgba(255,68,68,.25); }
.badge-gold  { background: rgba(240,180,41,.15); color: var(--gold2); border: 1px solid rgba(240,180,41,.3); }
.badge-blue  { background: rgba(77,159,255,.12); color: var(--blue);  border: 1px solid rgba(77,159,255,.25); }
.badge-muted { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

.status-pending { background: rgba(240,180,41,.12); color: var(--gold2); border: 1px solid rgba(240,180,41,.25); }
.status-paid    { background: rgba(0,214,143,.12);  color: var(--green); border: 1px solid rgba(0,214,143,.25); }
.status-packing { background: rgba(77,159,255,.12); color: var(--blue);  border: 1px solid rgba(77,159,255,.25); }
.status-sent    { background: rgba(170,90,255,.12); color: #bb8cff;      border: 1px solid rgba(170,90,255,.25); }
.status-done    { background: rgba(0,214,143,.2);   color: var(--green); border: 1px solid rgba(0,214,143,.4); }
.status-cancel  { background: rgba(255,68,68,.12);  color: var(--red);   border: 1px solid rgba(255,68,68,.25); }

/* ─── فرم‌ها ─────────────────────────────────── */
.form-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 600px;
  margin: 30px auto;
}
.form-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.form-label span { color: var(--accent); }

.form-control {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--trans), box-shadow var(--trans);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,77,141,.15);
}
.form-control::placeholder { color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M6 7L0 0h12z' fill='%238891a4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-footer { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.form-footer .btn { flex: 1; justify-content: center; }

/* ─── پیام‌ها ─────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error   { background: rgba(255,68,68,.1);   border: 1px solid rgba(255,68,68,.3);   color: #ff8080; }
.alert-success { background: rgba(0,214,143,.1);   border: 1px solid rgba(0,214,143,.3);   color: var(--green); }
.alert-info    { background: rgba(77,159,255,.1);  border: 1px solid rgba(77,159,255,.3);  color: var(--blue); }
.alert-warning { background: rgba(240,180,41,.1);  border: 1px solid rgba(240,180,41,.3);  color: var(--gold2); }

/* ─── جداول ──────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th {
  padding: 14px 18px;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--trans); }
tbody tr:hover { background: var(--surface2); }

/* ─── صفحه‌بندی ───────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  transition: all var(--trans);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── صفحه خالی ───────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .icon { font-size: 64px; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { color: var(--muted); font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 14px; }

/* ─── فوتر ──────────────────────────────────── */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding: 50px 0 24px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand { font-family: 'Playfair Display', serif; font-size: 22px; margin-bottom: 12px; }
.footer-brand span { background: linear-gradient(135deg, var(--gold), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-desc { color: var(--muted); font-size: 14px; line-height: 1.8; }
.footer-links h4, .footer-contact h4 { font-size: 14px; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text); font-size: 14px; transition: color var(--trans); }
.footer-links a:hover { color: var(--accent); }
.footer-contact p { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.footer-contact strong { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* ─── پنل ادمین ──────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 24px 20px;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--gold), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--trans);
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav a.active { background: rgba(255,77,141,.12); color: var(--accent); }
.sidebar-nav a .nav-icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }

.admin-main { flex: 1; overflow-x: hidden; }
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-topbar h1 { font-size: 18px; font-weight: 700; }
.admin-content { padding: 28px; }

/* کارت‌های داشبورد */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 30px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow, transparent) 0%, transparent 60%);
  pointer-events: none;
}
.stat-card.green { --accent-glow: rgba(0,214,143,.06); }
.stat-card.gold  { --accent-glow: rgba(240,180,41,.06); }
.stat-card.pink  { --accent-glow: rgba(255,77,141,.06); }
.stat-card.blue  { --accent-glow: rgba(77,159,255,.06); }
.stat-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-value .price-unit { font-size: 14px; }
.stat-icon { position: absolute; top: 18px; left: 18px; font-size: 28px; opacity: .15; }

/* ─── ریسپانسیو ──────────────────────────────── */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero { padding: 40px 24px; }
  .hero h1 { font-size: 30px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .form-wrap { padding: 24px 18px; }
  .admin-sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .site-nav.open { display: flex; flex-direction: column; position: fixed; inset: 60px 0 0; background: var(--surface); padding: 20px; z-index: 99; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero h1 { font-size: 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── انیمیشن‌ها ─────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-up { animation: fadeUp .5s ease both; }
.fade-up:nth-child(1) { animation-delay: .05s; }
.fade-up:nth-child(2) { animation-delay: .1s; }
.fade-up:nth-child(3) { animation-delay: .15s; }
.fade-up:nth-child(4) { animation-delay: .2s; }
.fade-up:nth-child(5) { animation-delay: .25s; }

.loading { animation: pulse 1.4s infinite; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* ─── چک‌باکس و رادیو سفارشی ──────────────────── */
.check-group { display: flex; flex-wrap: wrap; gap: 10px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--trans);
}
.check-item:hover { border-color: var(--accent); }
.check-item input[type=radio], .check-item input[type=checkbox] { accent-color: var(--accent); }
.check-item.selected { border-color: var(--accent); background: rgba(255,77,141,.08); color: var(--accent); }

/* ─── ضلع بالای صفحه ─────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-hero h1 { font-size: 24px; font-weight: 700; }
.page-hero p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ─── قیمت بزرگ سبد خرید ───────────────────── */
.order-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 90px;
}
.order-summary h3 { font-size: 16px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; }
.summary-row .label { color: var(--muted); }
.summary-total { font-size: 20px; font-weight: 800; color: var(--gold2); }

/* ─── پروفایل ───────────────────────────────── */
.profile-header {
  background: linear-gradient(135deg, #1e0b1a, #0d1329);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}
.profile-avatar {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff; flex-shrink: 0;
}
