/* ============================================================
   MON TEX GRASS — Products Styles
   نسخه بازنویسی‌شده و بهینه
   شامل:
   ۱) صفحه لیست محصولات (products.php)
   ۲) صفحات دسته‌بندی (sport / decor / balcony / wall / pet)
   ============================================================ */


/* ============================================================
   ۰) محافظت سراسری — جلوگیری از سرریز افقی
   ============================================================ */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

.products-layout,
.products-layout > *,
.products-grid,
.products-grid > *,
.product-card,
.product-card * {
  min-width: 0;
}


/* ============================================================
   ۱) HERO صفحه لیست محصولات (بالای products.php)
   ============================================================ */
.products-hero {
  background: linear-gradient(135deg, #eaf7ee, #f8fcf9);
  border-bottom: 1px solid var(--green-border);
  padding: 32px 0 28px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.breadcrumb a:hover { color: var(--green); }
.breadcrumb span   { color: var(--green); margin: 0 6px; }

.products-hero h1 {
  font-size: clamp(19px, 3.2vw, 32px);
  color: var(--green-dark);
  line-height: 1.5;
  margin-bottom: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.products-hero .lead {
  color: var(--muted);
  font-size: 15px;
  max-width: 900px;
  margin-bottom: 16px;
}
.products-hero .lead a {
  color: var(--green);
  font-weight: 800;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-stat {
  background: var(--white);
  border: 1px solid var(--green-border);
  border-radius: 11px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--green-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}


/* ============================================================
   ۲) چیدمان صفحه لیست محصولات (Layout)
   ============================================================ */
.products-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 24px 0 70px;
  width: 100%;
  max-width: 100%;
}

.products-layout > main {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}


/* ============================================================
   ۳) سایدبار فیلتر
   ============================================================ */
.filter-sidebar {
  background: var(--white);
  border: 1px solid #e3ede6;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef4f0;
  margin-bottom: 14px;
}
.filter-head h3 {
  font-size: 16px;
  color: var(--green-dark);
}
.close-filter {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  color: var(--muted);
  padding: 4px 8px;
}

.filter-group {
  padding: 14px 0;
  border-top: 1px dashed #e6efe9;
}
.filter-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.filter-label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.filter-sidebar input[type=search],
.filter-sidebar select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe8df;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: #fbfdfb;
  color: var(--text);
  outline: none;
  transition: .2s;
  max-width: 100%;
}
.filter-sidebar input[type=search]:focus,
.filter-sidebar select:focus {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(30, 122, 60, .08);
}

.filter-checks { display: grid; gap: 8px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: #3d4f44;
  cursor: pointer;
  padding: 4px 0;
  min-width: 0;
}
.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
  cursor: pointer;
  flex-shrink: 0;
}
.check-row > span:first-of-type {
  overflow-wrap: anywhere;
  min-width: 0;
}
.check-row .cnt {
  margin-inline-start: auto;
  font-size: 11.5px;
  color: #9aab9f;
  background: #f4f7f4;
  padding: 1px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.reset-filters {
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: .2s;
}
.reset-filters:hover { background: #fdefd7; }


/* ============================================================
   ۴) تب‌های دسته اصلی
   ============================================================ */
.main-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  max-width: 100%;
}
.main-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: var(--white);
  border: 1px solid #e3ede6;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #41544a;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: .2s;
  flex-shrink: 0;
  scroll-snap-align: start;
}
.tab-btn .badge {
  font-size: 11.5px;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 1px 8px;
  border-radius: 20px;
  font-weight: 700;
}
.tab-btn:hover { border-color: var(--green-border); }
.tab-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}
.tab-btn.active .badge {
  background: rgba(255, 255, 255, .22);
  color: var(--white);
}


/* ============================================================
   ۵) چیپ‌های زیردسته (مشترک بین محصولات و دسته‌بندی‌ها)
   ============================================================ */
.sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
  max-width: 100%;
}
.chip {
  background: var(--white);
  border: 1px solid #e3ede6;
  border-radius: 20px;
  padding: 7px 15px;
  font-size: 13px;
  color: #4b5f53;
  cursor: pointer;
  transition: .2s;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.chip .badge {
  font-size: 11px;
  color: #9aab9f;
}
.chip:hover {
  border-color: var(--green-border);
  background: #fafffb;
}
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 700;
}
.chip.active .badge { color: rgba(255, 255, 255, .8); }


/* ============================================================
   ۶) نوار ابزار (Toolbar)
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid #e3ede6;
  border-radius: 12px;
  padding: 11px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
}
.result-count {
  font-size: 13.5px;
  color: var(--muted);
}
.result-count b {
  color: var(--green-dark);
  font-weight: 700;
}
.toolbar select {
  margin-inline-start: auto;
  padding: 9px 13px;
  border: 1px solid #dbe8df;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fbfdfb;
  outline: none;
  cursor: pointer;
  max-width: 100%;
}
.filter-toggle {
  display: none;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  color: var(--green-dark);
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}


/* ============================================================
   ۷) گرید محصولات
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed var(--green-border);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.empty-state a {
  color: var(--green);
  font-weight: 800;
}


/* ============================================================
   ۸) کارت محصول
   ============================================================ */
