@font-face {
  font-family: 'Vazirmatn';
  src: url('../assests/fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assests/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assests/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assests/fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
:root {
  --bg-base: #0a77ca;  
  --glass-bg: rgba(15, 23, 42, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --accent: #e11d48;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Vazirmatn', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh; 
}

.bg-pattern {
  position: fixed;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background-image: url('../assests/cat.png'); 
  background-size: 150px;
  opacity: 0.04;
  animation: panPattern 100s linear infinite;
  z-index: -2;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  top: 20%; left: 50%; width: 80vw; height: 80vw;
  background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(2,6,23,0) 70%);
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}

@keyframes panPattern {
  0% { transform: rotate(-10deg) translate3d(0, 0, 0); }
  100% { transform: rotate(-10deg) translate3d(200px, 200px, 0); }
}

.products-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 120px auto 60px; 
  padding: 0 20px;
  flex: 1; 
  z-index: 1;
}

.page-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 25px;
  text-align: right;
}
.highlight-text { color: var(--primary); }

 
.glass-toolbar {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: #fff;
  font-family: inherit;
  transition: all 0.3s;
}
.search-input:focus { border-color: var(--primary); outline: none; background: rgba(255, 255, 255, 0.1); }

.search-button {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: #fff;
  border: none;
  width: 35px; height: 35px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}
.search-button:hover { background: #2563eb; }

.actions { display: flex; gap: 15px; align-items: center; }

.filter-trigger-btn, .sort-options select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-trigger-btn:hover, .sort-options select:hover { background: rgba(255, 255, 255, 0.1); }
.sort-options { position: relative; }
.sort-options select { appearance: none; padding-right: 35px; }
.sort-options i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #94a3b8; }
.sort-options select option { background: #0f172a; color: #fff; }

/* --- گرید محصولات --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}

.product-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
  border-color: rgba(59, 130, 246, 0.3);
}

.product-link-wrapper { text-decoration: none; color: inherit; display: block; }

.product-image-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  background: rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-image-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-image-container img { transform: scale(1.05); }

.discount-badge {
  position: absolute;
  top: 15px; right: 15px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.4);
}

.product-info { padding: 20px; }
.product-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 15px; line-height: 1.4; }

.product-price-section { display: flex; flex-direction: column; gap: 5px; margin-bottom: 15px; }
.original-price { text-decoration: line-through; color: var(--text-muted); font-size: 0.9rem; }
.final-price { color: var(--primary); font-size: 1.3rem; font-weight: 900; }
.currency { font-size: 0.8rem; font-weight: normal; color: #94a3b8; }

.stock-warning-centered {
  color: #ef4444; background: rgba(239, 68, 68, 0.1);
  text-align: center; padding: 10px; border-radius: 12px; font-weight: bold; margin-bottom: 15px;
}

.product-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 15px; font-size: 0.85rem; }
.product-rating { display: flex; align-items: center; gap: 5px; color: #f59e0b; font-weight: bold; }
.stock-low { color: #f59e0b; }

.filter-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
  z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.filter-panel-overlay.open { opacity: 1; visibility: visible; }

.filter-panel {
  position: fixed; 
  top: 0; 
  bottom: 0; /* جایگزین height: 100vh */
  height: 100dvh; /* هماهنگی دقیق با صفحه گوشی در مرورگرهای جدید */
  right: -350px; 
  width: 320px;
  background: rgba(15, 23, 42, 0.95); 
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  z-index: 1001; 
  transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex; 
  flex-direction: column;
}
.filter-panel.open { right: 0; }

.filter-header { display: flex; justify-content: space-between; align-items: center; padding: 25px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 1.2rem; font-weight: bold; }
.close-filter-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

.filter-body { padding: 25px; flex: 1; overflow-y: auto; }
.filter-section { margin-bottom: 30px; }
.filter-section label { display: block; font-weight: bold; margin-bottom: 15px; color: var(--primary); }

.price-range { position: relative; height: 40px; }
.price-slider {
  position: absolute; width: 100%; appearance: none; background: transparent; pointer-events: none; top: 10px;
}
.price-slider::-webkit-slider-thumb {
  appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); cursor: pointer; pointer-events: auto;
}
.price-slider::-webkit-slider-runnable-track {
  width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px;
}
.price-values { display: flex; justify-content: space-between; font-size: 0.85rem; color: #94a3b8; margin-top: 10px; }
.price-tag { color: #fff; font-weight: bold; }

.category-item { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 12px; }
.category-item input { display: none; }
.checkmark { width: 20px; height: 20px; border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.category-item input:checked ~ .checkmark { background: var(--primary); border-color: var(--primary); }
.category-item input:checked ~ .checkmark::after { content: '✔'; color: #fff; font-size: 0.7rem; }

.filter-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 10px; }
.apply-filter-btn { 
  flex: 1; 
  padding: 12px; 
  background: var(--primary); 
  border: none; 
  border-radius: 12px; 
  color: #fff; 
  font-weight: bold; 
  cursor: pointer; 
  font-family: inherit;
}
.clear-filter-btn { padding: 12px 20px; background: rgba(255,255,255,0.05); border-radius: 12px; color: #fff; text-decoration: none; text-align: center; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-bottom: 40px; }
.page-link {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px;
  color: #fff; text-decoration: none; transition: 0.3s; font-weight: bold;
}
.page-link:hover { background: rgba(255,255,255,0.1); }
.page-link.active { background: var(--primary); border-color: var(--primary); }

.no-products { text-align: center; padding: 80px 20px; background: var(--glass-bg); border-radius: 24px; border: 1px solid var(--glass-border); }
.no-products .icon-wrapper { font-size: 4rem; color: #475569; margin-bottom: 20px; }
.reset-link { display: inline-block; margin-top: 20px; color: var(--primary); text-decoration: none; border: 1px solid var(--primary); padding: 8px 20px; border-radius: 50px; transition: 0.3s; }
.reset-link:hover { background: var(--primary); color: #fff; }

@media (max-width: 768px) {
  .glass-toolbar { flex-direction: column; align-items: stretch; }
  .actions { justify-content: space-between; }
}