
.page-container {
  display: flex;
  align-items: flex-start;
  /* padding: 20px; */
  gap: 20px;
}

/* سایدبار دسکتاپ */
.sidebar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 20px;
  width: 270px;
  position: sticky;
  top: 20px;
  height: fit-content;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  z-index: 1;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #c5c5c5 #f1f1f1; /* thumb / track */
}
/* Chrome, Edge, Safari */
.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #c0c0c0;
  border-radius: 10px;
  border: 2px solid #f5f5f5;
  transition: background-color 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: #a0a0a0;
}

/* Optional smooth scrolling behavior */
.sidebar {
  scroll-behavior: smooth;
}

/* ناحیه محصولات */
.products-area {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 20px;
  min-height: 80vh;
  z-index: 1;
  width: 100%;
  position: relative;
}

/* برچسب‌های فعال */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}
.filter-tag {
  background: #e5e7eb;
  color: #374151;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}
.filter-tag:hover { background: #d1d5db; }
.filter-tag span { margin-right: 5px; font-weight: bold; }

/* گروه فیلترها */
.filter-group {
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f1f1;
  padding-bottom: 8px;
}
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 6px 0;
  font-weight: 600;
  transition: color 0.2s;
}
.filter-header:hover { color: #0d6efd; }
.filter-content {
  display: none;
  padding-right: 10px;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from {opacity: 0; transform: translateY(-4px);}
  to {opacity: 1; transform: translateY(0);}
}
.icon { transition: transform 0.2s; font-size: 12px; }
.filter-header.open .icon { transform: rotate(180deg); }

.filter-item { margin: 4px 0; }
label { font-weight: normal; cursor: pointer; }
.subcategories {
  padding-right: 15px;
  margin-top: 5px;
  border-right: 1px dashed #e5e7eb;
}
.filter-content.open-default { display: block !important; }

/* سوئیچ‌ها */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}
.switch input { display: none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #d1d5db;
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: #0d6efd; }
input:checked + .slider:before { transform: translateX(16px); }

/* دکمه شناور موبایل */
.filter-btn-mobile {
  display: none;
  position: fixed;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #0d6efd;
  color: white;
  border-radius: 9999px;
  width: 46px;
  height: 46px;
  /* display: flex; */
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1100;
  cursor: pointer;
  transition: background 0.2s;
}
.filter-btn-mobile:hover { background: #0b5ed7; }

/* سایدبار کشویی موبایل */
.sidebar-drawer {
  position: fixed;
  left: 0; right: 0; bottom: -100%;
  height: 80%;
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  z-index: 1200;
  padding: 20px;
  overflow-y: auto;
  transition: bottom 0.35s ease;
}
.sidebar-drawer.active { bottom: 0; }

/* دکمه بستن کشو */
.drawer-close {
  position: absolute;
  left: 15px;
  top: 15px;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}
.drawer-close:hover { color: #111827; }

/* پس‌زمینه تار */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  z-index: 1150;
  display: none;
}
.overlay.active { display: block; }

/* ریسپانسیو */
@media (max-width: 992px) {
  .page-container { flex-direction: column; }
  .sidebar { display: none; }
  .filter-btn-mobile { display: flex; }
}

/* نوار بالای محصولات */
.products-toolbar {
margin-bottom: 15px;
display: flex;
flex-direction: column;
gap: 10px;
}

/* جعبه جستجو */
.search-box {
position: relative;
}
.search-box .glyphicon {
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
color: #9ca3af;
}
.search-box input {
padding-right: 34px;
border-radius: 9999px;
border: 1px solid #e5e7eb;
box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
transition: all 0.2s;
}
.search-box input:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 2px rgba(13,110,253,0.2);
}

/* مرتب‌سازی */
.sort-box {
display: flex;
align-items: center;
gap: 6px;
justify-content: flex-end;
}
.sort-box .glyphicon {
color: #6b7280;
}
.sort-box select {
border-radius: 9999px;
border: 1px solid #e5e7eb;
padding: 6px 26px 6px 12px;
font-size: 13px;
background-color: #fff;
transition: border 0.2s;
}
.sort-box select:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 2px rgba(13,110,253,0.2);
}

/* موبایل */
@media (max-width: 767px) {
.sort-box {
justify-content: flex-start;
/* margin-top: 10px; */
}
}
.price-range {
position: relative;
width: 100%;
margin-top: 10px;
height: 50px;
}

.price-range input[type=range] {
position: absolute;
width: 100%;
pointer-events: none;
appearance: none;
height: 6px;
border-radius: 5px;
background: transparent;
top: 29px;
}

/* نوار زمینه (track) بین دو مقدار */
.price-track {
position: absolute;
height: 6px;
border-radius: 5px;
background: #e5e7eb;
top: 26px;
left: 0;
right: 0;
}

.price-track::before {
content: "";
position: absolute;
height: 6px;
border-radius: 5px;
background: #0d6efd;
left: 0;
right: 0;
width: 0%;
}

/* Thumb‌ها */
.price-range input[type=range]::-webkit-slider-thumb {
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: #0d6efd;
cursor: pointer;
pointer-events: all;
transition: transform 0.2s;
margin-top: -6px;
}

.price-range input[type=range]::-webkit-slider-thumb:hover {
transform: scale(1.15);
}

/* مقادیر نمایش عددی */
.price-values {
display: flex;
justify-content: space-between;
margin-top: 38px;
font-size: 13px;
color: #374151;
font-weight: 600;
direction: ltr;
}





/* === نوار بالای محصولات === */
.product-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
flex-wrap: wrap;
gap: 10px;
}

