/* =========================================================
   SCARLETT.CZ – VÝPIS KATEGORIE PODLE NÁVRHU V1
   Načítat ZA scarlett-stranka-kategorie-v1.css.

   PC (od 992 px):
   - filtr trvale otevřený v bílé kartě v LEVÉM sloupci (280 px),
     při posouvání stránky zůstává na očích,
   - vpravo počet položek + řazení, pod tím produkty a „Načíst další“,
   - nadpis a popis kategorie v jednom béžovém boxu.
   Mobil: filtr zůstává za tlačítkem „Otevřít filtr“ (Shoptet), jen
   v novém vzhledu.

   Funguje s rozvržením Shoptetu „bez levého sloupce“, které máte
   teď – v Shoptetu NENÍ potřeba nic přepínat. Kdybyste přesto zapnuli
   levý sloupec Shoptetu, filtr převezme stejný vzhled karty.
   ========================================================= */

/* ---------------------------------------------------------
   1) ROZLOŽENÍ: FILTR VLEVO, PRODUKTY VPRAVO (PC)
   --------------------------------------------------------- */
@media (min-width: 992px) {
  .category-content-wrapper:has(> #filters-wrapper #filters) {
    display: grid !important;
    grid-template-columns: 280px minmax(0, 1fr) !important;
    column-gap: 28px !important;
    align-items: start !important;
  }

  .category-content-wrapper:has(> #filters-wrapper #filters) > * {
    grid-column: 2 !important;
    min-width: 0 !important;
  }

  .category-content-wrapper:has(> #filters-wrapper #filters) > #filters-wrapper {
    grid-column: 1 !important;
    grid-row: 1 / span 20 !important;
    position: sticky !important;
    top: 16px !important;
    align-self: start !important;
    max-height: calc(100vh - 32px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    margin: 0 !important;
  }

  /* Filtr je na PC vždy otevřený – tlačítko „Otevřít filtr“ netřeba */
  #filters-wrapper .filters-unveil-button-wrapper {
    display: none !important;
  }

  #filters-wrapper #filters {
    display: block !important;
  }

  /* Řádek nad produkty: počet položek vlevo, řazení vpravo */
  .category-content-wrapper .category-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
  }

  /* Užší obsah vedle filtru – na menších monitorech 2 produkty vedle sebe */
  .category-content-wrapper:has(> #filters-wrapper #filters) #products > .product {
    min-width: 0 !important;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .category-content-wrapper:has(> #filters-wrapper #filters) {
    grid-template-columns: 250px minmax(0, 1fr) !important;
    column-gap: 20px !important;
  }

  .category-content-wrapper:has(> #filters-wrapper #filters) #products > .product {
    width: 50% !important;
    flex-basis: 50% !important;
    max-width: 50% !important;
  }
}

/* ---------------------------------------------------------
   2) KARTA FILTRU
   --------------------------------------------------------- */
#filters-wrapper .filters-wrapper,
.sidebar .box-filters {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#filters {
  box-sizing: border-box !important;
  padding: 22px 22px 18px !important;
  background: var(--sc-white, #FFFFFF) !important;
  border: 1px solid var(--sc-line, #EDE6DC) !important;
  border-radius: var(--sc-r-lg, 24px) !important;
  box-shadow: none !important;
}

#filters .filter-section {
  margin: 0 !important;
  padding: 16px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--sc-line, #EDE6DC) !important;
  background: transparent !important;
}

#filters .filter-section:first-child {
  padding-top: 0 !important;
}

#filters .filter-section:last-child {
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

#filters fieldset {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

#filters .filter-section h4 {
  margin: 0 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
  font-family: var(--sc-font-head, "Nunito", sans-serif) !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  color: var(--sc-ink, #24302A) !important;
  background: transparent !important;
}

#filters .filter-section h4::before,
#filters .filter-section h4::after {
  display: none !important;
}

/* Jedna položka filtru = jeden řádek s checkboxem */
#filters fieldset > div:not(.advanced-filters-wrapper) {
  position: relative !important;
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

#filters fieldset::after {
  content: "";
  display: block;
  clear: both;
}

