/* ===========================
   DOLNY PASEK
=========================== */
.sf-bottom-nav{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  padding-top: 6px;
}

/* ===== DOLNE IKONY ===== */
.sf-bottom-nav__list{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  align-items: stretch;
  margin: 0;
  padding: 0 4px;
  list-style: none;
}
.sf-bottom-nav__item{ text-align: center; display: flex; }

.sf-bottom-nav__link{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 0px;
  position: relative;
  min-height: 56px;
}

.sf-bottom-nav__icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  flex: 0 0 24px;
}
.sf-bottom-nav__icon i{ font-size: inherit; line-height: 1; }
.sf-bottom-nav__icon svg{ width:100%; height:100%; fill:currentColor; display:block; }

.sf-bottom-nav__label{
  font-size: 11px;
  line-height: 1.2;
  display: block;
  width: 100%;
  text-align: center;
  min-height: calc(1.2em * 2);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.sf-bottom-nav__badge{
  position: absolute;
  transform: translate(12px,-10px);
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  padding: 0 4px;
}
.sf-bottom-nav__badge[hidden]{ display:none; }

/* Widoczność */
.sf-visible-mobile{ display:none; }
.sf-visible-tablet{ display:none; }
.sf-visible-always{ display:block; }
@media (max-width: 767px){ .sf-visible-mobile{ display:block; } }
@media (max-width: 1024px){ .sf-visible-tablet{ display:block; } }

/* ===========================
   OFFCANVAS MENU
=========================== */
.sfmbm-offcanvas{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}
.sfmbm-offcanvas.is-open{ display:block; }

.sfmbm-offcanvas__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.4);
}

.sfmbm-offcanvas__panel{
  position:absolute;
  left:0; top:0; bottom:0;
  width:85vw;
  max-width:360px;
  background:#fff;
  transform: translateX(-100%);
  transition: transform .25s ease;
  box-shadow: 2px 0 16px rgba(0,0,0,.2);
  display:flex;
  flex-direction:column;
  outline:none;

  /* ✅ zmienne wysokości (Elementor ustawia przez selectors) */
  --sfmbm-cats-maxh: 45vh;
  --sfmbm-menu-maxh: 55vh;
}
.sfmbm-offcanvas.is-open .sfmbm-offcanvas__panel{ transform: translateX(0); }

.sfmbm-offcanvas__inner{
  height: 100%;
  overflow: hidden;
  display:flex;
  flex-direction:column;
}

.sfmbm-offcanvas__close{
  position:absolute;
  top:10px;
  right:10px;
  z-index:10001;
  width:44px;
  height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:999px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  font-size:28px;
  line-height:1;
  cursor:pointer;
}
.sfmbm-offcanvas__close:hover{ transform: scale(1.03); }

/* WCAG focus */
.sfmbm-offcanvas button:focus-visible,
.sfmbm-offcanvas a:focus-visible{
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ===========================
   SEKCJE (żeby kategorie były "pod nagłówkiem" w jednej sekcji)
=========================== */
.sfmbm-section{ margin: 0 0 16px; }
.sfmbm-section-title{ font-weight: 700; }

/* ===========================
   DRILLDOWN (KATEGORIE + MENU)
=========================== */
.sfmbm-drilldown{
  position: relative;
  overflow: hidden;
  /* nie wymuszamy flex:1 globalnie, bo teraz siedzi w sekcji */
}

/* dla kategorii/menu w sekcji chcemy stabilne zachowanie */
.sfmbm-drilldown--cats,
.sfmbm-drilldown--menu{
  position: relative;
}

/* panel */
.sfmbm-panel{
  position: absolute;
  inset: 0;
  display:flex;
  flex-direction:column;
}
.sfmbm-panel[hidden]{ display:none; }

.sfmbm-panel__header{
  display:grid;
  grid-template-columns: 44px 1fr;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  background:#f3f3f3;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.sfmbm-panel__back{
  width:40px;
  height:40px;
  border:0;
  background:transparent;
  cursor:pointer;
  font-size:26px;
  line-height:1;
}
.sfmbm-panel__back[disabled]{ opacity:0; pointer-events:none; }

.sfmbm-panel__title{
  margin:0;
  font-size:14px;
  font-weight:700;
  text-transform: uppercase;
}

.sfmbm-panel__back--spacer{ display:inline-block; width:44px; height:44px; }
.sfmbm-panel--noheader .sfmbm-panel__body{ padding-top: 0; }

/* ===========================
   KATEGORIE (Woo)
=========================== */
.sfmbm-cats{
  overflow: auto;
  padding: 10px 0 16px;
  max-height: var(--sfmbm-cats-maxh);
  -webkit-overflow-scrolling: touch;
}

.sfmbm-cats__showall{
  display:inline-block;
  margin: 0 12px 10px;
  padding: 8px 10px;
  font-size: 12px;
  text-decoration:none;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 6px;
}

.sfmbm-cats__list{ list-style:none; padding:0; margin:0; }
.sfmbm-cats__item{ border-bottom: 1px solid rgba(0,0,0,.06); }

.sfmbm-cats__row{
  width:100%;
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:center;
  gap:8px;
  padding:12px;
  text-decoration:none;
  color:inherit;
  background:transparent;
  border:0;
  cursor:pointer;
  text-align:left;
}

.sfmbm-cats__text{
  font-size:13px;
  font-weight:600;
  text-transform: uppercase;
}
.sfmbm-cats__chev{ font-size:18px; opacity:.7; }

/* ===========================
   MENU (WordPress) - AKORDEON
=========================== */
.sfmbm-menu-wrap{
  padding: 56px 16px 24px;
  overflow: auto;
  max-height: var(--sfmbm-menu-maxh);
  -webkit-overflow-scrolling: touch;
}

.sfmbm-menu{ list-style:none; margin:0; padding:0; }
.sfmbm-menu li{ border-bottom: 1px solid rgba(0,0,0,.06); }

.sfmbm-menu a{
  display:block;
  padding: 12px 6px;
  text-decoration:none;
  font-weight:700;
  text-transform: uppercase;
  font-size: 13px;
}

/* submenu */
.sfmbm-menu .menu-item-has-children > a{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
}

.sfmbm-menu .sfmbm-sub-toggle{
  flex: 0 0 auto;
  width:40px;
  height:40px;
  border:0;
  background:transparent;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}

.sfmbm-menu .sfmbm-sub-toggle:before{
  content:"";
  width:8px; height:8px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform: rotate(45deg);
  display:block;
  transition: transform .2s ease;
}

.sfmbm-menu .menu-item-has-children.is-open > a .sfmbm-sub-toggle:before{
  transform: rotate(-135deg);
}

.sfmbm-menu .sub-menu{
  list-style:none;
  margin:0;
  padding: 0 0 0 14px;
  display:none;
}
.sfmbm-menu .menu-item-has-children.is-open > .sub-menu{ display:block; }

.sfmbm-menu .sub-menu a{
  padding: 10px 6px;
  font-size: 14px;
  font-weight:600;
  text-transform:none;
}

/* ===========================
   MENU (WordPress) - DRILLDOWN
=========================== */
.sfmbm-menu-dl{
  overflow:auto;
  padding: 10px 0 16px;
  max-height: var(--sfmbm-menu-maxh);
  -webkit-overflow-scrolling: touch;
}

.sfmbm-menu-dl__list{ list-style:none; margin:0; padding:0; }
.sfmbm-menu-dl__item{ border-bottom: 1px solid rgba(0,0,0,.06); }

.sfmbm-menu-dl__row{
  width:100%;
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:center;
  gap:8px;
  padding:12px;
  text-decoration:none;
  color:inherit;
  background:transparent;
  border:0;
  cursor:pointer;
  text-align:left;
}

.sfmbm-menu-dl__text{
  font-size:13px;
  font-weight:700;
  text-transform: uppercase;
}
.sfmbm-menu-dl__chev{ font-size:18px; opacity:.7; }

/* ===========================
   SEARCH OVERLAY
=========================== */
.sfmbm-search{
  position:fixed;
  inset:0;
  display:none;
  z-index:10000;
}
.sfmbm-search.is-open{ display:block; }

.sfmbm-search__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.4);
}

