/* Styling filtrów w sidebarze sklepu (WC blocks + classic widgets jak brand_nav). */

/* === Karta widgetu (kontener) === */
.ct-sidebar .ct-widget{
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 18px 14px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

/* Nagłówek widgetu */
.ct-sidebar .ct-widget .widget-title,
.ct-sidebar .ct-widget .widgettitle{
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #1f2937;
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 2px solid #007236;
}

/* === Lista filtrów (layered nav + brand_nav classic) === */
.woocommerce-widget-layered-nav-list,
.wc-block-brand-nav ul,
ul.wc-brand-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Każdy item: jedna linia, nazwa + " (count)" inline */
.woocommerce-widget-layered-nav-list li,
.wc-brand-list li{
  margin: 0;
  border: 0;
  position: relative;
  display: block !important;
  padding: 6px 8px 6px 30px;
  border-radius: 6px;
  transition: background .12s, color .12s;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.woocommerce-widget-layered-nav-list li:hover,
.wc-brand-list li:hover{ background: #f5f7f5; }

.woocommerce-widget-layered-nav-list li a,
.wc-brand-list li a{
  display: inline !important;
  padding: 0;
  margin: 0;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  background: none;
}
.woocommerce-widget-layered-nav-list li:hover a,
.wc-brand-list li:hover a{ color: #007236; }

/* Checkbox-style marker przy <li> */
.woocommerce-widget-layered-nav-list li::before,
.wc-brand-list li::before{
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.woocommerce-widget-layered-nav-list li.chosen::before,
.wc-brand-list li.chosen::before{
  background: #007236;
  border-color: #007236;
}
.woocommerce-widget-layered-nav-list li.chosen::after,
.wc-brand-list li.chosen::after{
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-65%) rotate(45deg);
}
.woocommerce-widget-layered-nav-list li.chosen{ background: #ecf5ee; }
.woocommerce-widget-layered-nav-list li.chosen a,
.wc-brand-list li.chosen a{
  color: #007236;
  font-weight: 600;
}

/* Licznik — inline " (5)" obok nazwy */
.woocommerce-widget-layered-nav-list li .count,
.wc-brand-list li .count{
  display: inline !important;
  margin: 0;
  padding: 0 0 0 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  color: #9ca3af;
  position: static;
  transform: none;
  min-width: 0;
}
.woocommerce-widget-layered-nav-list li.chosen .count,
.wc-brand-list li.chosen .count{
  background: #007236;
  color: #fff;
}

/* Długie listy (np. Marka z 30+ producentami) → scroll w sekcji */
.widget_layered_nav .woocommerce-widget-layered-nav-list,
.widget_brand_nav .wc-brand-list{
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.widget_layered_nav .woocommerce-widget-layered-nav-list::-webkit-scrollbar,
.widget_brand_nav .wc-brand-list::-webkit-scrollbar{ width: 6px; }
.widget_layered_nav .woocommerce-widget-layered-nav-list::-webkit-scrollbar-thumb,
.widget_brand_nav .wc-brand-list::-webkit-scrollbar-thumb{
  background: #cbd5e1;
  border-radius: 3px;
}

/* === Aktywne filtry (classic widget — chip-style) === */
.woocommerce-widget-layered-nav-filters{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.woocommerce-widget-layered-nav-filters li{
  margin: 0;
  padding: 0;
  border: 0;
}
.woocommerce-widget-layered-nav-filters li a{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #007236;
  color: #fff;
  text-decoration: none;
  padding: 5px 10px 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  transition: background .12s;
}
.woocommerce-widget-layered-nav-filters li a:hover{ background: #005c2b; }
.woocommerce-widget-layered-nav-filters li a::after{
  content: "×";
  font-size: 16px;
  line-height: 1;
  margin-left: 2px;
}

/* === Filtr ceny (price slider — classic widget i WC block) === */
.widget_price_filter .price_slider_wrapper{ margin-top: 6px; }
.widget_price_filter .price_slider{
  background: #e5e7eb;
  height: 4px;
  border-radius: 2px;
  position: relative;
  margin: 8px 6px 20px;
}
.widget_price_filter .ui-slider-range{
  background: #007236;
  height: 4px;
  position: absolute;
}
.widget_price_filter .ui-slider-handle{
  background: #fff;
  border: 2px solid #007236;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  top: -7px;
  margin-left: -8px;
  cursor: grab;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}
.widget_price_filter .price_slider_amount{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #374151;
}
.widget_price_filter .price_slider_amount .price_label{
  flex: 1;
  font-weight: 500;
}
.widget_price_filter .price_slider_amount .button{
  background: #007236;
  color: #fff;
  border: 0;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.widget_price_filter .price_slider_amount .button:hover{ background: #005c2b; }

/* Ukryj puste widget_block wrappery (gdy nasz pre_render_block zwrócił "") */
.ct-sidebar .ct-widget.widget_block:empty,
.ct-sidebar .ct-widget.widget_block:not(:has(*)){ display: none; }

@media (max-width: 900px){
  .ct-sidebar .ct-widget{ padding: 14px; }
}
