.cpg-shop-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow-x: hidden;
   position: relative;       /* new */
  isolation: isolate;        /* new */
  z-index: 1;    
}
.cpg-shop-header {
  margin-bottom: 40px;
}
.cpg-shop-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}
.cpg-shop-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}
.cpg-shop-title {
  font-size: 36px !important;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 !important;
  line-height: 1.2 !important;
}
.cpg-shop-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}
.cpg-products-count {
  font-size: 14px;
  color: #5f6368;
  font-weight: 400;
  display: block;
  margin-top: 4px;
}
.cpg-sort-select {
  padding: 0 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 50px;
  background: #fff;
  color: #2c3e50;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
  height: 44px;
  appearance: auto;
}
.cpg-sort-select:hover {
  border-color: #f15a28;
  box-shadow: 0 2px 8px rgba(241, 90, 40, 0.1);
}
.cpg-sort-select:focus {
  outline: 0;
  border-color: #f15a28;
  box-shadow: 0 0 0 3px rgba(241, 90, 40, 0.2);
}
.cpg-shop-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
  min-width: 0;
  width: 100%;
}
.cpg-shop-sidebar {
  position: sticky;
  top: 20px;
  background: transparent;
  min-width: 0;
  width: 100%;
}
.cpg-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 0;
}
.cpg-filters-header h3 {
  font-size: 18px !important;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 !important;
}
.cpg-clear-filters {
  font-size: 12px;
  color: #f15a28;
  text-decoration: none;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0;
  transition: color 0.3s ease;
  cursor: pointer;
}
.cpg-clear-filters:hover {
  color: #d84315;
}
.cpg-filter-group {
  margin-bottom: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}
