/* ==============================================
   Olympia Store Filter — filter.css v2.3.1
   ============================================== */

/* ── Hlavní karta ── */
.ol-filter {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px; /* ← uprav tady (desktop) */
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
}

/* ── Horní řada ── */
.ol-filter__top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

/* ── Search bar ── */
.ol-filter__search {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f4f5f7;
  border-radius: 50px;
  padding: 8px 20px 8px 8px;
}

.ol-filter__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: #3dbfa0;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  margin-right: 12px;
  transition: background .2s;
}
.ol-filter__search-btn:hover { background: #30a88c; }

.ol-filter__input {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent;
  font-size: 15px;
  color: #4a5568;
}
.ol-filter__input::placeholder { color: #a0aec0; }

/* ── Toggle tlačítko (mobil) ── */
.ol-filter__toggle {
  display: none; /* skryté na desktopu */
  position: relative;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: #3dbfa0;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
}
.ol-filter__toggle:hover { background: #30a88c; }

/* Badge s počtem aktivních filtrů */
.ol-filter__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: #111b4e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  padding: 0 4px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ol-filter__badge.visible {
  display: flex;
}

/* ── Počítadlo výsledků ── */
.ol-filter__count {
  font-size: 13px;
  color: #a0aec0;
  min-height: 18px;
  margin-bottom: 4px;
}

/* ── Panel s kategoriemi ── */
.ol-panel__header {
  display: none; /* na desktopu schovej header panelu */
}

.ol-panel__apply {
  display: none; /* na desktopu schovej tlačítko Zobrazit */
}

/* ── Checkboxy ── */
.ol-filter__categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Gastro šipka */
.ol-gastro-arrow {
  margin-left: auto;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.ol-filter__label--gastro input:checked ~ .ol-gastro-arrow {
  transform: rotate(180deg);
}

/* Podkategorie — skryté dokud gastro není zaškrtnuto */
.ol-subcategories {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-left: 16px;
  padding-left: 12px;
  border-left: 2px solid #e8f8f4;
  overflow: hidden;
}
.ol-subcategories.is-visible {
  display: flex;
}

/* Podkategorie label — trochu menší */
.ol-filter__label--sub {
  padding: 7px 4px;
  font-size: 14px;
  color: #718096;
}

.ol-filter__label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  font-size: 15px;
  color: #4a5568;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
  line-height: 1.4;
  user-select: none;
}
.ol-filter__label:hover { background: #f7f8fa; }

.ol-filter__label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.ol-filter__label input[type="checkbox"]:checked {
  background: #3dbfa0;
  border-color: #3dbfa0;
}
.ol-filter__label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 7px;
  height: 11px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* ── Overlay ── */
.ol-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9998;
  opacity: 0;
  transition: opacity .3s ease;
}
.ol-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* ==============================================
   MOBILNÍ + TABLETOVÝ LAYOUT  (≤ 1024px)
   ============================================== */
@media (max-width: 1024px) {

  /* Karta — pill tvar, padding uprav tady (mobil) */
  .ol-filter {
    padding: 10px 10px 10px 10px; /* ← uprav tady (mobil) */
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
  }

  /* Skryj počítadlo v kartě na mobilu (je v panelu) */
  .ol-filter__count {
    display: none;
  }

  /* Search má margin 0 — toggle je vedle */
  .ol-filter__top {
    margin-bottom: 0;
  }

  /* Zobraz toggle tlačítko */
  .ol-filter__toggle {
    display: flex;
  }

  /* ── Off-canvas panel ── */
  .ol-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(85vw, 320px);
    background: #fff;
    z-index: 10001; /* nad Elementor sticky headerem (9999) i overlayem (9998) */
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear .35s;
    /* FIX v2.3.1: visibility:hidden zabrání iOS Safari způsobit
       horizontální scrollbar z off-screen translateX elementu */
    visibility: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
    padding: 0;
  }

  .ol-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
  }

  /* Header panelu */
  .ol-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
  }

  .ol-panel__title {
    font-size: 16px;
    font-weight: 600;
    color: #111b4e;
  }

  .ol-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f4f5f7;
    border: none;
    border-radius: 50%;
    color: #4a5568;
    cursor: pointer;
    transition: background .2s;
  }
  .ol-panel__close:hover { background: #e8e9eb; }

  /* Kategorie v panelu */
  .ol-filter__categories {
    padding: 12px 16px;
    flex: 1;
  }

  /* Tlačítko Zobrazit (sticky dole) */
  .ol-panel__apply {
    display: block;
    margin: 0;
    padding: 16px 20px;
    background: #3dbfa0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .2s;
    position: sticky;
    bottom: 0;
    width: 100%;
    text-align: center;
  }
  .ol-panel__apply:hover { background: #30a88c; }

}