.product-card {
  background: var(--white);
  border: 1px solid #e3ede6;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .28s, transform .28s, border-color .28s;
  box-shadow: 0 2px 10px rgba(18, 82, 40, .05);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-border);
}

.product-image-link {
  display: block;
  width: 100%;
  min-width: 0;
}
.product-image {
  position: relative;
  height: 170px;
  overflow: hidden;
  background-color: #2e8b57;
  background-image:
    repeating-linear-gradient(78deg, rgba(255, 255, 255, .09) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-78deg, rgba(0, 0, 0, .10) 0 2px, transparent 2px 8px),
    linear-gradient(170deg, var(--c1, #4caf50), var(--c2, #1b5e20));
  width: 100%;
}
.product-image.t-decor { --c1: #4caf50; --c2: #1b5e20; }
.product-image.t-sport { --c1: #43a047; --c2: #0f3d21; }
.product-image.t-pet   { --c1: #66bb6a; --c2: #2e7d32; }
.product-image.t-roof  { --c1: #26a69a; --c2: #00695c; }
.product-image.t-acc   { --c1: #a1887f; --c2: #4e342e; }
.product-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.product-image img.loaded { display: block; }

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, .94);
  color: #14532d;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 2;
}
.product-badge.featured { background: var(--accent); color: #fff; }

.product-code {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, .42);
  color: var(--white);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: monospace;
  direction: ltr;
  z-index: 2;
}

.product-content {
  padding: 14px 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.product-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.6;
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.product-title:hover { color: var(--green); }

.product-features {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  max-width: 100%;
}
.product-features li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #eef4f0;
  min-width: 0;
  max-width: 100%;
}
.product-features li span {
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.product-features li b {
  font-weight: 600;
  color: #2f4237;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  min-width: 0;
}

.price-box {
  background: var(--green-light);
  border: 1px dashed var(--green-border);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 12.5px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.price-box .p-title {
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
  font-size: 12.5px;
}
.price-box .p-range {
  display: block;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.price-box .p-range b {
  color: #b45309;
  font-weight: 800;
}
.price-box .p-note {
  color: var(--warn);
  font-size: 11px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}


/* ============================================================
   ۹) دکمه‌های کارت و عمومی
   ============================================================ */
.product-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.btn-buy {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  background: var(--green);
  color: var(--white);
  padding: 11px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13.5px;
  transition: .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.btn-buy:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}
.btn-buy svg { flex-shrink: 0; }

.btn-wa {
  flex: 0 0 44px;
  width: 44px;
  display: grid;
  place-items: center;
  background: #e7f8ee;
  color: #128c4a;
  border-radius: 11px;
  font-size: 18px;
  transition: .2s;
}
.btn-wa:hover { background: #25d366; color: var(--white); }

.btn-outline {
  display: block;
  text-align: center;
  background: var(--white);
  border: 1.5px solid var(--green);
  color: var(--green);
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13px;
  margin-top: auto;
  transition: .2s;
}
.btn-outline:hover {
  background: var(--green);
  color: var(--white);
}


/* ============================================================
   ۱۰) دکمه "بیشتر" و CTA
   ============================================================ */
.more-wrap,
.featured-cta {
  text-align: center;
  margin-top: 30px;
}

.btn-more {
  display: inline-block;
  background: var(--white);
  border: 1.5px solid var(--green);
  color: var(--green);
  padding: 13px 34px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
  max-width: 100%;
}
.btn-more:hover {
  background: var(--green);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(30, 122, 60, .25);
}


/* ============================================================
   ۱۱) HERO صفحات دسته‌بندی (Sport / Decor / Balcony / Wall / Pet)
   ============================================================ */
.page-hero {
  position: relative;
  padding: 80px 0 70px;
  background-color: #0f3d21;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

/* لایه تصویر پس‌زمینه (برای پارالاکس) */
.page-hero::before {
  content: '';
  position: absolute;
  inset: -15% 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, var(--parallax-y, 0px), 0);
  transition: transform .05s linear;
}

/* لایه تیره — پوشش کامل چپ به راست */
.page-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg,
            rgba(10, 40, 20, .62) 0%,
            rgba(10, 40, 20, .68) 50%,
            rgba(10, 40, 20, .62) 100%);
}
.page-hero-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, .15) 100%
  );
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

/* تصاویر Hero برای هر صفحه (روی ::before) */
.page-hero-sport::before   { background-image: url('../images/hero-sport.jpg'); }
.page-hero-decor::before   { background-image: url('../images/hero-decor.jpg'); }
.page-hero-balcony::before { background-image: url('../images/hero-balcony.jpg'); }
.page-hero-wall::before    { background-image: url('../images/hero-wall.jpg'); }
.page-hero-pet::before     { background-image: url('../images/hero-pet.jpg'); }

/* Breadcrumb داخل Hero */
.page-hero .breadcrumb {
  color: rgba(255, 255, 255, .75);
  margin-bottom: 14px;
  font-size: 13px;
}
.page-hero .breadcrumb a       { color: rgba(255, 255, 255, .9); }
.page-hero .breadcrumb a:hover { color: #a8e6a5; }
.page-hero .breadcrumb span    { color: #a8e6a5; margin: 0 6px; }

/* عنوان و لید */
.page-hero-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 16px;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .35);
  max-width: 800px;
}
.page-hero-title .highlight {
  background: linear-gradient(135deg, #a8e6a5, #4caf50);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-hero-lead {
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.9;
  color: #d8f0e0;
  max-width: 780px;
  margin-bottom: 26px;
}

.page-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* آمار Hero */
.page-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  max-width: 800px;
}
.stat-box {
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  transition: transform .25s ease, background .25s ease;
}
.stat-box:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, .16);
}
.stat-box strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #a8e6a5;
  margin-bottom: 4px;
  line-height: 1.2;
}
.stat-box span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .85);
}


