/* ==============================================================
   TEKY / Weideng v5 — compact sticky product category sidebar
   ============================================================== */

/* Keep the two catalogue columns aligned at the top. Gutenberg's
   columns block may otherwise stretch the sidebar to the full height
   of the product grid. */
.wp-block-columns.catalog-layout.classic-catalog {
  align-items: flex-start !important;
}

/* Desktop: the category box is only as tall as its own content and
   follows the viewport while the visitor scrolls through products. */
.catalog-layout.classic-catalog > .catalog-sidebar.wp-block-column,
.catalog-sidebar.wp-block-column {
  position: sticky !important;
  top: 106px !important;
  align-self: flex-start !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: calc(100vh - 126px) !important;
  flex: 0 0 230px !important;
  flex-grow: 0 !important;
  overflow: auto !important;
}

.catalog-sidebar .sidebar-heading {
  padding: 17px 18px 12px !important;
  font-size: 19px !important;
  line-height: 1.15 !important;
}

.catalog-sidebar .product-category-list {
  padding: 0 10px 12px !important;
}

.catalog-sidebar .product-category-list a {
  min-height: 38px !important;
  padding: 7px 9px !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
}

.catalog-sidebar .product-category-list a:hover,
.catalog-sidebar .product-category-list a.is-active {
  padding-left: 12px !important;
}

.catalog-sidebar .product-category-list a:after {
  font-size: 17px !important;
}

/* Thin scrollbar only when a very small laptop viewport requires it. */
.catalog-sidebar {
  scrollbar-width: thin;
}
.catalog-sidebar::-webkit-scrollbar { width: 5px; }
.catalog-sidebar::-webkit-scrollbar-thumb {
  background: rgba(5,7,8,.18);
  border-radius: 999px;
}

/* Tablet/mobile: make it a normal compact block; sticky sidebars are
   intentionally disabled once the catalogue becomes one column. */
@media (max-width: 1024px) {
  .catalog-layout.classic-catalog > .catalog-sidebar.wp-block-column,
  .catalog-sidebar.wp-block-column {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-height: none !important;
    flex-basis: auto !important;
    overflow: visible !important;
  }
}
