:root {
  --bg: #f4f6fb;
  --ink: #1a2233;
  --muted: #6b7488;
  --primary: #12b3a6;
  --primary-dark: #0d8f85;
  --accent: #ff5a5f;
  --accent-dark: #e8484d;
  --gold: #f0a500;
  --line: #e2e7f0;
  --card: #ffffff;
  --navy: #16213e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
}
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* نوار اطلاعیه */
.topbar {
  background: var(--navy); color: #cdd6e8; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 7px 16px; flex-wrap: wrap;
}
.topbar-sep { color: var(--primary); }

/* هدر */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  box-shadow: 0 2px 14px rgba(22,33,62,.05);
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; flex-shrink: 0; }
.brand-logo {
  font-size: 30px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 6px 16px rgba(18,179,166,.28);
}
.brand-name { font-weight: 800; font-size: 23px; letter-spacing: -.3px; color: var(--navy); line-height: 1.2; }
.brand-tag { font-size: 12px; color: var(--primary-dark); font-weight: 500; }
.search-wrap { flex: 1; position: relative; max-width: 580px; margin: 0 auto; }
.search-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); font-size: 15px; }
.search-input {
  width: 100%; padding: 12px 42px 12px 16px;
  border: 2px solid var(--line); border-radius: 14px;
  font-family: inherit; font-size: 15px; background: var(--bg);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(18,179,166,.12); }
.cart-btn {
  position: relative; font-size: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; color: #fff; width: 50px; height: 50px; border-radius: 15px;
  cursor: pointer; flex-shrink: 0; transition: transform .15s, box-shadow .2s;
  box-shadow: 0 6px 16px rgba(255,90,95,.3);
}
.cart-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255,90,95,.38); }
.cart-badge {
  position: absolute; top: -6px; left: -6px; background: var(--navy);
  color: #fff; font-size: 12px; font-weight: 700; min-width: 22px; height: 22px;
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  padding: 0 5px; border: 2px solid #fff;
}

/* لایه‌بندی بدنه */
.body { display: flex; flex: 1; max-width: 1440px; width: 100%; margin: 0 auto; }
.sidebar { width: 270px; flex-shrink: 0; padding: 24px 18px; }
.sidebar-inner {
  position: sticky; top: 100px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px;
  box-shadow: 0 4px 20px rgba(22,33,62,.05);
}
.filter-group { margin-bottom: 22px; }
.filter-group:last-of-type { margin-bottom: 12px; }
.filter-group h4 { font-weight: 700; font-size: 14.5px; margin-bottom: 12px; color: var(--navy); }
.pill-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-family: inherit; font-size: 12.5px; padding: 8px 13px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 500;
  transition: all .15s; color: var(--ink);
}
.pill:hover { border-color: var(--primary); color: var(--primary-dark); }
.pill-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.slider { width: 100%; accent-color: var(--primary); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; font-size: 14px; }
.checkbox-row input { accent-color: var(--primary); width: 17px; height: 17px; }
.clear-btn {
  font-family: inherit; width: 100%; padding: 10px; border: 1.5px dashed var(--accent);
  background: transparent; color: var(--accent); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 13.5px;
}
.clear-btn:hover { background: rgba(255,90,95,.06); }

/* بخش اصلی */
.main { flex: 1; padding: 24px 20px 60px; min-width: 0; }
.main-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
}
.result-count { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: auto; }
.sort-select {
  font-family: inherit; padding: 9px 14px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--bg); font-size: 14px; cursor: pointer; color: var(--ink);
}
.filters-toggle {
  font-family: inherit; padding: 10px 15px; border-radius: 11px; border: 1.5px solid var(--primary);
  background: #fff; color: var(--primary-dark); font-weight: 600; cursor: pointer;
}

/* گرید */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: pop .35s ease both;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(22,33,62,.13); border-color: var(--primary); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.thumb-wrap { position: relative; }
.thumb {
  position: relative; display: flex; align-items: center; justify-content: center;
}
.discount-badge {
  position: absolute; top: 10px; right: 10px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(255,90,95,.35);
}
.thumb-cat { font-size: 54px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.18)); }
.thumb-animal { position: absolute; bottom: 10px; left: 12px; font-size: 22px;
  background: rgba(255,255,255,.9); border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 7px; }
