.cif-panel {
  width: 100%;
  margin-bottom: 40px;
  font-size: 13px;
  position: relative;
}

.cif-grid {
  display: grid;
  grid-template-columns:
    55px    /* LOGO */
    220px   /* wszystkie meble */
    repeat(6, minmax(120px, 1fr));
  gap: 30px;
  margin-left: 25px;
  width: calc(100% - 60px);
}

.cif-panel.only-first-col .cif-col:not(.cif-logo-col):not(.cif-first-col) {
  display: none;
}

/* Стили для верхней кнопки "wszystkie" */
.cif-top-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.cif-top-item {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  padding: 8px 15px;
  transition: all 0.2s ease;
  gap: 5px;
  margin: 0;
  height: auto;
  text-align: left;
  letter-spacing: normal;
}




.cif-top-button-num {
  font-weight: normal;
  font-size: 14px;
  color: #666;
}

/* Обычные кнопки фильтров */
.cif-item {
  background: none;
  border: 0;
  padding: 0px;
  margin: 0px;		
  cursor: pointer;
  height: auto;
  text-align: left;
  font-size: 13px;
  letter-spacing: normal;
  color: #282828;
  font-weight: 500;
}

.cif-item.is-active {
  opacity: 1;
  text-decoration: underline;
}

/* Контейнер для категорийных фильтров */
.cif-category-filters {
  margin-top: 15px;
}

.flex-filters {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.cif-col-title {
  margin-bottom: 40px;
  position: relative;
  font-weight: normal;
}

/* Стили для кнопки справа при закрытых фильтрах */
.cif-toggle-right {
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  font-size: 13px;
  position: absolute;
  right: 0;
  top: 0;
  white-space: nowrap;
  transition:
    background-color 0.25s ease,
    padding 0.25s ease,
    box-shadow 0.25s ease,
    border-radius 0.25s ease;
  color: #aaa;
}



/* Стили для кнопки над второй колонкой при открытых фильтрах */
.cif-toggle-above {
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.cif-toggle-above-btn {
  background: none;
  border: 0;
  cursor: pointer;
  color: #aaa;
  padding: 0;
  font-size: 13px;
  white-space: nowrap;
  height: auto;
  margin: 0px;
}

.cif-toggle-above-btn:hover {
  opacity: 1;
}

/* Показываем правую кнопку только при закрытых фильтрах */
.cif-panel.only-first-col .cif-toggle-right {
  display: block;
  margin-top: 0px;
  height: auto;
  max-width: fit-content;
  padding-left: 20px;
  position: static; /* Изменено с absolute на static для нового layout */
  letter-spacing: normal;
}

.cif-panel:not(.only-first-col) .cif-toggle-right {
  display: none;
}

/* Показываем верхнюю кнопку только при открытых фильтрах */
.cif-panel.only-first-col .cif-toggle-above {
  display: none;
}

.cif-panel:not(.only-first-col) .cif-toggle-above {
  display: flex;
}

/* Отступ для второй колонки чтобы кнопка не перекрывала контент */
.cif-typ-col {
  position: relative;
}

.cif-grid > .cif-col:last-child {
  justify-self: end;
  align-items: flex-end;
  text-align: right;
}

@media (min-width: 992px) {
  .cif-logo-col,
  .cif-first-col {
    top: var(--header-height, 90px);
    align-self: start;
    z-index: 5;
  }
  
  .cif-first-col {
    position: sticky;
  }
}

/* ✅ фиксируем только inner */
body.cif-is-sticky .cif-logo-inner {
  position: fixed;
  top: 20px;
  z-index: 1001;
  background: transparent;
}

body.cif-is-sticky .cif-first-col {
  left: calc(25px + 55px + 30px); /* margin + logo + gap */
  width: 220px;
}

body.cif-hide-filters .cif-col:not(.cif-logo-col):not(.cif-first-col) {
  opacity: 0;
  pointer-events: none;
}

body.cif-is-sticky .cif-toggle-right {
  position: fixed;
  z-index: 1002;
  pointer-events: auto;
  background: #ffffff;
 
}

/* =========================
   OVERLAY STRUCTURE
   ========================= */

.cif-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.cif-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cif-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(255 255 255 / 70%)
}

.cif-overlay-inner {
  position: relative;
  z-index: 1;
  height: 50vh;
  max-height: 50vh;
  overflow-y: auto;
  background: #fff;
}

/* панель внутри overlay должна выглядеть как "верх страницы" */
body.cif-overlay-open #cif-panel {
  margin-top: 140px; /* место под fixed header, подстрой если надо */
}

