/* ============================================================
   emfacetnav — pastylki filtrów + wysuwany panel boczny
   ============================================================ */

/* ---------- układ pełnej szerokości (opcja w konfiguracji) ---------- */
body.emfn-fullwidth #left-column {
  display: none !important;
}
body.emfn-fullwidth #content-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}

/* ukryj mobilny toggler filtrów z motywu — panel przejmuje jego rolę */
#search_filter_toggler,
.js-search-toggler {
  display: none !important;
}

/* ukryj sortowanie motywu — przejęte przez panel („Sortowanie") */
.products-selection .sort-by,
.products-selection .products-sort-order {
  display: none !important;
}

/* ---------- pasek pastylek ---------- */
.emfn-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.emfn-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.emfn-pill,
.emfn-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  padding: 9px 18px;
  font-size: 14px;
  line-height: 1.2;
  color: #111;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.emfn-pill:hover {
  border-color: #111;
}
.emfn-pill--active {
  background: #111;
  border-color: #111;
  color: #fff;
}
.emfn-pill svg,
.emfn-all svg {
  flex: 0 0 auto;
  display: block;
}
.emfn-pill--active svg circle,
.emfn-pill--active svg path,
.emfn-pill--active svg line {
  stroke: #fff;
}
.emfn-all {
  margin-left: auto;
  background: #111;
  border-color: #111;
  color: #fff;
  font-weight: 500;
}
.emfn-all:hover {
  background: #333;
}

/* przycisk sortowania: na desktopie sama ikona (styl Savicki) */
.emfn-sortbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  padding: 9px 12px;
  font-size: 14px;
  color: #111;
  cursor: pointer;
  transition: border-color .15s ease;
}
.emfn-sortbtn:hover {
  border-color: #111;
}
.emfn-sortbtn .emfn-sortbtn-label {
  display: none;
}

@media (max-width: 991px) {
  .emfn-pills { display: none; }

  /* pasek u góry listy; przyklejanie robi JS (position:sticky nie działa
     przez overflow:hidden na #page w motywie) */
  .emfn-bar {
    z-index: 1040;
    background: #fff;
    padding: 10px 0;
    margin: 0 0 14px;
    flex-wrap: nowrap;
  }
  .emfn-bar.emfn-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  }
  .emfn-sortbtn {
    flex: 1 1 0;
    padding: 11px 16px;
  }
  .emfn-sortbtn .emfn-sortbtn-label {
    display: inline;
  }
  .emfn-all {
    flex: 1 1 0;
    justify-content: center;
    margin-left: 0;
    padding: 11px 16px;
  }
}

/* ---------- overlay + panel ---------- */
#emfn-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .38);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
  z-index: 1050;
}
body.emfn-open #emfn-overlay {
  opacity: 1;
  visibility: visible;
}
#emfn-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 460px;
  max-width: 100vw;
  background: #fff;
  z-index: 1051;
  transform: translateX(102%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 34px rgba(0, 0, 0, .10);
}
body.emfn-open #emfn-drawer {
  transform: none;
}
body.emfn-lock {
  overflow: hidden;
}

/* ---------- nagłówek panelu ---------- */
.emfn-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 26px;
  border-bottom: 1px solid #eee;
}
.emfn-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  color: #111;
  flex: 1 1 auto;
  text-transform: none;
}
.emfn-back,
.emfn-close {
  border: 0;
  background: none;
  padding: 4px;
  cursor: pointer;
  line-height: 0;
  color: #111;
}
.emfn-back[hidden] {
  display: none;
}
.emfn-close:hover svg,
.emfn-back:hover svg {
  opacity: .6;
}

/* ---------- treść panelu ---------- */
.emfn-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 26px 20px;
}

/* widok listy grup */
.emfn-groups {
  list-style: none;
  margin: 0;
  padding: 0;
}
.emfn-groups li {
  margin: 0;
}
.emfn-groups button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px solid #eee;
  padding: 20px 2px;
  font-size: 15px;
  color: #111;
  cursor: pointer;
  text-align: left;
}
.emfn-groups button:hover {
  color: #000;
}
.emfn-groups .emfn-gname {
  flex: 1 1 auto;
}
.emfn-groups .emfn-gcount {
  color: #888;
  font-size: 13px;
}
.emfn-groups svg {
  flex: 0 0 auto;
}