#filters .filter-label {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 4px 0 4px 32px !important;
  border-radius: 10px !important;
  font-family: var(--sc-font-body, "Nunito Sans", sans-serif) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  color: var(--sc-ink, #24302A) !important;
  text-transform: none !important;
  cursor: pointer !important;
  transition: color .15s ease !important;
}

/* první písmeno velké („bílá“ → „Bílá“) */
#filters .filter-label::first-letter {
  text-transform: uppercase;
}

#filters .filter-label:hover {
  color: var(--sc-green, #4E6352) !important;
}

/* Vlastní checkbox – zaoblený čtvereček */
#filters .filter-label::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border: 2px solid var(--sc-line-strong, #CFC5B6) !important;
  border-radius: 6px !important;
  background: #FFFFFF !important;
  transform: translateY(-50%) !important;
  transition: background-color .15s ease, border-color .15s ease !important;
}

#filters .filter-label::after {
  content: "" !important;
  position: absolute !important;
  left: 7px !important;
  top: 50% !important;
  width: 6px !important;
  height: 11px !important;
  margin: 0 !important;
  border: solid #FFFFFF !important;
  border-width: 0 2px 2px 0 !important;
  background: transparent !important;
  transform: translateY(-62%) rotate(45deg) !important;
  opacity: 0 !important;
  transition: opacity .15s ease !important;
}

#filters .filter-label:hover::before {
  border-color: var(--sc-green, #4E6352) !important;
}

#filters input:checked + .filter-label::before {
  border-color: var(--sc-green, #4E6352) !important;
  background: var(--sc-green, #4E6352) !important;
}

#filters input:checked + .filter-label::after {
  opacity: 1 !important;
}

#filters input:checked + .filter-label {
  font-weight: 800 !important;
}

#filters input:focus-visible + .filter-label::before {
  box-shadow: var(--sc-focus, 0 0 0 3px rgba(78, 99, 82, .28)) !important;
}

/* Nedostupná volba (0 položek) */
#filters input:disabled + .filter-label,
#filters .filter-label.disabled {
  color: var(--sc-muted, #5B6560) !important;
  opacity: .55 !important;
  cursor: default !important;
}

/* Počet položek – šedá pilulka vpravo */
#filters .filter-count {
  margin-left: auto !important;
  padding: 2px 9px !important;
  border-radius: 999px !important;
  background: var(--sc-sand, #F3ECE2) !important;
  color: var(--sc-muted, #5B6560) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}

/* Skutečný checkbox Shoptetu schovaný (ovládá se kliknutím na popisek) */
#filters fieldset input[type="checkbox"],
#filters fieldset input[type="radio"] {
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  width: 20px !important;
  height: 20px !important;
  margin: -10px 0 0 !important;
  opacity: 0 !important;
}

/* „Na skladě“ a další přepínače nahoře – zelený box jako v návrhu */
#filters .filter-section-boolean .param-filter-top {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

#filters .filter-section-boolean .filter-label {
  min-height: 44px !important;
  padding: 6px 12px 6px 42px !important;
  border-radius: 14px !important;
  background: var(--sc-green-tint, #E4EBE3) !important;
  font-weight: 800 !important;
}

#filters .filter-section-boolean .filter-label::before {
  left: 12px !important;
}

#filters .filter-section-boolean .filter-label::after {
  left: 19px !important;
}

#filters .filter-section-boolean fieldset input[type="checkbox"] {
  left: 12px !important;
}

#filters .filter-section-boolean .filter-count {
  background: #FFFFFF !important;
}

/* Přepínače, které v kategorii nemají žádné zboží (Akce 0, Novinka 0 …), schovat */
#filters .filter-section-boolean fieldset > div:has(> input:disabled) {
  display: none !important;
}

#filters .filter-section-boolean form:not(:has(input:not([type="hidden"]):not(:disabled))) {
  display: none !important;
}

#filters .slider-wrapper h4,
#filters .slider-wrapper h4 span {
  font-size: 17px !important;
  font-weight: 900 !important;
  color: var(--sc-ink, #24302A) !important;
}