.search-box {
position: relative;
flex: 1;
min-width: 250px;
}
.search-box input {
border-radius: 9999px;
padding-right: 35px;
border: 1px solid #d1d5db;
transition: border-color 0.2s;
}
.search-box input:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
}
.search-box .glyphicon-search {
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
color: #9ca3af;
}

.sort-box {
position: relative;
width: 200px;
}
.sort-box select {
border-radius: 9999px;
padding-left: 30px;
border: 1px solid #d1d5db;
transition: border-color 0.2s;
}
.sort-box select:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 2px rgba(13,110,253,0.15);
}
.sort-box .glyphicon-sort {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #9ca3af;
}

/* === کارت‌های محصولات === */
.product-list  {
  display: flex;
}




.product-list .colproduct{
  display: grid;
  flex-direction: column;
  justify-content: space-between;
  /* width: 100%;
  height: 100%; 👈 اضافه شد */
}

.product-card {
background: #fff;
border-radius: 12px;

border-radius: 10px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
padding: 0;
margin-bottom: 20px;
transition: transform 0.2s, box-shadow 0.2s;
cursor: pointer;
}
.product-card .descbox{
  padding: 15px;
}
.product-card:hover {
transform: translateY(-4px);
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product-image {
  width: 100%;
  overflow: hidden;
}

.product-image img {
  display: block;
  width: 100%;
  height: auto; /* 👈 ارتفاع متناسب با عرض */
  border-bottom: 1px solid #f0f0f0;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05); /* افکت ملایم */
}
.product-title {
font-size: 15px;
font-weight: 600;
margin-top: 10px;
color: #111827;
line-height: 1.4;
height: 40px; /* دو خط */
overflow: hidden;
position: relative;
}
.product-title::after {
content: "";
position: absolute;
bottom: 0;
right: 0;
width: 100%;
height: 15px;
background: linear-gradient(to top, #fff, transparent);
}
.product-desc {
font-size: 13px;
color: #6b7280;
margin: 5px 0 10px;
height: 40px;
overflow: hidden;
position: relative;
}
.product-desc::after {
content: "";
position: absolute;
bottom: 0;
right: 0;
width: 100%;
height: 15px;
background: linear-gradient(to top, #fff, transparent);
}

.product-price {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.old-price {
color: #9ca3af;
text-decoration: line-through;
font-size: 13px;
}
.new-price {
color: #0d6efd;
font-weight: 700;
font-size: 15px;
}
.product-list {
display: flex;
flex-wrap: wrap;
flex-wrap: wrap;
  align-items: stretch; /* ⬅️ باکس‌ها هم‌ارتفاع می‌شن */
  gap: 1rem; /* فاصله بین باکس‌ها */
}


.apply-price-btn {
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
  transition: background-color 0.3s ease;
}

.apply-price-btn:hover {
  background-color: #0b5ed7;
}