/* path: wp-content/themes/bedrebyttede/assets/css/components/category-select.css */

/* Compact Wrapping Grid for Category Groups (Parents) */
.bb-cat-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  /* Prevent blowout */
  width: 100%;
  min-width: 0;
}

/* 3-Row Horizontal Grid for Category Groups (Parents) */
.bb-cat-parents-scroll {
  overflow-x: auto;
  /* Enable horizontal scroll */
  overflow-y: hidden;
  margin: 0 calc(var(--space-5) * -1);
  /* Full width bleed */
  padding: var(--space-4) var(--space-5);
  -webkit-overflow-scrolling: touch;
  scroll-padding-left: var(--space-5);
}

.bb-cat-parents {
  display: grid;
  grid-template-rows: repeat(3, min-content);
  /* 3 rows fixed */
  grid-auto-flow: column;
  /* Flow columns */
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  /* Scrollbar clearance */
  width: max-content;
  /* Allow growing horizontally */
}

.bb-cat-parent-btn {
  display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 200px;
    height: 32px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-2);
    background: var(--bg);
    border: 1px solid var(--line);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: capitalize;
    color: var(--text-3);
    cursor: pointer;
    transition: all var(--dur-2) var(--ease-out);
    text-align: left;
    position: relative;
}

.bb-cat-parent-btn i {
  font-size: var(--fs-lg);
  opacity: 0.7;
  flex-shrink: 0;
}

.bb-cat-parent-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Parent Button Active & Badge States */
.bb-cat-parent-btn.is-active {
  background: var(--surface-2);
  border-color: var(--text);
  color: var(--text);
}

.bb-cat-parent-btn.is-active i {
  opacity: 1;
}

/* Badge for counts */
.bb-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 6px;
  background: var(--brand);
  color: var(--text-w-bg);
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  margin-left: auto;
  /* Push to right */
}

.bb-cat-parent-btn.has-selection {
  border-color: var(--brand);
  color: var(--brand-700);
  background: var(--brand-50);
}

.bb-cat-parent-btn.has-selection i {
  color: var(--brand);
  opacity: 1;
}

/* Children Grid */
.bb-cat-children {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.bb-cat-children[hidden] {
  display: none !important;
}

.bb-cat-child-btn {
  display: flex;
  align-items: center;
  justify-content: start;
  min-height: 48px;
  padding: var(--space-2) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--dur-2) var(--ease-out);
  text-align: center;
  cursor: pointer;
}

.bb-cat-child-btn.is-selected {
  border-color: var(--brand);
  color: var(--text);
}

/* Selected Category Pills */
.bb-filter-selected-cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  min-height: 32px;
  width: 100%;
  min-width: 0;
}

.bb-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand-700);
  cursor: pointer;
  transition: all var(--dur-2);
}

.bb-cat-pill:hover {
  background: var(--brand-100);
}

.bb-cat-pill__remove {
  font-size: 1.2em;
  opacity: 0.6;
}

/* Specification Tabs */
.bb-spec-tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-1) 0;
  margin-bottom: var(--space-4);
  -webkit-overflow-scrolling: touch;
}

.bb-spec-tab {
  white-space: nowrap;
  padding: var(--space-2) var(--space-5);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur-2) var(--ease-out);
}

.bb-spec-tab.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.bb-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

.bb-tab.is-active .bb-tab-badge {
  box-shadow: 0 0 0 1px var(--text);
}

.bb-spec-pane {
  display: none;
}

.bb-spec-pane.is-active {
  display: grid;
  gap: var(--space-4);
}

/* Multi-enum checkbox list (Specifications) */
.bb-spec-multi-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

/* Range Inputs in Specs */
.bb-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}