.cpg-filter-group:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.cpg-filter-group:last-child {
  margin-bottom: 0;
}
.cpg-filter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 16px !important;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 !important;
  padding: 0;
  transition: color 0.3s ease;
  user-select: none;
}
.cpg-filter-title:hover {
  color: #f15a28;
}
.cpg-filter-title span:first-child {
  flex: 1;
}
.cpg-filter-toggle {
  display: inline-block;
  font-size: 16px;
  color: #bdc3c7;
  transition: transform 0.3s ease;
  font-weight: 400;
  margin-left: 12px;
}
.cpg-filter-group.active .cpg-filter-toggle {
  transform: rotate(45deg);
}
.cpg-filter-content {
  margin-top: 12px;
  max-height: 1000px;
  overflow: visible;
  transition: all 0.3s ease;
  animation: slideDown 0.3s ease;
}
.cpg-filter-group:not(.active) .cpg-filter-content {
  display: none;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cpg-filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cpg-filter-list li {
  margin-bottom: 12px;
}
.cpg-filter-list li:last-child {
  margin-bottom: 0;
}
.cpg-filter-list label {
  display: flex;
  align-items: center;
  width: 100%;
}
.cpg-filter-count {
  color: #95a5a6;
  font-size: 13px;
  margin-left: 4px;
  font-weight: 400;
}
.cpg-filter-list label:hover {
  color: #f15a28;
}
.cpg-filter-list label:hover input[type="checkbox"] {
  accent-color: #f15a28;
}
.cpg-filter-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: #2c3e50;
  border-radius: 3px;
  transition: accent-color 0.3s ease;
}
.cpg-price-range-slider {
  position: relative;
  margin-bottom: 18px;
  height: 6px;
}
.cpg-price-input {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 3px;
  background: #e0e0e0;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}
.cpg-price-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0097a7;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 8px rgba(0, 151, 167, 0.4);
  transition: all 0.3s ease;
}
.cpg-price-input::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 151, 167, 0.6);
}
.cpg-price-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0097a7;
  cursor: pointer;
  pointer-events: all;
  border: 0;
  box-shadow: 0 2px 8px rgba(0, 151, 167, 0.4);
  transition: all 0.3s ease;
}
.cpg-price-input::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 151, 167, 0.6);
}
#cpg-price-min {
  z-index: 5;
}
#cpg-price-max {
  z-index: 4;
}
.cpg-price-display {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #2c3e50;
  background: transparent;
  padding: 12px 0 0 0;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.cpg-price-display span:first-child {
  color: #5f6368;
  font-weight: 400;
}
.cpg-price-display span:last-child {
  color: #f15a28;
  font-weight: 600;
}
.cpg-shop-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
    position: relative;       /* new */
  z-index: 1; 
}
.cpg-shop-main.cpg-full-width {
  grid-column: 1 / -1;
}
.cpg-no-products {
  text-align: center;
  padding: 60px 40px;
  font-size: 16px;
  color: #95a5a6;
  background: #f8f8f8;
  border-radius: 12px;
  margin: 0;
}
#cpg-products-container.cpg-grid {
  display: grid !important;
  gap: 24px;
  width: 100%;
  min-width: 0;
  margin-bottom: 40px;
  grid-template-columns: repeat(3, 1fr);
    position: relative;       /* new */
  z-index: 1;  
}
.cpg-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #f0f0f0;
}
.cpg-pagination ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.cpg-pagination li {
  margin: 0;
}
.cpg-pagination a,
.cpg-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  text-decoration: none;
  transition: all 0.3s ease;
}
.cpg-pagination a:hover {
  border-color: #f15a28;
  color: #f15a28;
  background: rgba(241, 90, 40, 0.05);
}
.cpg-pagination .current,
.cpg-pagination span.page-numbers {
  background: #f15a28;
  color: #fff;
  border-color: #f15a28;
}
.cpg-pagination .page-numbers.dots {
  border: 0;
  cursor: default;
}
.cpg-pagination .prev,
.cpg-pagination .next {
  width: auto;
  padding: 0 16px;
  font-size: 13px;
}
@media (max-width: 1024px) {
  .cpg-shop-container {
    grid-template-columns: 240px 1fr;
    gap: 24px;
  }
  #cpg-products-container.cpg-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cpg-shop-title {
    font-size: 28px !important;
  }
}
@media (max-width: 768px) {
  .cpg-shop-wrapper {
    padding: 30px 16px;
  }
  .cpg-shop-header-top {
    flex-wrap: wrap;
    gap: 12px;
  }
  .cpg-shop-title-group {
    flex: 1 1 100%;
    min-width: 0;
  }
  .cpg-shop-controls {
    flex: 1 1 100%;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
  }
  .cpg-sort-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 140px;
  }
  .cpg-shop-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cpg-shop-sidebar {
    position: relative;
    top: 0;
    width: 100%;
  }
  #cpg-products-container.cpg-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .cpg-shop-title {
    font-size: 24px;
  }
  .cpg-filter-group {
    margin-bottom: 16px;
    padding: 16px;
  }
  .cpg-filter-title {
    font-size: 15px !important;
  }
  .cpg-filter-list label {
    font-size: 14px;
  }
}
@media (max-width: 600px) {
  .cpg-shop-wrapper {
    padding: 20px 12px;
  }
  .cpg-shop-title {
    font-size: 22px;
  }
  .cpg-sort-select {
    font-size: 13px;
    padding: 8px 12px;
  }
  .cpg-products-count {
    font-size: 13px;
  }
  .cpg-filters-header h3 {
    font-size: 16px;
  }
  .cpg-filter-group {
    margin-bottom: 12px;
    padding: 14px;
  }
  .cpg-filter-title {
    font-size: 14px !important;
  }
  .cpg-filter-list label {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .cpg-filter-list input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-right: 10px;
  }
  .cpg-price-display {
    font-size: 12px;
    padding: 10px 0 0 0;
  }
  .cpg-pagination a,
  .cpg-pagination span {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  .cpg-pagination .prev,
  .cpg-pagination .next {
    padding: 0 12px;
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  #cpg-products-container.cpg-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
@media (max-width: 380px) {
  .cpg-shop-title {
    font-size: 18px;
  }
  .cpg-filter-group {
    padding: 12px;
    margin-bottom: 10px;
  }
  .cpg-sort-select {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 120px;
  }
  .cpg-pagination a,
  .cpg-pagination span {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
}
/* Fix for very small screens (320px) */
@media (max-width: 360px) {
  .cpg-shop-wrapper {
    padding: 12px 8px;
  }
  .cpg-shop-title {
    font-size: 16px !important;
    word-break: break-word;
  }
  .cpg-products-count {
    font-size: 12px;
  }
  .cpg-sort-select {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 8px 10px;
  }
  .cpg-filter-toggle-btn {
    width: 100%;
    justify-content: center;
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
  .cpg-shop-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #cpg-products-container.cpg-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .cpg-pagination a,
  .cpg-pagination span {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }
  .cpg-pagination .prev,
  .cpg-pagination .next {
    padding: 0 8px;
    font-size: 11px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cpg-filter-group:focus-within {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.cpg-filter-list input[type="checkbox"]:focus {
  outline: 2px solid #f15a28;
  outline-offset: 2px;
}
.cpg-sort-select:focus-visible {
  outline: 2px solid #f15a28;
  outline-offset: 2px;
}
.cpg-shop-container {
  min-width: 0;
  /* Removed overflow:hidden — it clips sticky sidebar and filter drawer.
     Removed scroll-behavior:smooth — it caused unexpectedly fast page jumps. */
}
.cpg-filter-toggle {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}
/* =====================================================
   SEARCH INPUT
   ===================================================== */
.cpg-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 140px;
  max-width: 280px;
}
.cpg-search-input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 38px;
  border: 1.5px solid #e0e0e0;
  border-radius: 50px;
  background: #fff;
  color: #2c3e50;
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
}
.cpg-search-input:focus {
  border-color: #f15a28;
  box-shadow: 0 0 0 3px rgba(241, 90, 40, 0.15);
}
.cpg-search-input::placeholder {
  color: #aaa;
  font-size: 13px;
}
.cpg-search-icon {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  stroke: #aaa !important;
  fill: none !important;
  pointer-events: none !important;
  flex-shrink: 0 !important;
  display: block !important;
  overflow: hidden !important;
  z-index: 1;
}
/* =====================================================
   OFF-CANVAS FILTER DRAWER — Mobile & Tablet
   ===================================================== */

/* Filter toggle button — hidden on desktop */
.cpg-filter-toggle-btn {
  display: none;
  align-items: center !important;
  gap: 8px !important;
  background: #f5f5f5 !important;
  border: 1.5px solid #e8e8e8 !important;
  border-radius: 10px !important;
  padding: 9px 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #2c3e50 !important;
  cursor: pointer !important;
  transition: all 0.22s ease !important;
  white-space: nowrap !important;
  height: 42px !important;
  box-shadow: none !important;
}
.cpg-filter-toggle-btn:hover {
  background: #efefef;
  border-color: #ccc;
}
.cpg-filter-toggle-btn svg {
  flex-shrink: 0;
  stroke: #f15a28;
  width: 16px;
  height: 16px;
}

/* Active filter badge on the toggle button */
.cpg-active-filter-count {
  background: #f15a28;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  line-height: 1;
  /* shown/hidden by JS */
}

/* Dark overlay */
.cpg-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 99990;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cpg-filter-overlay.cpg-filter-overlay--visible {
  display: block;
  opacity: 1;
}

/* Off-canvas drawer */
.cpg-filter-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 88vw;
  height: 100%;
  background: #fff;
  z-index: 99999;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.18);
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cpg-filter-drawer.cpg-filter-drawer--open {
  transform: translateX(0);
}

/* Drawer header */
.cpg-filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #ebebeb;
  background: #fff;
  flex-shrink: 0;
}
.cpg-filter-drawer-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cpg-filter-drawer-title svg {
  stroke: #f15a28;
  width: 18px;
  height: 18px;
}
.cpg-filter-drawer-close {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 4px !important;
  font-size: 22px !important;
  color: #555 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.18s ease !important;
  flex-shrink: 0 !important;
}
.cpg-filter-drawer-close:hover {
  color: #f15a28;
}
.cpg-filter-drawer-close svg {
  display: none; /* use text × instead */
}

/* Drawer body — scrollable */
.cpg-filter-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 32px;
  -webkit-overflow-scrolling: touch;
}

/* "Clear All" row inside drawer */
.cpg-filters-header--drawer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 0 12px;
  border-bottom: 1px solid #f0f0f0;
}
.cpg-filters-header--drawer .cpg-drawer-filters-label {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
}
.cpg-filters-header--drawer .cpg-clear-filters {
  font-size: 13px;
  font-weight: 600;
  color: #f15a28;
  text-decoration: none;
}

/* Prevent body scroll when drawer is open */
body.cpg-drawer-open {
  overflow: hidden;
}

/* =====================================================
   RESPONSIVE: show toggle & hide sidebar on ≤1024px
   ===================================================== */
@media (max-width: 1024px) {
  /* Show the toggle button */
  .cpg-filter-toggle-btn {
    display: inline-flex;
  }

  /* Hide the desktop sidebar */
  .cpg-shop-sidebar {
    display: none !important;
  }

  /* Full-width product grid when sidebar is hidden */
  .cpg-shop-container {
    grid-template-columns: 1fr !important;
  }

  #cpg-products-container.cpg-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  #cpg-products-container.cpg-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cpg-filter-toggle-btn {
    padding: 9px 14px;
    font-size: 13px;
  }

  .e-con.e-flex {
    --flex-wrap-mobile: nowrap !important;
    --flex-wrap: nowrap !important;
  }
}

@media (max-width: 480px) {
  #cpg-products-container.cpg-grid {
    grid-template-columns: 1fr;
  }

  .cpg-filter-drawer {
    width: 100%;
    max-width: 100%;
  }
}

