/* ===== شاپ۷۲۴ — Professional Digikala-inspired Store ===== */
@font-face {
  font-family: Vazirmatn;
  src: local('Vazirmatn'), local('Vazir'),
       url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: local('Vazirmatn'),
       url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: local('Vazirmatn'),
       url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --primary: #ef4056;
  --primary-dark: #d93a4e;
  --primary-light: #fff0f2;
  --text: #0c0c0c;
  --text-secondary: #62666d;
  --text-muted: #81858b;
  --border: #e0e0e2;
  --bg: #f5f5f5;
  --bg-white: #ffffff;
  --success: #00a049;
  --rating: #f9bc00;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08);
  --shadow: 0 2px 8px rgba(0,0,0,.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font: Vazirmatn, Tahoma, system-ui, sans-serif;
  --header-h: 72px;
  --container: 1336px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
input, select { font-family: inherit; }

.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}

/* ========== TOP BAR ========== */
.topbar {
  background: #1a1a2e;
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  padding: 8px 16px;
}
.topbar a { color: #ffd54f; font-weight: 500; }
.topbar a:hover { text-decoration: underline; }

/* ========== HEADER ========== */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-main {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
  padding: 0 16px;
  max-width: var(--container);
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #ff6b7a);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(239,64,86,.35);
}
.logo span { color: var(--primary); }

.search-box {
  flex: 1;
  max-width: 640px;
  position: relative;
}
.search-box input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f0f0f1;
  font-size: 14px;
  outline: none;
  transition: .2s;
}
.search-box input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(239,64,86,.12);
}
.search-box button {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  transition: .2s;
}
.search-box button:hover { background: var(--primary-dark); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  transition: .2s;
  border: 1px solid transparent;
}
.hdr-btn:hover {
  background: #f5f5f5;
  border-color: var(--border);
}
.hdr-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.hdr-btn.primary:hover { background: var(--primary-dark); }
.cart-btn {
  position: relative;
}
.cart-count {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--primary);
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}
.cart-count.show { display: flex; }

