.custom-catalog {
  display: flex;
  gap: 20px;
}

.catalog-sidebar {
  width: 33%;
  background: #fff;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 8px;
}

.catalog-products {
  flex: 1;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.product-card {
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.pagination ul {
  display: flex;
  list-style: none;
  gap: 10px;
  padding: 0;
}

.category-filters label {
  display: block;
  font-size: 14px;
  margin-bottom: 0px;
  cursor: pointer;
}

.category-filters input[type="checkbox"] {
  margin-right: 6px;
}

#price-slider {
  margin: 10px 0;
}
#price-range-label {
  font-weight: bold;
  margin-top: 5px;
  display: block;
}

.product-name{
    font-size: 15px;
    font-weight: bold;
}

.filter-group h4{
    font-size: 16px;
    font-weight: bold;
}

#price-slider .ui-slider-handle{
    border-radius: 100%;
    background-color: #2490EB;
}

.price{
    font-size: 20px;
    font-weight: bold;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Push elements apart */
  height: 100%; /* Ensure equal height cards */
  border: 1px solid #e5e5e5; /* optional, for layout clarity */
  padding: 12px; /* optional */
}

.product-add-to-cart {
  margin-top: auto; /* Forces it to stick at the bottom */
}

.catalog-sidebar {
	width: 33% !important;
}
.category-filters label {
	display: block !important;
}
input[type=checkbox]{
	height: auto !important;
}

.product-card a{
	height: 100%;
    display: flex
;
    flex-direction: column;
    justify-content: space-between;
}

.product-name{
    line-height: normal;
}

/* --- Responsive styles for mobile --- */
@media (max-width: 900px) {
  .custom-catalog {
    flex-direction: column;
    gap: 0;
  }
  .catalog-sidebar {
    width: 100% !important;
    margin-bottom: 20px;
    border-radius: 0 0 8px 8px;
    border-right: none;
    border-left: none;
    border-top: none;
  }
  .catalog-products {
    width: 100%;
  }
  .product-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .product-card {
    min-width: 0;
  }
}

/* Filter Drawer Styles */
.filter-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 340px;
  height: 100vh;
  background: #fff;
  z-index: 1002;
  box-shadow: 2px 0 16px rgba(0,0,0,0.12);
  transition: left 0.3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  padding: 24px 18px 18px 18px;
  border-radius: 0 12px 12px 0;
  display: block;
}

.filter-drawer.open {
  left: 0;
}

.filter-drawer-overlay {
  display: none;
  position: fixed;
  z-index: 1001;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
}

.filter-drawer.open ~ .filter-drawer-overlay,
.filter-drawer-overlay.active {
  display: block;
}

.close-filter-drawer {
  background: none;
  border: none;
  font-size: 2rem;
  position: absolute;
  top: 14px;
  right: 18px;
  cursor: pointer;
  z-index: 1003;
}

.open-filter-drawer {
  display: none;
  background: #2490EB;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 1rem;
  margin-bottom: 18px;
  cursor: pointer;
}

/* Desktop: Sidebar always visible, drawer/overlay hidden */
@media (min-width: 901px) {
  .catalog-sidebar {
    display: block !important;
    position: static !important;
    width: 33% !important;
    height: auto !important;
    box-shadow: none !important;
    border-radius: 8px !important;
    left: 0 !important;
    transition: none !important;
    z-index: 1 !important;
  }
  .filter-drawer-overlay,
  .close-filter-drawer,
  .open-filter-drawer {
    display: none !important;
  }
}

/* Mobile: Sidebar hidden, drawer/overlay enabled */
@media (max-width: 900px) {
  .catalog-sidebar {
    display: none !important;
  }
  .filter-drawer {
    display: block !important;
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 340px;
    height: 100vh;
    background: #fff;
    z-index: 1002;
    box-shadow: 2px 0 16px rgba(0,0,0,0.12);
    transition: left 0.3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    padding: 24px 18px 18px 18px;
    border-radius: 0 12px 12px 0;
  }
  .filter-drawer.open {
    left: 0;
  }
  .filter-drawer-overlay {
    display: none;
    position: fixed;
    z-index: 1001;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
  }
  .filter-drawer.open ~ .filter-drawer-overlay,
  .filter-drawer-overlay.active {
    display: block;
  }
  .close-filter-drawer {
    display: block !important;
    background: none;
    border: none;
    font-size: 2rem;
    position: absolute;
    top: 14px;
    right: 18px;
    cursor: pointer;
    z-index: 1003;
  }
  .open-filter-drawer {
    display: block !important;
    background: #2490EB;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 1rem;
    margin-bottom: 18px;
    cursor: pointer;
  }
}