.tag-animal { background: rgba(18,179,166,.12); color: var(--primary-dark); }
.tag-cat { background: rgba(240,165,0,.15); color: #a06f00; }
.card-name { font-size: 14.5px; font-weight: 700; line-height: 1.5; flex: 1; color: var(--navy); }
.card-meta { display: flex; align-items: center; gap: 6px; }
.stars { color: var(--gold); font-size: 14px; font-weight: 700; }
.rating-num { color: var(--muted); font-size: 12px; margin-right: 4px; }
.reviews { color: #9aa2b5; font-size: 11.5px; }
.card-price-block { margin-top: 2px; }
.old-price { color: #9aa2b5; font-size: 12.5px; text-decoration: line-through; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 800; font-size: 18px; color: var(--navy); }
.price .toman { font-size: 12px; font-weight: 500; color: var(--muted); }
.price-lg { font-size: 26px; color: var(--primary-dark); }
.price-lg .toman { font-size: 15px; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge-in { background: rgba(18,179,166,.14); color: var(--primary-dark); }
.badge-low { background: rgba(240,165,0,.18); color: #a06f00; }
.badge-out { background: rgba(255,90,95,.16); color: var(--accent-dark); }
.btn-add {
  font-family: inherit; margin-top: 4px; padding: 11px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background .2s, transform .12s;
}
.btn-add:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-disabled { background: #d4d9e4; color: #9099ad; cursor: not-allowed; }
.btn-disabled:hover { transform: none; background: #d4d9e4; }
.btn-big { padding: 15px; font-size: 16px; width: 100%; }

/* صفحه‌بندی */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 36px; }
.pagination button {
  font-family: inherit; padding: 11px 20px; border: 1.5px solid var(--primary); background: #fff;
  color: var(--primary-dark); border-radius: 12px; font-weight: 700; cursor: pointer;
}
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-weight: 600; color: var(--muted); }
.no-results { text-align: center; padding: 70px 20px; color: var(--muted); }
.no-results p { margin: 14px 0 18px; font-size: 17px; }
.no-results .btn-add { display: inline-block; padding: 11px 24px; }

/* مودال */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(22,33,62,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 22px; max-width: 500px; width: 100%; overflow: hidden;
  position: relative; max-height: 92vh; overflow-y: auto; animation: pop .28s ease both;
}
.modal-close {
  position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(255,255,255,.92);
  border: none; width: 38px; height: 38px; border-radius: 50%; font-size: 16px; cursor: pointer;
  font-weight: 700; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.modal-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 12px; }
.modal-title { font-weight: 800; font-size: 21px; line-height: 1.5; color: var(--navy); }
.modal-desc { color: var(--muted); line-height: 1.9; font-size: 14.5px; }
.modal-price-row { display: flex; align-items: flex-end; justify-content: space-between; }
.qty-row { display: flex; align-items: center; justify-content: space-between; }
.qty-label { font-weight: 600; }
.qty-ctrl { display: flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; }
.qty-ctrl button {
  font-family: inherit; width: 36px; height: 36px; border: none; background: var(--bg);
  border-radius: 9px; font-size: 20px; font-weight: 700; cursor: pointer; color: var(--primary-dark);
}
.qty-ctrl button:hover { background: var(--line); }
.qty-ctrl.small button { width: 28px; height: 28px; font-size: 16px; }
.qty-val { min-width: 32px; text-align: center; font-weight: 700; }
.checkout-modal { text-align: center; padding: 42px 32px; max-width: 420px; }
.checkout-modal h2 { font-size: 24px; margin: 14px 0 10px; color: var(--primary-dark); }
.checkout-modal p { color: var(--muted); margin-bottom: 24px; line-height: 1.8; }

/* سبد خرید */
.drawer-wrap { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.drawer-wrap.open { pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(22,33,62,.5); opacity: 0; transition: opacity .3s; }
.drawer-wrap.open .drawer-backdrop { opacity: 1; }
.drawer {
  position: absolute; left: 0; top: 0; height: 100%; width: 410px; max-width: 92vw;
  background: var(--bg); box-shadow: 10px 0 40px rgba(0,0,0,.2);
  transform: translateX(-100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer-wrap.open .drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-head h2 { font-size: 20px; color: var(--navy); }
.drawer-head .modal-close { position: static; box-shadow: none; }
.cart-empty { text-align: center; padding: 60px 30px; color: var(--muted); margin: auto; }
.cart-empty-emoji { font-size: 60px; margin-bottom: 14px; }
.cart-empty p { margin-bottom: 20px; font-size: 16px; line-height: 1.7; }
.cart-empty .btn-add { display: inline-block; padding: 11px 26px; }
.cart-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.cart-item .thumb { width: 64px; border-radius: 11px; flex-shrink: 0; }
.cart-item .thumb-cat { font-size: 26px; }
.cart-item .thumb-animal { width: 20px; height: 20px; font-size: 12px; bottom: 3px; left: 3px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: 13.5px; line-height: 1.5; }
.cart-item-brand { font-size: 12px; color: #9aa2b5; }
.cart-item-price { font-weight: 800; color: var(--primary-dark); margin-top: 3px; font-size: 13px; }
.cart-item-ctrl { display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: center; }
.remove-btn { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .7; }
.remove-btn:hover { opacity: 1; }
.cart-summary { padding: 18px 20px 22px; border-top: 1px solid var(--line); background: #fff; }
.sum-row { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 14px; }
.sum-total { font-weight: 800; font-size: 18px; color: var(--navy); border-top: 1px dashed var(--line); padding-top: 11px; margin-top: 4px; }

/* فیلتر موبایل */
.mobile-filters {
  position: fixed; inset: 0; background: var(--bg); z-index: 95; overflow-y: auto; padding: 16px 20px 40px;
}
.mobile-filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mobile-filters-head h3 { font-size: 20px; color: var(--navy); }
.mobile-filters-head .modal-close { position: static; box-shadow: none; }
.mobile-filters .sidebar-inner { position: static; }

/* توست */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 13px 24px; border-radius: 999px;
  font-weight: 600; z-index: 120; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px;
  animation: toastin .3s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* فوتر */
.footer { background: var(--navy); color: #cdd6e8; margin-top: auto; }
.footer-features {
  max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  padding: 28px 24px; border-bottom: 1px solid #263252;
}
.feature { display: flex; align-items: center; gap: 12px; }
.feature-icon { font-size: 30px; }
.feature b { display: block; color: #fff; font-size: 14.5px; }
.feature span { font-size: 12.5px; color: #94a0bf; }
.footer-cols { max-width: 1440px; margin: 0 auto; display: flex; gap: 40px; flex-wrap: wrap; padding: 34px 24px 24px; }
.footer-cols > div { min-width: 160px; flex: 1; }
.footer-brand { font-weight: 800; font-size: 21px; color: #fff; margin-bottom: 10px; }
.footer-cols h5 { color: #fff; margin-bottom: 12px; font-size: 14.5px; }
.footer-cols a { display: block; color: #94a0bf; text-decoration: none; font-size: 13.5px; margin-bottom: 8px; transition: color .15s; }
.footer-cols a:hover { color: var(--primary); }
.footer-cols p { color: #8892ad; font-size: 13.5px; line-height: 1.9; }
.footer-bottom {
  border-top: 1px solid #263252; padding: 16px 24px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; max-width: 1440px; margin: 0 auto; font-size: 13px; color: #8892ad;
}
.footer-bottom a { color: var(--primary); text-decoration: none; font-weight: 600; }
.footer-bottom a:hover { text-decoration: underline; }

/* واکنش‌گرا */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .desktop-only { display: none; }
  .mobile-only { display: inline-flex; }
  .brand-tag { display: none; }
  .header { flex-wrap: wrap; padding: 10px 14px; }
  .search-wrap { order: 3; max-width: none; width: 100%; margin: 6px 0 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
  .thumb-cat { font-size: 44px; }
  .card-name { font-size: 13.5px; }
  .footer-features { grid-template-columns: repeat(2, 1fr); }
  .topbar { font-size: 11px; }
}
@media (max-width: 480px) {
  .footer-features { grid-template-columns: 1fr; }
}