/**
 * bububu.sk — produktové kategórie / desktop
 * Shoptet Classic: natívne textové podkategórie, skryté kategórie
 * v sidebare a sidebar umiestnený pod podkategóriami.
 * Načítať ako posledný bububu CSS súbor.
 */

@media (min-width: 992px) {
  body.type-category {
    --bb-category-gutter: clamp(24px, 2.5vw, 48px);
    --bb-filter-width: clamp(240px, 17vw, 280px);
    --bb-column-gap: clamp(28px, 3vw, 48px);
    --bb-border: #d7d9d4;
    --bb-surface: #f6f6f2;
    --bb-text: #171717;
    --bb-muted: #62645f;
    --bb-accent: #d34343;
  }

  /* Rozšírenie iba produktových kategórií. */
  body.type-category #content-wrapper.container {
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: var(--bb-category-gutter) !important;
  }

  body.type-category #content-wrapper > .content-wrapper-in,
  body.type-category #content-wrapper main#content.content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Natívna Classic štruktúra po voľbe „sidebar pod podkategóriami“. */
  body.type-category #content-wrapper main#content.content {
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--bb-column-gap);
    align-items: flex-start;
  }

  body.type-category #content > .category-top {
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  body.type-category #content > .sidebar.sidebar-left {
    flex: 0 0 var(--bb-filter-width);
    width: var(--bb-filter-width);
    min-width: 0;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body.type-category #content > .category-content-wrapper {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
  }

  /* Natívny filter zostáva plne funkčný. */
  body.type-category .sidebar.sidebar-left .box-filters,
  body.type-category .sidebar.sidebar-left .sidebar-inner,
  body.type-category .sidebar.sidebar-left .filters-wrapper,
  body.type-category .sidebar.sidebar-left #filters.filters,
  body.type-category .sidebar.sidebar-left .filter-sections,
  body.type-category .sidebar.sidebar-left .filter-section {
    width: 100%;
    margin-inline: 0;
    background: #fff !important;
  }

  body.type-category .sidebar.sidebar-left .box-filters {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.type-category .sidebar.sidebar-left #filters.filters {
    padding: 0;
    border: 0;
    background: #fff;
  }

  /* H1 a krátky horný popis. */
  body.type-category #content .category-top > .category-title {
    margin: 0 0 22px;
    color: var(--bb-text);
    font-size: clamp(38px, 3.5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    text-align: left;
  }

  body.type-category #content .category-perex {
    width: 100%;
    max-width: 1040px;
    margin: 0 0 30px;
    color: var(--bb-muted);
    font-size: 17px;
    line-height: 1.65;
  }

  body.type-category #content .category-perex > :first-child {
    margin-top: 0;
  }

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

  /* Shoptet už generuje textové odkazy; CSS mení iba ich vizuál. */
  body.type-category #content .category-top > .subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    width: 100%;
    margin: 0 0 38px;
    padding: 0;
    border-block: 1px solid var(--bb-border);
    list-style: none;
  }

  body.type-category #content .category-top > .subcategories > li {
    float: none;
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.type-category #content .category-top > .subcategories > li > a {
    display: inline-flex;
    align-items: center;
    min-height: 54px;
    padding: 0 20px;
    border: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--bb-text);
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    transition: color 160ms ease, background-color 160ms ease;
  }

  body.type-category #content .category-top > .subcategories > li > a:hover,
  body.type-category #content .category-top > .subcategories > li > a:focus-visible {
    color: var(--bb-text);
    background: transparent;
    text-decoration: underline;
    text-decoration-color: var(--bb-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 7px;
  }

  body.type-category #content .category-top > .subcategories > li > a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
  }

  body.type-category #content #category-header,
  body.type-category #content #products.products,
  body.type-category #content .listingControls,
  body.type-category #content .category__secondDescription {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }

  body.type-category #content #category-header {
    margin-bottom: 24px;
    border-block: 1px solid var(--bb-border);
    background: #fff;
  }

  body.type-category #content #category-header,
  body.type-category #content #category-header .listSorting__controls {
    flex-wrap: wrap;
  }

  body.type-category #content #products.products > .product {
    flex: 0 0 33.333333%;
    width: 33.333333%;
    max-width: 33.333333%;
    min-width: 0;
    border: 0 !important;
    box-shadow: none !important;
  }

  /* Patagonia-like filter headings: clean white rows, arrow on the right. */
  body.type-category .sidebar.sidebar-left #filters .filter-section > h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 14px 32px 14px 0;
    border: 0;
    border-bottom: 1px solid var(--bb-border);
    background: #fff !important;
    color: var(--bb-text);
    font-size: 15px;
    line-height: 1.35;
    cursor: pointer;
  }

  body.type-category .sidebar.sidebar-left #filters .filter-section > h4::before {
    content: none !important;
  }

  body.type-category .sidebar.sidebar-left #filters .filter-section > h4::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 4px;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 160ms ease;
  }

  body.type-category .sidebar.sidebar-left #filters .filter-section.otevreny > h4::after {
    transform: translateY(-30%) rotate(225deg);
  }

  body.type-category #content .category__secondDescription {
    margin-top: 72px;
  }

  body.type-category #content #category-header .listSorting__control:focus-visible,
  body.type-category .sidebar.sidebar-left input[type="checkbox"]:focus-visible + label {
    outline: 2px solid var(--bb-accent);
    outline-offset: 2px;
  }
}
