/**
 * bububu.sk — mobilné kategórie
 * Načítajte po desktop CSS a po bububu-category-sorting.css.
 */

@media (max-width: 991px) {
  body.type-category {
    --bb-mobile-pad: 16px;
    --bb-red: #d34343;
    --bb-charcoal: #211f1d;
    --bb-line: #deded9;
    --bb-ink: #171717;
  }

  body.type-category #content-wrapper,
  body.type-category .content-wrapper-in,
  body.type-category #content {
    max-width: none !important;
  }

  body.type-category #content {
    padding-inline: var(--bb-mobile-pad) !important;
  }

  body.type-category .category-top {
    margin-inline: 0 !important;
  }

  body.type-category .category-top h1 {
    margin-bottom: 16px;
    font-size: clamp(34px, 10vw, 46px);
    line-height: 1.02;
    letter-spacing: -0.035em;
  }

  body.type-category .category-perex,
  body.type-category .category-top .category-perex {
    margin-bottom: 24px;
    font-size: 17px;
    line-height: 1.5;
  }

  /* Textové podkategórie ako vodorovný pás. */
  body.type-category .subcategories {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 26px;
    width: calc(100% + (2 * var(--bb-mobile-pad)));
    max-width: none !important;
    margin: 0 calc(-1 * var(--bb-mobile-pad)) 0 !important;
    padding: 0 var(--bb-mobile-pad) 14px !important;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0 !important;
    border-bottom: 1px solid var(--bb-line) !important;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.type-category .subcategories::-webkit-scrollbar {
    display: none;
  }

  body.type-category .subcategories > li {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    scroll-snap-align: start;
  }

  body.type-category .subcategories > li > a {
    display: block !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 10px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--bb-ink) !important;
  }

  body.type-category .subcategories .text {
    color: inherit !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 24px !important;
    white-space: nowrap;
  }

  /* Pôvodnú hlavičku skry až po úspešnom vytvorení mobilného drawera. */
  body.type-category.bb-mobile-category-ready #category-header {
    display: none !important;
  }

  body.type-category .bb-mobile-category-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    margin: 0;
    padding: 10px 0;
  }

  body.type-category .bb-mobile-item-count {
    color: var(--bb-ink);
    font-size: 15px;
    white-space: nowrap;
  }

  body.type-category .bb-mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 0 8px 12px;
    border: 0;
    background: transparent;
    color: var(--bb-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
  }

  body.type-category .bb-mobile-filter-trigger i,
  body.type-category .bb-mobile-filter-trigger i::before {
    display: block;
    width: 18px;
    height: 12px;
    content: "";
    background: linear-gradient(var(--bb-ink), var(--bb-ink)) 0 2px / 18px 2px no-repeat,
      linear-gradient(var(--bb-ink), var(--bb-ink)) 0 9px / 18px 2px no-repeat;
  }

  body.type-category .bb-mobile-filter-trigger i::before {
    width: 4px;
    height: 4px;
    margin: 0 0 0 4px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--bb-ink);
    box-shadow: 7px 7px 0 -2px var(--bb-ink), 7px 7px 0 0 #fff;
  }

  body.bb-mobile-filter-open {
    overflow: hidden !important;
  }

  body.type-category .bb-mobile-filter-drawer {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    visibility: hidden;
    background: #fff;
    color: var(--bb-ink);
    opacity: 0;
    transform: translateX(100%);
    transition: transform 220ms ease, opacity 220ms ease, visibility 220ms;
  }

  body.type-category .bb-mobile-filter-drawer.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }

  body.type-category .bb-mobile-filter-head {
    display: grid;
    grid-template-columns: 1fr auto 44px;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--bb-line);
  }

  body.type-category .bb-mobile-filter-head h2 {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  body.type-category .bb-mobile-filter-clear {
    color: var(--bb-ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  body.type-category .bb-mobile-filter-close {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.type-category .bb-mobile-filter-close::before,
  body.type-category .bb-mobile-filter-close::after {
    position: absolute;
    top: 21px;
    left: 11px;
    width: 22px;
    height: 2px;
    content: "";
    background: var(--bb-ink);
    transform: rotate(45deg);
  }

  body.type-category .bb-mobile-filter-close::after {
    transform: rotate(-45deg);
  }

  body.type-category .bb-mobile-filter-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 18px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.type-category .bb-mobile-filter-drawer .listSorting {
    position: relative !important;
    width: auto !important;
    margin: 0 !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .bb-sort-toggle {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 54px;
    padding: 15px 42px 15px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--bb-line) !important;
    background: #fff !important;
    box-shadow: none !important;
    text-align: left !important;
    font-size: 16px;
    font-weight: 400;
  }

  body.type-category .bb-mobile-filter-drawer .bb-sort-toggle::before {
    content: none !important;
    display: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .bb-sort-toggle::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    right: 3px !important;
    left: auto !important;
    display: block !important;
    width: 9px !important;
    height: 9px !important;
    margin: 0 !important;
    border: 0 !important;
    border-right: 2px solid var(--bb-ink) !important;
    border-bottom: 2px solid var(--bb-ink) !important;
    background: transparent !important;
    transform: translateY(-70%) rotate(45deg) !important;
    transform-origin: center !important;
    pointer-events: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .listSorting__controls {
    position: static !important;
    display: none;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 0 10px !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .listSorting.bb-sort-open .listSorting__controls {
    display: block;
  }

  body.type-category .bb-mobile-filter-drawer .sidebar {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }

  body.type-category .bb-mobile-filter-drawer .sidebar-inner,
  body.type-category .bb-mobile-filter-drawer .box-filters,
  body.type-category .bb-mobile-filter-drawer .filters-wrapper,
  body.type-category .bb-mobile-filter-drawer #filters {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: 0 !important;
  }

  /* Shoptet dáva týmto obalom sivé pozadie, ktoré presvitá okolo sekcií. */
  body.type-category .bb-mobile-filter-drawer .filter-sections,
  body.type-category .bb-mobile-filter-drawer #category-filter-hover,
  body.type-category .bb-mobile-filter-drawer #category-filter-hover.visible {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .filter-section-boolean {
    margin: 0 !important;
    padding: 0;
    border: 0 !important;
    border-bottom: 1px solid var(--bb-line) !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .bb-boolean-toggle {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 54px;
    padding: 15px 42px 15px 0;
    border: 0;
    border-bottom: 1px solid var(--bb-line);
    background: #fff;
    color: var(--bb-ink);
    font: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
  }

  body.type-category .bb-mobile-filter-drawer .bb-boolean-toggle i {
    position: absolute;
    top: 50%;
    right: 3px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--bb-ink);
    border-bottom: 2px solid var(--bb-ink);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 160ms ease;
  }

  body.type-category .bb-mobile-filter-drawer .filter-section-boolean:not(.bb-boolean-collapsed) .bb-boolean-toggle i {
    transform: translateY(-30%) rotate(225deg);
  }

  body.type-category .bb-mobile-filter-drawer .filter-section-boolean.bb-boolean-collapsed > :not(.bb-boolean-toggle) {
    display: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .filter-section-boolean:not(.bb-boolean-collapsed) > :not(.bb-boolean-toggle) {
    margin: 0 !important;
    padding: 14px 0 16px !important;
  }

  body.type-category .bb-mobile-filter-drawer .filter-section,
  body.type-category .bb-mobile-filter-drawer .slider-wrapper {
    margin: 0 !important;
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: 0 !important;
  }

  body.type-category .bb-mobile-filter-drawer .filter-section form,
  body.type-category .bb-mobile-filter-drawer .filter-section-content {
    border: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.type-category .bb-mobile-filter-drawer .filter-section h4,
  body.type-category .bb-mobile-filter-drawer .slider-wrapper h4 {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 54px;
    margin: 0 !important;
    padding: 15px 42px 15px 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--bb-line) !important;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    text-indent: 0 !important;
    text-transform: none !important;
    overflow: visible !important;
  }

  /* Remove the native left-hand marker that overlaps the first letter. */
  body.type-category .bb-mobile-filter-drawer .filter-section h4::before,
  body.type-category .bb-mobile-filter-drawer .slider-wrapper h4::before {
    content: none !important;
    display: none !important;
  }

  /* One consistent downward chevron on the right. */
  body.type-category .bb-mobile-filter-drawer .filter-section h4::after,
  body.type-category .bb-mobile-filter-drawer .slider-wrapper h4::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    right: 3px !important;
    left: auto !important;
    display: block !important;
    width: 9px !important;
    height: 9px !important;
    margin: 0 !important;
    border: 0 !important;
    border-right: 2px solid var(--bb-ink) !important;
    border-bottom: 2px solid var(--bb-ink) !important;
    background: transparent !important;
    transform: translateY(-70%) rotate(45deg) !important;
    transform-origin: center !important;
    pointer-events: none !important;
  }

  body.type-category .bb-mobile-filter-foot {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    padding: 14px 18px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--bb-line);
    background: #fff;
  }

  body.type-category .bb-mobile-filter-foot button {
    width: auto;
    min-width: min(270px, 100%);
    min-height: 48px;
    padding: 11px 28px;
    border: 0;
    border-radius: 7px;
    background: var(--bb-charcoal);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
  }

  /* Počet je už uvedený v CTA; natívny Shoptet údaj ho zbytočne duplikuje. */
  body.type-category .bb-mobile-filter-drawer .filter-total-count,
  body.type-category .bb-mobile-filter-drawer .listItemsTotal {
    display: none !important;
  }

  body.bb-mobile-filter-open .heureka-rating-mobile,
  body.bb-mobile-filter-open [class*="heureka"] {
    visibility: hidden !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.type-category .bb-mobile-filter-drawer {
    transition: none;
  }
}