/* Značky: jen jedna (Scarlett) = zbytečný filtr, schováme */
#filters .filter-section-manufacturer:has(fieldset > div:only-of-type) {
  display: none !important;
}

/* Odkaz „Rozbalit filtr / další parametry“ */
#filters .filter-section-button a,
#filters .toggle-filters {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 36px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  background: var(--sc-sand, #F3ECE2) !important;
  color: var(--sc-green, #4E6352) !important;
  font-family: var(--sc-font-head, "Nunito", sans-serif) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

/* „Položek k zobrazení: 53“ */
#filters .filter-section-count {
  font-size: 13px !important;
  color: var(--sc-muted, #5B6560) !important;
}

#filters .filter-section-count strong {
  color: var(--sc-ink, #24302A) !important;
}

/* Cena – posuvník (jQuery UI slider Shoptetu) */
#filters .slider-wrapper {
  margin: 0 !important;
  padding: 0 0 18px !important;
  border-bottom: 1px solid var(--sc-line, #EDE6DC) !important;
}

#filters .slider-wrapper h4 {
  margin: 0 0 14px !important;
  font-family: var(--sc-font-head, "Nunito", sans-serif) !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  color: var(--sc-ink, #24302A) !important;
  text-transform: none !important;
}

#filters .ui-slider {
  position: relative !important;
  height: 6px !important;
  margin: 0 10px 12px !important;
  border: 0 !important;
  border-radius: 99px !important;
  background: var(--sc-green-tint, #E4EBE3) !important;
}

#filters .ui-slider-range {
  height: 100% !important;
  border: 0 !important;
  border-radius: 99px !important;
  background: var(--sc-green, #4E6352) !important;
}

#filters .ui-slider-handle {
  width: 22px !important;
  height: 22px !important;
  top: -8px !important;
  margin-left: -11px !important;
  border: 3px solid var(--sc-green, #4E6352) !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  box-shadow: var(--sc-shadow-sm, 0 2px 10px rgba(36, 48, 42, .06)) !important;
  cursor: grab !important;
  outline: none !important;
}

#filters .ui-slider-handle:focus-visible {
  box-shadow: var(--sc-focus, 0 0 0 3px rgba(78, 99, 82, .28)) !important;
}

/* Hodnoty „od – do“ nad posuvníkem */
#filters .slider-header {
  display: flex !important;
  justify-content: space-between !important;
  margin: 0 0 12px !important;
}

#filters .slider-header span {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: var(--sc-ink-soft, #3D4842) !important;
}

#filters .filter-sections {
  margin: 0 !important;
  padding: 0 !important;
}

#filters .filter-sections > .filter-section:first-child {
  padding-top: 16px !important;
}

/* Barva: barevné tečky vedle názvu (podle hodnoty parametru) */
#filters input[value="bílá"] + .filter-label,
#filters input[value="přírodní"] + .filter-label,
#filters input[value="šedá"] + .filter-label,
#filters input[value="bez povrchové úpravy"] + .filter-label,
#filters input[value="ECO - bez povrchové úpravy"] + .filter-label {
  padding-left: 58px !important;
}

#filters input[value="bílá"] + .filter-label > .filter-count::before,
#filters input[value="přírodní"] + .filter-label > .filter-count::before,
#filters input[value="šedá"] + .filter-label > .filter-count::before,
#filters input[value="bez povrchové úpravy"] + .filter-label > .filter-count::before,
#filters input[value="ECO - bez povrchové úpravy"] + .filter-label > .filter-count::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--sc-line-strong, #E6DFD5);
  transform: translateY(-50%);
  box-sizing: border-box;
}

#filters input[value="bílá"] + .filter-label > .filter-count::before { background: #FFFFFF; }
#filters input[value="přírodní"] + .filter-label > .filter-count::before { background: #D9B98C; }
#filters input[value="šedá"] + .filter-label > .filter-count::before { background: #9A9E9B; }
#filters input[value="bez povrchové úpravy"] + .filter-label > .filter-count::before,
#filters input[value="ECO - bez povrchové úpravy"] + .filter-label > .filter-count::before { background: #EEDCBC; }