.sfmbm-search__panel{
  position:absolute;
  left:0; right:0; bottom:0;
  background:#fff;
  padding:16px;
  border-radius: 16px 16px 0 0;
}

.sfmbm-search__form{ display:flex; gap:8px; }

.sfmbm-search__form input[type="search"]{
  flex:1;
  padding: 10px 12px;
  border:1px solid #ddd;
  border-radius:8px;
}

.sfmbm-search__form button{
  padding: 10px 14px;
  border:1px solid #ddd;
  background:#f7f7f7;
  border-radius:8px;
  cursor:pointer;
}
.sfmbm-search__close{ border:1px solid #ddd; background:#fff; }

/* ===== Scroll mode (panel) ===== */
/* UWAGA: w one_for_both nie robimy dodatkowych max-height scrolli sekcji, bo całość ma jeden scroll */
.sfmbm-offcanvas__panel.sfmbm-scroll--one_for_both .sfmbm-offcanvas__inner{ overflow:auto; -webkit-overflow-scrolling: touch; }
.sfmbm-offcanvas__panel.sfmbm-scroll--one_for_both .sfmbm-menu-wrap{ max-height: none; overflow: visible; }
.sfmbm-offcanvas__panel.sfmbm-scroll--one_for_both .sfmbm-cats{ max-height: none; overflow: visible; }
.sfmbm-offcanvas__panel.sfmbm-scroll--one_for_both .sfmbm-menu-dl{ max-height: none; overflow: visible; }

/* pozostałe tryby: działają na max-height zmiennych */

/* ===========================
   FIX: Drilldown w sekcji ma 0 wysokości (panele są absolute)
=========================== */

/* Kontenery drilldown muszą mieć wysokość, inaczej panele absolute są niewidoczne */
.sfmbm-drilldown--cats{
  height: var(--sfmbm-cats-maxh);
  max-height: var(--sfmbm-cats-maxh);
  min-height: 180px; /* bezpieczne minimum */
  overflow: hidden;  /* panele wewnątrz mają własny scroll */
}

.sfmbm-drilldown--menu{
  height: var(--sfmbm-menu-maxh);
  max-height: var(--sfmbm-menu-maxh);
  min-height: 180px;
  overflow: hidden;
}

/* W trybie "one_for_both" nie blokujemy wysokości – cały panel ma jeden scroll */
.sfmbm-offcanvas__panel.sfmbm-scroll--one_for_both .sfmbm-drilldown--cats,
.sfmbm-offcanvas__panel.sfmbm-scroll--one_for_both .sfmbm-drilldown--menu{
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

/* Żeby sekcja nie „przykrywała” się dziwnie przy absolute */
.sfmbm-drilldown--cats,
.sfmbm-drilldown--menu{
  position: relative;
}

/* Upewniamy się, że panel body wypełnia wysokość */
.sfmbm-panel__body{
  flex: 1 1 auto;
  min-height: 0; /* ważne dla scroll w flex */
}