/* ========== CATEGORY NAV ========== */
.cat-nav {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  max-width: var(--container);
  margin: 0 auto;
  height: 48px;
  align-items: center;
}
.cat-nav a {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: .15s;
}
.cat-nav a:hover, .cat-nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* ========== HERO / BANNER ========== */
.hero {
  padding: 20px 0 8px;
}
.banner-slider {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1a1a2e;
  aspect-ratio: 21/7;
  max-height: 320px;
}
.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
  display: flex;
  align-items: center;
  padding: 0 8%;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b3d 50%, #1a1a2e 100%);
}
.banner-slide.active { opacity: 1; z-index: 1; }
.banner-slide:nth-child(2) {
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}
.banner-slide:nth-child(3) {
  background: linear-gradient(135deg, #2b1055 0%, #7597de 100%);
}
.banner-content h2 {
  color: #fff;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}
.banner-content p {
  color: rgba(255,255,255,.8);
  font-size: 15px;
  margin-bottom: 20px;
  max-width: 420px;
}
.banner-content .btn {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: .2s;
}
.banner-content .btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.banner-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.banner-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  transition: .2s;
}
.banner-dots button.active { background: #fff; width: 22px; border-radius: 4px; }

/* ========== SECTION COMMON ========== */
.section {
  padding: 28px 0;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .icon {
  width: 28px;
  height: 28px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.section-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-link:hover { text-decoration: underline; }

/* ========== AMAZING OFFERS ========== */
.amazing {
  background: linear-gradient(90deg, #ef4056, #ff6b7a);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  margin-bottom: 8px;
}
.amazing .section-header { margin-bottom: 16px; }
.amazing .section-title { color: #fff; }
.amazing .section-title .icon { background: rgba(255,255,255,.2); color: #fff; }
.amazing .section-link { color: #fff; }
.countdown {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}
.countdown span {
  background: #fff;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.amazing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.amazing-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  transition: .25s;
  color: var(--text);
}
.amazing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.amazing-card .img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f7f7f7;
  position: relative;
}
.amazing-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.amazing-card .discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.amazing-card .body {
  padding: 10px 12px 14px;
}
.amazing-card h3 {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  height: 38px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}
.amazing-card .price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.amazing-card .price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.amazing-card .old-price {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ========== CATEGORY ICONS ========== */
.cat-icons {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}
.cat-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid transparent;
  transition: .2s;
  cursor: pointer;
}
.cat-icon-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.cat-icon-item .icon-box {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: grid;
  place-items: center;
  color: var(--primary);
}
.cat-icon-item .icon-box svg {
  width: 26px;
  height: 26px;
}
.cat-icon-item span {
  font-size: 12.5px;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
}

/* ========== PRODUCT GRID ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: .25s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow);
  border-color: transparent;
}
.product-card .img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #fafafa;
  position: relative;
}
.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .img-wrap img { transform: scale(1.04); }
.product-card .badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
}
.product-card .body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.product-card h3 {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-card .rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.product-card .rating .stars {
  color: var(--rating);
  letter-spacing: -1px;
}
.product-card .price-area {
  margin-top: auto;
  padding-top: 8px;
}
.product-card .price {
  font-size: 16px;
  font-weight: 700;
}
.product-card .old-price {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 6px;
}
.product-card .add-btn {
  margin-top: 10px;
  width: 100%;
  height: 38px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.product-card .add-btn:hover {
  background: var(--primary);
  color: #fff;
}
.product-card .add-btn.added {
  background: var(--success);
  color: #fff;
}

/* ========== TRUST BAR ========== */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  border: 1px solid var(--border);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 14px;
}
.trust-item .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.trust-item .icon svg { width: 24px; height: 24px; }
.trust-item h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.trust-item p { font-size: 12.5px; color: var(--text-muted); margin: 0; }

/* ========== FOOTER ========== */
.footer {
  background: #3c3c3c;
  color: #b0b0b0;
  padding: 48px 0 0;
  margin-top: 40px;
  font-size: 13.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
}
.footer h4 {
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 16px;
}
.footer a {
  display: block;
  color: #b0b0b0;
  margin-bottom: 10px;
  transition: .15s;
}
.footer a:hover { color: #fff; }
.footer-brand p {
  margin-top: 12px;
  line-height: 1.7;
  max-width: 280px;
}
.footer-bottom {
  border-top: 1px solid #555;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: #888;
}

/* ========== CART DRAWER ========== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: .3s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(400px, 92vw);
  height: 100%;
  background: #fff;
  z-index: 210;
  transform: translateX(-105%);
  transition: .35s cubic-bezier(.22,1,.36,1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.cart-drawer.open { transform: translateX(0); }
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cart-header h3 { font-size: 1.05rem; font-weight: 700; }
.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: .15s;
}
.cart-close:hover { background: #f5f5f5; color: var(--text); }
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.cart-empty svg { margin: 0 auto 16px; opacity: .4; }
.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 {
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-info .price { font-weight: 700; font-size: 14px; }
.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.qty-ctrl button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--text);
  transition: .15s;
}
.qty-ctrl button:hover { border-color: var(--primary); color: var(--primary); }
.qty-ctrl span { min-width: 22px; text-align: center; font-size: 13.5px; }
.cart-item-remove {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.cart-item-remove:hover { color: var(--primary); }
.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
}
.cart-total span:last-child { color: var(--primary); font-size: 1.15rem; }
.btn-checkout {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  transition: .2s;
}
.btn-checkout:hover { background: var(--primary-dark); }

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: .35s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========== MOBILE MENU ========== */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--border);
}
.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 150;
  visibility: hidden;
  pointer-events: none;
}
.mobile-menu.open { visibility: visible; pointer-events: auto; }
.mobile-menu-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: .3s;
}
.mobile-menu.open .mobile-menu-bg { opacity: 1; }
.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 88vw);
  height: 100%;
  background: #fff;
  transform: translateX(100%);
  transition: .35s cubic-bezier(.22,1,.36,1);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-panel a {
  display: block;
  padding: 12px 10px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--text);
}
.mobile-menu-panel a:hover { background: var(--primary-light); color: var(--primary); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .cat-icons { grid-template-columns: repeat(4, 1fr); }
  .trust-bar { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .header-main { gap: 10px; }
  .search-box { max-width: none; }
  .hdr-btn span.text { display: none; }
  .menu-toggle { display: flex; }
  .cat-nav { display: none; }
  .banner-slider { aspect-ratio: 16/9; max-height: 220px; }
  .cat-icons { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .amazing-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-bar { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .cat-icons { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .cat-icon-item { padding: 12px 4px; }
  .cat-icon-item .icon-box { width: 48px; height: 48px; }
}