/* widok szczegółu (jedna grupa) */
#emfn-drawer .emfn-detail {
  display: none;
}
#emfn-drawer.emfn-view-detail .emfn-detail {
  display: block;
}
#emfn-drawer.emfn-view-detail .emfn-groups {
  display: none;
}

/* pokaż w szczegółach wyłącznie bieżącą sekcję facetu */
#emfn-drawer .emfn-detail section.facet {
  display: none;
  border: 0;
  margin: 0;
  padding: 8px 0 0;
}
#emfn-drawer .emfn-detail section.facet.emfn-current {
  display: block;
}

/* markup ps_facetedsearch wewnątrz panelu */
#emfn-drawer #search_filters_wrapper {
  display: block !important;
}
#emfn-drawer #search_filter_controls {
  display: none !important;
}
#emfn-drawer #search_filters {
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
}
#emfn-drawer #search_filters > p {
  display: none; /* "Filtruj według" */
}
#emfn-drawer .facet .facet-title,
#emfn-drawer .facet .title {
  display: none !important; /* tytuł grupy jest w nagłówku panelu */
}
#emfn-drawer .facet ul.collapse,
#emfn-drawer .facet ul {
  display: block !important;
  height: auto !important;
  margin: 0;
  padding: 0;
  list-style: none;
}
#emfn-drawer .facet li {
  border-bottom: 1px solid #f2f2f2;
}
#emfn-drawer .facet .facet-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 15px 2px;
  cursor: pointer;
  font-weight: 400;
}
#emfn-drawer .facet .facet-label a.search-link {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #111;
  font-size: 15px;
  text-decoration: none;
}
#emfn-drawer .facet .facet-label a.search-link:hover {
  color: #000;
}
#emfn-drawer .facet .magnitude {
  color: #999;
  font-size: 13px;
}

/* lista sortowania w panelu */
#emfn-drawer .emfn-sort {
  display: none;
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}
#emfn-drawer.emfn-view-sort .emfn-sort {
  display: block;
}
#emfn-drawer.emfn-view-sort #search_filters_wrapper {
  display: none !important;
}
#emfn-drawer .emfn-sort li {
  border-bottom: 1px solid #f2f2f2;
}
#emfn-drawer .emfn-sort button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  padding: 15px 2px;
  font-size: 15px;
  color: #111;
  cursor: pointer;
  text-align: left;
}
#emfn-drawer .emfn-sort .emfn-radio {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid #bbb;
  border-radius: 50%;
  position: relative;
}
#emfn-drawer .emfn-sort button.current .emfn-radio {
  border-color: #111;
}
#emfn-drawer .emfn-sort button.current .emfn-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #111;
  border-radius: 50%;
}

/* suwak ceny w panelu */
#emfn-drawer .facet[data-type="price"],
#emfn-drawer .facet[data-type="weight"] {
  padding-top: 26px;
}
#emfn-drawer .facet[data-type="price"] li,
#emfn-drawer .facet[data-type="weight"] li {
  border-bottom: 0;
  padding: 10px 8px;
}

/* ---------- stopka panelu ---------- */
.emfn-foot {
  display: flex;
  gap: 12px;
  padding: 18px 26px;
  border-top: 1px solid #eee;
  background: #fff;
}
.emfn-clear {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 14px 20px;
  font-size: 14px;
  color: #111;
  cursor: pointer;
}
.emfn-clear:hover {
  border-color: #111;
}
.emfn-clear[disabled] {
  opacity: .4;
  cursor: default;
}
.emfn-apply {
  flex: 1 1 auto;
  background: #111;
  border: 1px solid #111;
  border-radius: 4px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}
.emfn-apply:hover {
  background: #333;
}

@media (max-width: 575px) {
  #emfn-drawer { width: 100vw; }
  .emfn-head { padding: 18px 20px; }
  .emfn-body { padding: 4px 20px 16px; }
  .emfn-foot { padding: 14px 20px; }
}