/* Apply Filters footer button inside drawer */
.cpg-filter-drawer-footer {
  padding: 14px 16px;
  border-top: 1px solid #ebebeb;
  background: #fff;
  flex-shrink: 0;
}
.cpg-apply-filters-btn {
  display: block;
  width: 100%;
  background: #f15a28;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.22s ease;
  letter-spacing: 0.2px;
}
.cpg-apply-filters-btn:hover {
  background: #d84315;
}

/* Filter group chevron toggle */
.cpg-filter-toggle {
  font-style: normal;
  font-size: 13px;
  color: #aaa;
  transition: transform 0.25s ease;
  display: inline-flex;
  align-items: center;
}
.cpg-filter-group.active .cpg-filter-toggle {
  transform: rotate(0deg);
}
.cpg-filter-group:not(.active) .cpg-filter-toggle {
  transform: rotate(180deg);
}


@media (max-width: 425px) {
  .cpg-shop-wrapper {
    padding: 16px 12px;
  }
  .cpg-shop-header-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }
  .cpg-shop-title-group {
    width: 100%;
    min-width: 0;
  }
  .cpg-shop-controls {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .cpg-filter-toggle-btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
  .cpg-sort-select {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(100% - 110px);
    width: 0;
    box-sizing: border-box;
  }
}