/* ============================================================
   ۱۲) بخش‌های صفحه دسته‌بندی (Uses / Specs / Care / Related)
   ============================================================ */

/* --- بخش کاربردها (Uses) --- */
.uses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 18px;
}
.use-card {
  background: linear-gradient(160deg, #f8fcf9, #eaf7ee);
  border: 1px solid var(--green-border);
  border-radius: 14px;
  padding: 26px 22px;
  text-align: center;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.use-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}
.use-icon {
  font-size: 42px;
  margin-bottom: 14px;
  line-height: 1;
  display: block;
}
.use-card h3 {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 8px;
  line-height: 1.4;
}
.use-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  margin: 0;
}

/* --- جدول مشخصات --- */
.specs-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e3ede6;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.specs-table {
  width: 100%;
  border-collapse: collapse;
 /* min-width: 600px;*/
}
.specs-table thead {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}
.specs-table th {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 16px 18px;
  text-align: right;
}
.specs-table td {
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid #eef4f0;
}
.specs-table tbody tr:last-child td { border-bottom: 0; }
.specs-table tbody tr:nth-child(even) { background: #f8fcf9; }
.specs-table tbody tr:hover { background: var(--green-light); }
.specs-table strong {
  color: var(--green-dark);
  font-weight: 700;
}

/* --- دسته‌های مرتبط --- */
.related-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}
.related-cat-card {
  background: linear-gradient(160deg, #f8fcf9, #eaf7ee);
  border: 1px solid var(--green-border);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  transition: .28s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.related-cat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}
.related-cat-icon {
  font-size: 40px;
  margin-bottom: 12px;
  line-height: 1;
}
.related-cat-card h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 6px;
}
.related-cat-card p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}


/* ============================================================
   ۱۳) رنگ‌بندی بخش‌های اختصاصی هر صفحه دسته‌بندی
   ============================================================ */

/* Sport */
.sport-benefits { background: var(--bg); }
.sport-specs    { background: var(--white); }
.sport-install  { background: var(--bg); }

/* Decor */
.decor-benefits { background: var(--bg); }
.decor-uses     { background: var(--white); }
.decor-guide    { background: var(--bg); }
.decor-care     { background: var(--white); }

/* Balcony */
.balcony-benefits { background: var(--bg); }
.balcony-specs    { background: var(--white); }
.balcony-uses     { background: var(--bg); }
.balcony-install  { background: var(--white); }

/* Wall */
.wall-benefits { background: var(--bg); }
.wall-specs    { background: var(--white); }
.wall-uses     { background: var(--bg); }
.wall-install  { background: var(--white); }

/* Pet */
.pet-benefits { background: var(--bg); }
.pet-specs    { background: var(--white); }
.pet-uses     { background: var(--bg); }
.pet-care     { background: var(--white); }

/* Related categories */
.related-categories { background: var(--white); }


/* ============================================================
   ۱۴) پارالاکس Hero صفحه اصلی (index.php)
   ============================================================ */
.hero-bg {
  will-change: transform;
  transform: translate3d(0, var(--parallax-y, 0px), 0);
  transition: transform .05s linear;
}


/* ============================================================
   ۱۵) ریسپانسیو — Mobile First (یکپارچه)
   ============================================================ */

