/*
 * BiCroma kategorie — vizual vypisu.
 * Vychazi z promennych a prvku sablony Samba stejne jako bicroma-homepage_1.css.
 * Zadny novy vizualni jazyk: rozcestnik prebira plochu kartu z homepage
 * (.bicroma-care-guide__card), USP si nechavaji svuj globalni styl
 * a upravuje se jen hustota a poradi.
 */

/* ---------- Hlavicka ---------- */
/* H1 mel 48 px proti 14px menu, tedy 3,4x — mimo meritko webu.
   Blok zustava centrovany jako zbytek sablony, jen v ctecí sirce,
   aby radky nebyly pres celych 1408 px. */

body.type-category .category-top {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Sablona zarovnani vnucuje z cross-origin stylopisu s ID selektorem;
   dve ID drzi vysledek nezavisle na poradi nacteni. */
body.type-category #content-wrapper #content .category-title,
body.type-category #content-wrapper #content .category-perex,
body.type-category #content-wrapper #content .category-perex *,
body.type-category #content-wrapper #content .category-perex p {
  text-align: center;
}

body.type-category h1.category-title {
  max-width: 860px;
  margin: 0 auto 8px;
  font-size: 30px;
  line-height: 36px;
  letter-spacing: 0.02em;
}

body.type-category .category-perex {
  max-width: 860px;
  margin: 0 auto;
}

body.type-category #content .category-perex h2,
body.type-category #content .category-perex h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 23px;
  letter-spacing: 0.01em;
}

body.type-category #content .category-perex p {
  margin: 0 0 6px;
  color: var(--bc-muted);
  font-size: 15px;
  line-height: 23px;
  text-align: center;
}

body.type-category .category-perex > *:last-child {
  margin-bottom: 0;
}

/* ---------- Rozcestnik podkategorii ---------- */
/* Nativne: li.col-* > a > span.image > img + span.text.
   Thumb je 140x100; v male vodorovne karte se vykresluje pod svoji
   prirozenou velikosti, takze zustava ostry. */

body.type-category .subcategories.bicroma-category-tiles {
  display: grid;
  grid-template-columns: repeat(min(var(--bc-tile-count, 4), 4), minmax(0, 1fr));
  gap: 12px;
  /* Bez stropu se dve podkategorie roztahnou na 698 px a nazev plave
     v prazdne plose. Strop drzi dlazdici na 340 px bez ohledu na pocet. */
  max-width: calc(min(var(--bc-tile-count, 4), 4) * 340px + (min(var(--bc-tile-count, 4), 4) - 1) * 12px);
  margin: 22px auto 12px;
  padding: 0;
  list-style: none;
}

body.type-category .bicroma-category-tiles > li {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  float: none;
  list-style: none;
}

body.type-category ul.subcategories.bicroma-category-tiles > li > a {
  display: flex;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: var(--bc-surface-soft);
  color: var(--bc-text);
  text-align: left;
  text-decoration: none;
  transition: background-color var(--transition-duration, 0.3s) var(--transition-timing, ease-out);
}

body.type-category ul.subcategories.bicroma-category-tiles > li > a:hover,
body.type-category ul.subcategories.bicroma-category-tiles > li > a:focus-visible {
  background: var(--bc-surface-soft-strong);
  color: var(--bc-text);
  text-decoration: none;
}

body.type-category ul.subcategories.bicroma-category-tiles > li > a > .image {
  display: block;
  width: 84px;
  height: 60px;
  flex: 0 0 84px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.type-category ul.subcategories.bicroma-category-tiles > li > a > .image > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

body.type-category ul.subcategories.bicroma-category-tiles .text {
  display: block;
  min-width: 0;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: var(--bc-heading);
  font-family: var(--bc-font-heading), sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 22px;
  letter-spacing: 0.025em;
  text-transform: none;
  white-space: normal;
  overflow-wrap: break-word;
  -webkit-line-clamp: none;
}

/* Nativni sipka je glyf ikonoveho fontu v a::before, absolutne vpravo. */
body.type-category .bicroma-category-tiles > li > a::before,
body.type-category .bicroma-category-tiles > li > a::after {
  content: none;
  display: none;
}

/* ---------- USP ---------- */
/* Blok si nechava globalni styl z bicroma-homepage_1.css. Je to Shoptet
   .full-width (position:relative + left:50% + margin-left:-50vw); v novem
   kontextu prezije jen left:50%, proto se posun cileně rusi. */
body.type-category .bicroma-category-usp {
  position: static;
  left: auto;
  right: auto;
  width: 100%;
  max-width: 100%;
  /* Nasedaji primo na nejprodavanejsi i na vypis — zadne mezery. */
  margin: 0;
}

body.type-category .bicroma-category-usp .benefitBanner {
  padding: 16px 0;
  gap: 24px;
}

body.type-category .bicroma-category-usp .benefitBanner__item {
  padding: 0 12px;
}

/* ---------- Nejprodavanejsi nad vypisem ---------- */
/* Blok pusobil neukotvene a lepil se na USP. Vlastni vlasova linka nahore
   ho oddeli od rozcestniku, spodni mezera od USP. Nadpis sekce se srovnava
   pod H1 stranky, aby neprebijel hlavni nadpis. */
body.type-category .bicroma-category-bestsellers {
  /* Sablona nad blokem uz vlastni vlasovou linku kresli — nedublovat. */
  margin: 26px 0 32px;
  padding-top: 0;
}

body.type-category .bicroma-category-bestsellers > *:first-child {
  margin-top: 0;
}

/* .products-top-header je primo ten h2, ne jeho obal. */
body.type-category #content-wrapper #content .bicroma-category-bestsellers h2.products-top-header,
body.type-category #content-wrapper #content .bicroma-category-bestsellers .products-top-header {
  /* Vlasovou linku kresli sam nadpis pres border-top, takze horni padding
     je odstup textu od cary — nesmi se nulovat, jen zmensit z 32 px. */
  margin: 0 0 14px;
  padding-top: 22px;
  font-size: 19px;
  font-weight: 700;
  line-height: 25px;
  letter-spacing: 0.02em;
  text-align: center;
}