/* когда panel внутри overlay — он должен быть нормальным (не sticky-режим) */
body.cif-overlay-open .cif-col {
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.cif-overlay-open .cif-logo-col,
body.cif-overlay-open .cif-first-col,
body.cif-overlay-open .cif-toggle-right {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
}

/* =========================
   FORCE HEADER OPEN IN OVERLAY
   (у тебя пункты меню скрываются через body.is-scrolled)
   ========================= */

@media (min-width: 1024px) {
  /* показать все пункты меню, даже если body.is-scrolled */
  body.cif-overlay-open #navi-header .menu > li {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }
  
  body.cif-overlay-open .cif-logo-inner,
  body.cif-overlay-open .cif-toggle-right {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
  }

  /* если на главной скрыто logo-wrap — раскрываем его в overlay */
  body.cif-overlay-open .logo-wrap {
    visibility: visible !important;
    opacity: 1!important;
  }
}

/* на время overlay можно убрать твой sticky-режим фильтров */
body.cif-overlay-open.cif-is-sticky .cif-col:not(.cif-logo-col):not(.cif-first-col) {
  opacity: 1 !important;
  pointer-events: auto !important;
}

button.cif-toggle.cif-toggle-right.cif-toggle-clone {
  height: fit-content;
  padding: 10px 5% 10px 20px;
  margin-bottom: 10px;
  margin-top: 0px;
  min-width: fit-content;
}

body.cif-overlay-open .cif-logo-col {
  visibility: hidden;
}

.cif-toggle-right:hover {
  background: initial;
	color: #aaa;
	
}

/* Счетчики только для элементов с data-category */
.cif-item[data-category] {
  padding-right: 35px !important;
  position: relative;
}

.filter-num {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #f0f0f0;
  color: #aaa;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
  font-weight: 500;
}

.filter-num {
  background: transparent;
  opacity: 1;
  right: initial;
}

/* Для счетчика на верхней кнопке */
.cif-top-button-num {
  background: transparent;
  color: #666;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
  font-weight: 500;
}

.cif-top-item.is-active .cif-top-button-num {
  color: #000;
}

/*MOBILE*/

@media (max-width: 768px) {

  button.cif-toggle.cif-toggle-right:after {
   content: "↓";
}

  body.cif-is-sticky .cif-first-col {
    width: auto;
}

  .cif-item {
    font-size: 14px!important;
  }
  
  .cif-top-button {
position: relative;
  }
  
  
  .cif-top-button-num {
    font-size: 13px;
  }
  
  .cif-grid {
    grid-template-columns: repeat(3, 1fr); 
    grid-template-rows: auto auto auto;    
    gap: 0px;        
    margin: 10px;       
    width: 100%;
    max-width: -webkit-fill-available;    
  }
  
  .cif-col-title {
    
    font-size: 14px!important;
    font-weight: 500;
  }
  
  .cif-grid > .cif-col:last-child {
    justify-self: initial;
    text-align: initial;
  }
  
  .cif-grid > .cif-col:nth-child(1) {
    display: none;
  }
  
  button.cif-item {
    margin-bottom: 5px;
  }
  .cif-panel.only-first-col .cif-grid > .cif-col {
    margin-bottom: 0px;
  }
   .cif-grid > .cif-col {
    margin-bottom: 60px;
  }
   .cif-grid > .cif-col:last-child {
    margin-bottom: 0px;
  }
  .cif-mobile-close-btn {
    display: block!important;
    width: -webkit-fill-available;
    max-width: 100%;
    margin: 40px 10px 15px;
    text-align: center;
    padding: 12px 20px;
    background: #ffffff;
    font-size: 13px !important;
    border: 1px solid #ccc;
    cursor: pointer;
    color: #aaa;
  }
  
  .cif-panel:not(.only-first-col)::after:hover {
    opacity: 1 !important;
    background: #2a2a2a !important;
    color: white !important;
    border-color: #2a2a2a !important;
  }
  
  .cif-panel.only-first-col .cif-toggle-right {
    visibility: visible!important;
    position: absolute;
    left: 180%;
    font-size: 14px;
  }
  
  .cif-toggle-above-btn {
    display: none;
  }
  
  .cif-item[data-category] {
    padding-right: 30px !important;
  }
  
  .text_block span.filter-num {
    font-size: 11px!important;
    padding: 1px 6px;
    min-width: 20px;
  }
}

.cif-mobile-close-btn {
  display: none;
}

.cif-initial-loading .grid-item {
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.cif-initial-loading .grid-item {
  animation: cifFadeIn 0.3s ease forwards;
  animation-delay: calc(var(--item-index, 0) * 0.05s);
}

@keyframes cifFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.masonry-list {
  transition: height 0.3s ease;
}
div#cif-panel {
    min-height: 200px;
}
.cif-first-col button.cif-item:hover {
        background: none;
    color: initial !important;
    font-weight: initial;
}
button.cif-item {
-webkit-transition: background-color .0s;
	transition: background-color .0s;}