/* ---------------------------------------------------------
   3) NADPIS + POPIS V JEDNOM BÉŽOVÉM BOXU (jako v návrhu)
   --------------------------------------------------------- */
@media (min-width: 768px) {
  .category-top > .category-title:has(+ .scarlett-category-desc) {
    margin: 8px 0 0 !important;
    padding: 36px 40px 6px !important;
    border-radius: var(--sc-r-xl, 28px) var(--sc-r-xl, 28px) 0 0 !important;
    background: var(--sc-beige, #EFE4D6) !important;
  }

  .category-top > .category-title + .scarlett-category-desc {
    margin-top: 0 !important;
    padding: 6px 40px 28px !important;
    border-radius: 0 0 var(--sc-r-xl, 28px) var(--sc-r-xl, 28px) !important;
  }
}

/* ---------------------------------------------------------
   4) MOBIL – filtr za tlačítkem, nový vzhled
   --------------------------------------------------------- */
@media (max-width: 991px) {
  #filters-wrapper .filters-unveil-button-wrapper .btn,
  #filters-wrapper .unveil-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 48px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--sc-ink, #24302A) !important;
    color: #FFFFFF !important;
    font-family: var(--sc-font-head, "Nunito", sans-serif) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
  }

  #filters-wrapper .unveil-button * {
    color: #FFFFFF !important;
  }

  #filters {
    margin-top: 10px !important;
    padding: 18px !important;
    border-radius: var(--sc-r-md, 20px) !important;
  }

  #filters .filter-label {
    min-height: 44px !important; /* pohodlné ťuknutí prstem */
  }
}

/* Barevné tečky u barev – anglická a polská verze webu */
#filters input[value="White"] + .filter-label,
#filters input[value="Natural"] + .filter-label,
#filters input[value="Grey"] + .filter-label,
#filters input[value="No surface treatment"] + .filter-label,
#filters input[value="ECO - without surface treatment"] + .filter-label,
#filters input[value="biały"] + .filter-label,
#filters input[value="naturalny"] + .filter-label,
#filters input[value="szary"] + .filter-label,
#filters input[value="bez obróbki powierzchni"] + .filter-label,
#filters input[value="ECO – bez obróbki powierzchni"] + .filter-label {
  padding-left: 58px !important;
}
#filters input[value="White"] + .filter-label > .filter-count::before,
#filters input[value="Natural"] + .filter-label > .filter-count::before,
#filters input[value="Grey"] + .filter-label > .filter-count::before,
#filters input[value="No surface treatment"] + .filter-label > .filter-count::before,
#filters input[value="ECO - without surface treatment"] + .filter-label > .filter-count::before,
#filters input[value="biały"] + .filter-label > .filter-count::before,
#filters input[value="naturalny"] + .filter-label > .filter-count::before,
#filters input[value="szary"] + .filter-label > .filter-count::before,
#filters input[value="bez obróbki powierzchni"] + .filter-label > .filter-count::before,
#filters input[value="ECO – bez obróbki powierzchni"] + .filter-label > .filter-count::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--sc-line-strong, #E6DFD5);
  transform: translateY(-50%);
  box-sizing: border-box;
}
#filters input[value="White"] + .filter-label > .filter-count::before { background: #FFFFFF; }
#filters input[value="Natural"] + .filter-label > .filter-count::before { background: #D9B98C; }
#filters input[value="Grey"] + .filter-label > .filter-count::before { background: #9A9E9B; }
#filters input[value="No surface treatment"] + .filter-label > .filter-count::before { background: #EEDCBC; }
#filters input[value="ECO - without surface treatment"] + .filter-label > .filter-count::before { background: #EEDCBC; }
#filters input[value="biały"] + .filter-label > .filter-count::before { background: #FFFFFF; }
#filters input[value="naturalny"] + .filter-label > .filter-count::before { background: #D9B98C; }
#filters input[value="szary"] + .filter-label > .filter-count::before { background: #9A9E9B; }
#filters input[value="bez obróbki powierzchni"] + .filter-label > .filter-count::before { background: #EEDCBC; }
#filters input[value="ECO – bez obróbki powierzchni"] + .filter-label > .filter-count::before { background: #EEDCBC; }

