/**
 * Catalog public — filtre sidebar, toolbar, pills (Bootstrap / Phoenix + token-uri AP).
 * Folosit pe /catalog/ și /catalog/<categorie>/.
 */

.catalog-filter-panel .catalog-filter-group {
  border-radius: 0.65rem !important;
}

.catalog-filter-group__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ap-green);
}

.catalog-filter-cat-scroll {
  max-height: 16rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.catalog-filter-cat-link {
  color: var(--phoenix-body-color);
  transition: background 0.12s ease;
  border-left: 3px solid transparent;
}

.catalog-filter-cat-link:hover {
  background: var(--ap-green-sub);
}

.catalog-filter-cat-link.is-active {
  background: var(--ap-green-sub);
  color: var(--ap-green) !important;
  font-weight: 600;
  border-left-color: var(--ap-green);
}

.catalog-filter-cat-count {
  background: var(--ap-green-sub);
  color: var(--ap-green);
  font-weight: 500;
}

.catalog-filter-link-reset {
  color: var(--ap-green) !important;
  font-weight: 600;
}

.catalog-filter-btn-apply {
  background: var(--ap-green) !important;
  border-color: var(--ap-green) !important;
}

.catalog-filter-btn-apply:hover {
  filter: brightness(0.95);
  color: #fff !important;
}

.catalog-filter-brand-select {
  min-height: 2.5rem;
  width: 100%;
}

/* Branduri — grilă cu checkbox (selecție unică), scroll dacă lista e lungă */
.catalog-filter-brands-grid {
  max-height: 20rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.catalog-filter-brands-grid .form-check {
  min-height: 1.35rem;
}

.catalog-filter-brands-grid .form-check-label {
  cursor: pointer;
  line-height: 1.35;
}

/* Preț — pastile rapide */
.price-pill {
  background: var(--phoenix-secondary-bg);
  color: var(--phoenix-body-color);
  border: 1px solid var(--phoenix-border-color);
  border-radius: 2rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  text-decoration: none;
  transition: 0.15s;
  display: inline-block;
}

.price-pill:hover,
.price-pill.active {
  background: var(--ap-green);
  color: #fff;
  border-color: var(--ap-green);
}

/* Toolbar listă */
.catalog-toolbar {
  background: var(--phoenix-body-bg);
  border: 1px solid var(--phoenix-border-color);
  border-radius: 0.65rem;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
}

.filter-pill {
  background: var(--ap-green-sub);
  color: var(--ap-green);
  border: 1px solid var(--ap-green-muted);
  border-radius: 2rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: 0.15s;
}

.filter-pill:hover {
  background: var(--ap-green);
  color: #fff;
}

.view-toggle-btn.active {
  background: var(--ap-green) !important;
  color: #fff !important;
  border-color: var(--ap-green) !important;
}

.pagination .page-item.active .page-link {
  background-color: var(--ap-green) !important;
  border-color: var(--ap-green) !important;
}

.pagination .page-link {
  color: var(--ap-green);
}

.pagination .page-link:hover {
  background: var(--ap-green-sub);
  color: var(--ap-green);
}

/* Grilă / listă */
#catalogGrid.list-view > .col-12.col-sm-6,
#catalogGridCat.list-view > .col-12.col-sm-6 {
  flex: 0 0 100%;
  max-width: 100%;
}

#catalogGrid.list-view .product-card,
#catalogGridCat.list-view .product-card {
  flex-direction: row !important;
}

#catalogGrid.list-view .product-card .card-img-top,
#catalogGridCat.list-view .product-card .card-img-top {
  width: 120px;
  height: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Offcanvas filtre — lățime fluidă pe mobil */
.catalog-filter-offcanvas {
  width: min(92vw, 22rem) !important;
  max-width: 100%;
}

/* Căutare în header — nu depășește ecranul mic */
.pub-catalog-search .input-group {
  flex-wrap: nowrap;
}

@media (max-width: 575.98px) {
  .pub-page-header .d-flex.gap-2 {
    width: 100%;
  }

  .pub-catalog-search {
    flex: 1 1 100%;
    min-width: 0;
  }

  .pub-catalog-search .form-control {
    min-width: 0;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch !important;
  }

  .catalog-toolbar > .d-flex {
    justify-content: space-between;
  }
}