/* --- موبایل بزرگ (۳۸۰px به بالا): ۲ ستونه --- */
@media (min-width: 380px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* --- تبلت (۶۴۰px به بالا) --- */
@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }
}

/* --- دسکتاپ (۱۰۲۴px به بالا) --- */
@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
  }
}

/* --- سایدبار off-canvas (زیر ۹۸۰px) --- */
@media (max-width: 980px) {
  .products-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 16px 0 60px;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(330px, 88vw);
    z-index: 120;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform .3s, visibility .3s;
    max-height: none;
    overflow-y: auto;
    visibility: hidden;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
  }
  .filter-sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .close-filter  { display: block; }
  .filter-toggle { display: inline-block; }
}

/* --- تبلت کوچک و موبایل بزرگ (زیر ۷۶۸px) --- */
@media (max-width: 768px) {
  /* Hero صفحات دسته‌بندی */
  .page-hero {
    padding: 56px 0 48px;
  }
  .page-hero::before {
    inset: 0;
    transform: none !important;
  }
  .page-hero-actions {
    flex-direction: column;
  }
  .page-hero-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .page-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-box { padding: 12px; }
  .stat-box strong { font-size: 18px; }
  .stat-box span   { font-size: 11.5px; }

  /* جدول مشخصات */
  .specs-table th,
  .specs-table td {
    padding: 12px 14px;
    font-size: 12.5px;
  }

  /* دسته‌های مرتبط */
  .related-cats-grid { gap: 12px; }
  .related-cat-card  { padding: 20px 16px; }
  .related-cat-icon  { font-size: 34px; }

  /* کاربردها */
  .uses-grid { gap: 12px; }
  .use-card  { padding: 20px 16px; }
  .use-icon  { font-size: 34px; margin-bottom: 10px; }
  .use-card h3 { font-size: 14px; }
  .use-card p  { font-size: 12px; }

  /* غیرفعال کردن پارالاکس در موبایل */
  .hero-bg { transform: none !important; }
}

/* --- موبایل کوچک (زیر ۴۸۰px) --- */
@media (max-width: 480px) {
  /* Hero صفحه لیست */
  .products-hero           { padding: 22px 0 20px; }
  .products-hero h1        { font-size: 18px; }
  .products-hero .lead     { font-size: 13.5px; }
  .hero-stat               { font-size: 11.5px; padding: 6px 11px; }

  /* Hero صفحات دسته‌بندی */
  .page-hero               { padding: 44px 0 40px; }
  .page-hero-title         { font-size: 22px; }
  .page-hero-lead          { font-size: 13.5px; }
  .stat-box strong         { font-size: 16px; }
  .stat-box span           { font-size: 10.5px; }

  /* کارت محصول */
  .product-image           { height: 130px; }
  .product-content         { padding: 10px; gap: 8px; }
  .product-title           { font-size: 12.5px; line-height: 1.55; }
  .product-features        { font-size: 11px; }
  .product-features li     { padding-bottom: 3px; gap: 6px; }
  .price-box               { padding: 8px 9px; font-size: 11px; }
  .price-box .p-title      { font-size: 10.5px; }
  .price-box .p-range      { font-size: 11px; }
  .price-box .p-note       { font-size: 9.5px; }
  .btn-buy                 { font-size: 11.5px; padding: 9px 4px; gap: 4px; }
  .btn-wa                  { flex-basis: 34px; width: 34px; font-size: 14px; }
  .product-code            { font-size: 9.5px; padding: 2px 6px; }
  .product-badge           { font-size: 9.5px; padding: 2px 7px; }

  /* نوار ابزار */
  .toolbar                 { padding: 10px 12px; gap: 8px; }
  .toolbar select          { width: 100%; margin-inline-start: 0; }

  /* تب و چیپ */
  .tab-btn { font-size: 13px; padding: 9px 13px; }
  .chip    { font-size: 11.5px; padding: 5px 11px; }

  /* کاربردها — ۲ ستونه */
  .uses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .use-card  { padding: 16px 12px; }
  .use-icon  { font-size: 28px; }
  .use-card h3 { font-size: 12.5px; }
  .use-card p  { font-size: 11px; }
}

/* --- موبایل خیلی کوچک (زیر ۳۸۰px) — تک‌ستونه --- */
@media (max-width: 379px) {
  .products-grid          { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .product-image          { height: 170px; }
  .product-title          { font-size: 13.5px; }
  .product-features       { font-size: 12px; }
  .product-features li    { padding-bottom: 4px; gap: 8px; }
  .price-box              { font-size: 11.5px; padding: 10px 11px; }
  .btn-buy                { font-size: 12.5px; padding: 10px; gap: 6px; }
  .btn-wa                 { flex-basis: 40px; width: 40px; }
}

/* --- احترام به prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  .page-hero::before,
  .hero-bg {
    transform: none !important;
    transition: none !important;
  }
}