body.type-category .bicroma-category-bestsellers .button-wrapper {
  margin: 12px 0 0;
}

/* ---------- Razeni ---------- */
body.type-category .bicroma-category-sorting {
  padding-top: 0;
}

/* Nativni zalozky Samby zustavaji beze zmeny; na mobilu se jen srovnaji
   do jedne vodorovne posuvne rady misto peti radku pod sebou. */
@media (max-width: 767px) {
  body.type-category .bicroma-category-sorting,
  body.type-category .bicroma-category-sorting .listSorting,
  body.type-category .bicroma-category-sorting .listSorting__controls {
    min-width: 0;
    max-width: 100%;
  }

  body.type-category .bicroma-category-sorting .listSorting__controls {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  body.type-category .bicroma-category-sorting .listSorting__controls::-webkit-scrollbar {
    display: none;
  }

  body.type-category .bicroma-category-sorting .listSorting__controls > li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

/* ---------- Popis pod vypisem ---------- */
/* Byl siroky 1408 px a lezel volne za ovladacimi prvky vypisu. Stejna mekka
   plocha jako USP z nej dela zamerny oddil, ne nalepeny text. */
body.type-category .bicroma-category-more {
  /* Horni odsazeni bylo nepomerne ke spodnimu kvuli marginu prvniho odstavce.
     Bez spodniho marginu blok narazil primo do bezove paticky. */
  margin: 36px 0 56px;
  padding: 28px 0 0;
  border-top: 1px solid var(--bc-border);
  color: var(--bc-muted);
  font-size: 15px;
  line-height: 23px;
}

body.type-category #content-wrapper #content .bicroma-category-more,
body.type-category #content-wrapper #content .bicroma-category-more * {
  text-align: center;
}

body.type-category .bicroma-category-more > * {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

body.type-category .bicroma-category-more > *:first-child {
  margin-top: 0;
}

body.type-category .bicroma-category-more > *:last-child {
  margin-bottom: 0;
}

/* ---------- Mobil ---------- */
@media (max-width: 991px) {
  body.type-category .subcategories.bicroma-category-tiles {
    grid-template-columns: repeat(min(var(--bc-tile-count, 2), 2), minmax(0, 1fr));
    gap: 10px;
  }

  body.type-category #content-wrapper #content .bicroma-category-usp .benefitBanner__title {
    text-align: left;
  }

  /* Ctyri jistoty se pres sebe skladaly do 442 px; vedle ikony a bez
     doplnkoveho popisu se vejdou do dvou rad. */
  body.type-category .bicroma-category-usp .benefitBanner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    padding: 14px 0;
  }

  body.type-category .bicroma-category-usp .benefitBanner__item {
    display: flex;
    /* Sablona polozku na uzkych sirkach prepina na sloupec. */
    flex-direction: row;
    align-items: center;
    /* Bez zarovnani na zacatek se kratsi polozka v bunce vycentruje
       a jeji ikona ujede oproti sousedni rade. */
    justify-content: flex-start;
    gap: 10px;
    padding: 0 6px;
    text-align: left;
  }

  body.type-category .bicroma-category-usp .benefitBanner__content {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.type-category .bicroma-category-usp .benefitBanner__picture {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    margin: 0;
  }

  body.type-category .bicroma-category-usp .benefitBanner__img {
    width: 30px;
    height: 30px;
  }

  body.type-category .bicroma-category-usp .benefitBanner__title {
    margin: 0;
    font-size: 13px;
    line-height: 17px;
  }

  body.type-category .bicroma-category-usp .benefitBanner__data {
    display: none;
  }

  body.type-category .bicroma-category-bestsellers {
    margin: 20px 0 24px;
    padding-top: 0;
  }

  body.type-category #content-wrapper #content .bicroma-category-bestsellers .products-top-header {
    margin-bottom: 8px;
    padding-top: 18px;
  }

  /* Odkaz na dalsi produkty je nad vypisem tehoz katalogu duplicitni cesta
     a zabiral 62 px prvni obrazovky. */
  body.type-category .bicroma-category-bestsellers .button-wrapper {
    display: none;
  }

  /* Radky karty se stahnou obrazkem a mensim odsazenim, rozvrzeni zustava. */
  body.type-category .bicroma-category-bestsellers .products-inline > .product {
    padding-top: 4px;
    margin-bottom: 4px;
  }

  body.type-category .bicroma-category-bestsellers .products-inline img {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 640px) {
  body.type-category h1.category-title {
    margin-bottom: 8px;
  }

  /* Dva sloupce lamaly nazvy na tri radky — na telefonu jedna dlazdice na radek. */
  body.type-category .subcategories.bicroma-category-tiles {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
    margin: 20px 0 20px;
  }

  body.type-category ul.subcategories.bicroma-category-tiles > li > a {
    gap: 10px;
    padding: 10px 12px;
  }

  body.type-category ul.subcategories.bicroma-category-tiles > li > a > .image {
    width: 64px;
    height: 46px;
    flex: 0 0 64px;
  }

  body.type-category ul.subcategories.bicroma-category-tiles .text {
    font-size: 15px;
    line-height: 19px;
  }

  /* Vypis ma na USP navazovat stejne jako na desktopu. */
  body.type-category .bicroma-category-usp {
    margin-bottom: 0;
  }

  body.type-category .bicroma-category-more {
    margin: 32px 0 36px;
    padding: 20px 16px;
  }
}

