/**
 * Category Filters - Stiluri pentru filtrele È™i layout-ul paginii de categorie
 * Design similar cu cardurile de produse (.biomag-product-card)
 */

/* =====================================================
   FILTER SIDEBAR CONTAINER
   ===================================================== */
.filter-sidebar {
    padding: 0;
}

.filter-sidebar-wrapper {
    margin-left: calc(-1 * var(--bs-gutter-x) * .5);
}

/* =====================================================
   FILTER CARD - Container generic pentru fiecare filtru
   ===================================================== */
.filter-card {
    border-radius: var(--bm-radius);
    border: none;
    background: #fff;
    padding: var(--bm-padding-y) var(--bm-padding-x);
    margin-bottom: var(
    --bm-margin-x);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.filter-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: #333;
    text-transform: capitalize;
}

.filter-card-content {
    padding: 0;
}

/* Collapsed state pentru filtre cu multe opÈ›iuni */
.filter-card-content.filtcolapse {
    max-height: 210px; /* ~6 items x 35px */
    overflow: hidden;
    position: relative;
}

.filter-card-content.filtcolapse::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
}

.filter-card-content.filtcolapse.expanded {
    max-height: none;
}

.filter-card-content.filtcolapse.expanded::after {
    display: none;
}

/* =====================================================
   FILTER ITEMS - Elemente individuale din liste
   ===================================================== */
.filter-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    color: #444;
    font-size: 13px;
    background: transparent;
}

.filter-card-item:hover {
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    transform: translateX(2px);
}

.filter-card-item.active {
    background: color-mix(in srgb, var(--bm-green, var(--bm-green, #00a651)) 8%, transparent);
    color: var(--bs-primary, var(--bm-green, #00a651));
    font-weight: 500;
}

.filter-card-item.active:hover {
    background: color-mix(in srgb, var(--bm-green, var(--bm-green, #00a651)) 12%, transparent);
}

.filter-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-item-count {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
    flex-shrink: 0;
}

.filter-card-item.active .filter-item-count {
    color: var(--bs-primary, var(--bm-green, #00a651));
    opacity: 0.7;
}

/* =====================================================
   FILTER EXPAND BUTTON
   ===================================================== */
.filter-expand-btn {
    font-size: 12px;
    color: #666;
    cursor: pointer;
    background: #f8f9fa;
    border: none;
    transition: all 0.18s ease;
}

.filter-expand-btn:hover {
    color: var(--bs-primary, var(--bm-green, #00a651));
    background: color-mix(in srgb, var(--bm-green, var(--bm-green, #00a651)) 8%, transparent);
}

/* =====================================================
   CHILD CATEGORIES GRID - Boxuri deasupra produselor
   Stiluri similare cu cardurile de produs
   ===================================================== */
.child-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.child-category-box {
    width: calc(16.66% - 7px); /* 6 pe rÃ¢nd desktop */
    max-width: 160px;
    border-radius: 12px;
    border: none;
    background: #fff;
    padding: 0;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.18s ease-in-out,
                transform 0.18s ease-in-out;
}

.child-category-box:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    text-decoration: none;
    color: inherit;
}

.child-category-box:hover .child-category-name {
    color: var(--bs-primary, var(--bm-green, #00a651));
}

.child-category-box img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    padding: 8px;
    background: #fff;
}

.child-category-placeholder {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    color: #ddd;
}

.child-category-placeholder svg {
    width: 36px;
    height: 36px;
}

.child-category-info {
    padding: 8px 10px 10px;
    background: #fff;
}

.child-category-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.child-category-count {
    font-size: 11px;
    color: #888;
}

/* Responsive - Child Categories Grid */
@media (max-width: 1200px) {
    .child-category-box {
        width: calc(20% - 7px); /* 5 pe rÃ¢nd */
    }
}

@media (max-width: 992px) {
    .child-category-box {
        width: calc(25% - 6px); /* 4 pe rÃ¢nd tablet */
    }

    .child-category-box img {
        height: 90px;
    }

    .child-category-placeholder {
        height: 90px;
    }
}

@media (max-width: 768px) {
    .child-category-box {
        width: calc(33.33% - 6px); /* 3 pe rÃ¢nd mobil */
    }
}

@media (max-width: 480px) {
    .child-category-box {
        width: calc(50% - 4px); /* 2 pe rÃ¢nd mobil mic */
    }

    .child-category-box img {
        height: 80px;
        padding: 6px;
    }

    .child-category-placeholder {
        height: 80px;
    }

    .child-category-name {
        font-size: 12px;
    }

    .child-category-info {
        padding: 6px 8px 8px;
    }
}

/* =====================================================
   CATEGORY HEADER - Structured header with SEO elements
   ===================================================== */
.category-header {
    /* padding-bottom: 16px; */
    margin-bottom: var(--bm-margin-y);
    /* border-bottom: 1px solid #eee; */
}

/* Fără margine jos când există butonul „vezi mai mult" (îl gestionează el spațiul). */
.category-header:has(.category-header__description-toggle) {
    margin-bottom: 0;
}

.category-header__title {
    /* font-size: 1.4rem; */
    /* font-weight: 600; */
    color: var(--bs-primary, var(--bm-green, #00a651)) !important;
    margin-bottom: 4px;
}

.category-header__stats {
    font-size: 0.9rem;
    font-weight: 400;
    color: #444;
    margin-bottom: 4px;
}

.category-header__seo-h2 {
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
    margin-bottom: 2px;
}

.category-header__seo-h3 {
    font-size: 0.82rem;
    font-weight: 400;
    color: #999;
    margin-bottom: 8px;
}

/* Description collapsible */
.category-header__description {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Descrierea vine din sursă cu propriile titluri (h2/h3) și paragrafe. Le aducem
   la scara subtitlurilor din sursă (mici, gri) — altfel h2/h3 primesc mărimile
   default din browser (uriașe, șterse). */
.category-header__description :is(h1, h2, h3, h4, h5, h6) {
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
    margin: 12px 0 6px;
}
.category-header__description :is(h1, h2) {
    font-size: 1rem;
}
.category-header__description :is(h3, h4, h5, h6) {
    font-size: 0.92rem;
}
.category-header__description > :first-child {
    margin-top: 0;
}
.category-header__description p {
    margin: 0 0 10px;
}
.category-header__description p:last-child {
    margin-bottom: 0;
}
/* <br> lipit de un element bloc (ex. </h2><br/><h3>) e redundant și lasă rând gol;
   îl neutralizăm — blocurile își gestionează singure spațierea. */
.category-header__description :is(h1,h2,h3,h4,h5,h6,p,ul,ol,table,div) + br,
.category-header__description br:has(+ :is(h1,h2,h3,h4,h5,h6,p,ul,ol,table,div)) {
    display: none;
}
.category-header__description a {
    color: var(--bs-primary, var(--bm-green, #00a651));
    text-decoration: none;
}
.category-header__description a:hover {
    text-decoration: underline;
}

.category-header__description.collapsed {
    max-height: 5em;
}

.category-header__description.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4.5em;
    background: linear-gradient(to bottom, transparent 0%, var(--bm-green-soft, #f6f9f6) 85%);
    pointer-events: none;
}

.category-header__description:not(.collapsed)::after {
    display: none;
}

.category-header__description-toggle {
    display: inline-flex;
    align-items: center;
    width: auto;
    background: none;
    border: none;
    color: #999;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 2px;
    transition: color 0.18s ease;
}

/* Colapsat: butonul „vezi mai mult" stă PESTE gradient (gradientul rămâne dedesubt). */
.category-header__description.collapsed + .category-header__description-toggle {
    position: absolute;
    z-index: 1;
    margin-top: -2.2em;
}

.category-header__description-toggle:hover {
    color: var(--bs-primary, var(--bm-green, #00a651));
}

/* Legacy compatibility */
.category-title-section {
    margin-bottom: 16px;
}

.category-title {
    margin-bottom: 4px;
    color: #222;
}

.category-subtitle {
    color: #666;
    margin-bottom: 8px;
}

.category-product-count {
    font-size: 13px;
    color: #888;
}

/* =====================================================
   FILTER PRICE - Filtru preÈ›
   ===================================================== */
.filter-card .pretmin,
.filter-card .pretmax {
    max-width: 80px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    padding: 6px 8px;
    font-size: 13px;
    transition: border-color 0.18s ease;
}

.filter-card .pretmin:focus,
.filter-card .pretmax:focus {
    border-color: var(--bs-primary, var(--bm-green, #00a651));
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bm-green, var(--bm-green, #00a651)) 10%, transparent);
}

.filter-card .filtpret {
    flex-shrink: 0;
}

/* =====================================================
   FILTER CHECKBOXES - Stilizare checkbox-uri
   ===================================================== */
.filter-card .form-check {
    padding: 6px 8px;
    padding-left: 1.75em;
    margin-bottom: 2px;
    border-radius: 6px;
    transition: background 0.18s ease;
}

.filter-card .form-check.small {
    padding: 3px 8px;
    padding-left: 1.75rem;
}

.filter-card .form-check:hover {
    background: #f8f9fa;
}

.filter-card .form-check-input {
    border-radius: 4px;
    border: 1.5px solid #ccc;
    transition: all 0.18s ease;
    cursor: pointer;
    margin-top: 0.2em;
}

.filter-card .form-check-input:checked {
    background-color: var(--bs-primary, var(--bm-green, #00a651));
    border-color: var(--bs-primary, var(--bm-green, #00a651));
}

.filter-card .form-check-input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bm-green, var(--bm-green, #00a651)) 15%, transparent);
}

.filter-card .form-check-label {
    color: #444;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.18s ease;
    text-decoration: none;
}

.filter-card .form-check:hover .form-check-label {
    color: #333;
}

.filter-card .form-check-input:checked + .form-check-label {
    color: var(--bs-primary, var(--bm-green, #00a651));
    font-weight: 500;
}

/* =====================================================
   FILTER TREE - Stiluri pentru categorii tip arbore
   ===================================================== */
.filter-tree-item {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.18s ease;
    cursor: pointer;
}

.filter-tree-item:hover {
    color: #333;
    text-decoration: none;
    background: #f8f9fa;
}

.filter-tree-item.active {
    color: var(--bs-primary, var(--bm-green, #00a651));
    font-weight: 500;
}

.filter-tree-item.active:hover {
    background: color-mix(in srgb, var(--bm-green, var(--bm-green, #00a651)) 6%, transparent);
}

.filter-tree-arrow {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
    color: #999;
    transition: transform 0.2s ease, color 0.18s ease;
}

.filter-tree-item:hover .filter-tree-arrow {
    color: #666;
}

.filter-tree-item.active .filter-tree-arrow {
    color: var(--bs-primary, var(--bm-green, #00a651));
}

.filter-tree-arrow.rotated {
    transform: rotate(90deg);
}

.filter-tree-name {
    flex: 1;
}

/* Leaf items (L3) - no arrow, indented */
.filter-tree-leaf {
    padding-left: 28px;
}

.filter-tree-leaf .filter-tree-name {
    font-size: 13px;
}

/* Nested card styling */
.filter-card-nested {
    margin-top: -8px;
    padding-top: 0;
    border-top: none;
    box-shadow: none;
}

.filter-card-nested .filter-card-title {
    display: none;
}

/* =====================================================
   CATEGORY PAGE LAYOUT
   ===================================================== */

.sorting-bar-wrapper {
    /* width: calc(100% + var(--bs-gutter-x)); */
    clear: both;
    width: 100%;
    /* border-bottom: 1px solid #eee; */
    /* margin-left: calc(-1 * var(--bs-gutter-x) * .5); */
}

/* =====================================================
   MOBILE SORTING BAR - compact design
   ===================================================== */
@media (max-width: 991.98px) {
    /* Override theme.css fixed bottom positioning */
    .sortare {
        position: static !important;
        box-shadow: none !important;
        z-index: auto !important;
        width: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        background-color: transparent !important;
    }
}

/* =====================================================
   FLOATING FILTER BUTTON - appears when sorting bar scrolls out
   Design matches "Adaugă în coș" button from product cards
   ===================================================== */
.mf-floating-btn {
    position: fixed;
    right: 16px;
    top: 70px; /* fallback, JS overrides with header height */
    z-index: 1060;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bm-chip-bg, #e4f6e4);
    color: var(--bm-green-deep, #0b7e33);
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s ease;
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
}

.mf-floating-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.mf-floating-btn:hover {
    background: var(--bm-chip-bg-hover, #d4ebd4);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.mf-floating-btn:active {
    transform: scale(0.95);
}

.mf-floating-btn svg {
    flex-shrink: 0;
}

.category-page .products-grid {
    display: flex;
    flex-wrap: wrap;
    /* margin: 0  calc(-1 * var(--bs-gutter-x) * .5); */
}

/* =====================================================
   MOBILE FILTER MODAL IMPROVEMENTS
   ===================================================== */
.model-filtre .filter-sidebar {
    padding: 16px;
}

.model-filtre .filter-card {
    margin-bottom: 16px;
}

/* =====================================================
   RESET FILTERS BUTTON
   ===================================================== */
.filter-sidebar .btn-outline-secondary {
    border-radius: 8px;
    font-size: 13px;
    padding: 8px 16px;
    transition: all 0.18s ease;
}

.filter-sidebar .btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #ddd;
}

/* =====================================================
   ACTIVE FILTERS CARD - Filtrele selectate
   ===================================================== */
.filter-card-active {
    background: #fafafa;
}

.filter-active-group {
    margin-bottom: 10px;
}

.filter-active-group:last-child {
    margin-bottom: 0;
}

.filter-active-type {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px 4px 10px;
    background: var(--bs-primary, var(--bm-green, #00a651));
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.3;
    text-decoration: none;
    transition: background 0.18s ease;
    max-width: 100%;
}

.filter-chip:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

.filter-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-chip-x {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.filter-chip:hover .filter-chip-x {
    opacity: 1;
}

.filter-chip--clear {
    margin-top: 10px;
    background: transparent;
    color: #888;
    border: 1px dashed #ccc;
    padding: 4px 10px;
    font-size: 12px;
}

.filter-chip--clear .filter-chip-x {
    stroke: #888;
}

.filter-chip--clear:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #999;
}

.filter-chip--clear:hover .filter-chip-x {
    stroke: #333;
}

/* =====================================================
   FILTER CARD TITLE WITH BADGE
   ===================================================== */
.filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.filter-card-header .filter-card-title {
    margin-bottom: 0;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bs-primary, var(--bm-green, #00a651));
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.filter-badge:empty {
    display: none;
}

/* =====================================================
   FILTER CATEGORIES TREE - Arbore ierarhic L1 → L2 → L3
   ===================================================== */
.filter-card .form-check.filter-tree__l1,
.filter-card .form-check.filter-tree__l2,
.filter-card .form-check.filter-tree__l3 {
    padding: 3px 8px;
    gap: 6px;
}

.filter-card .form-check.filter-tree__l1 {
    padding-left: 8px;
}

.filter-card .form-check.filter-tree__l2 {
    padding-left: 28px;
}

.filter-card .form-check.filter-tree__l3 {
    padding-left: 48px;
}

/* Checkbox-ul nu mai e absolut în modul flex */
.filter-card .form-check.filter-tree__l1 .form-check-input,
.filter-card .form-check.filter-tree__l2 .form-check-input,
.filter-card .form-check.filter-tree__l3 .form-check-input {
    position: static;
    margin: 0;
    flex-shrink: 0;
}

.filter-tree-path {
    color: var(--bs-primary, var(--bm-green, #00a651)) !important;
    font-weight: 500;
}

.filter-tree-count {
    font-size: 12px;
}

.filter-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    cursor: pointer;
    color: #999;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.18s ease, background 0.18s ease;
}

.filter-tree-toggle:hover {
    color: #666;
    background: rgba(0, 0, 0, 0.04);
}

.filter-tree-chevron {
    transition: transform 0.2s ease;
}

.filter-tree-chevron.open {
    transform: rotate(90deg);
}

.filter-card .form-check-input:checked ~ .filter-tree-toggle {
    color: var(--bs-primary, var(--bm-green, #00a651));
}

.filter-tree-path ~ .filter-tree-toggle {
    color: var(--bs-primary, var(--bm-green, #00a651));
}

/* Implicit checked (copii ai categoriei curente) - bifa gri vizuala */
.filter-card .form-check-input.filter-tree-checkbox--implicit {
    background-color: #ccc;
    border-color: #ccc;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Când userul bifează un implicit, devine verde normal */
.filter-card .form-check-input.filter-tree-checkbox--implicit:checked {
    background-color: var(--bs-primary, var(--bm-green, #00a651));
    border-color: var(--bs-primary, var(--bm-green, #00a651));
}


.category-header__description.collapsed.non-expandable {
      max-height: none;
  }
  .category-header__description.collapsed.non-expandable::after {
      display: none;
  }

/* Strat 4 UX: opțiuni de filtru blocate când stack-ul de car_*/ele_* a atins plafonul (5) */
.filter-card-content .form-check-label.filter-locked {
    opacity: 0.45;
    cursor: not-allowed;
    color: #888;
}
.filter-card-content input.filtrarecheckbox[disabled] {
    cursor: not-allowed;
}
.filter-card-content input.filtrarecheckbox[disabled] + label {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =====================================================
   LĂȚIME PAGINĂ CATEGORIE — identică cu sursa (1415px)
   ===================================================== */
.category-page.bm-container {
    max-width: 1415px;
}

/* =====================================================
   CUTIA VERDE — header + grilă categorii + sortare (ca sursa)
   ===================================================== */
.bm-green-box-wrapper {
    background: var(--bm-green-soft, #f6f9f6);
    border-radius: var(--bm-radius, 18px);
    padding: 24px 26px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* =====================================================
   GRILĂ „Categorii în care se găsesc produsele" (8/rând desktop)
   ===================================================== */
.search-categories-title { line-height: 1.2; }
.category-small-gap {
    --product-item-gap: 0.35rem;
    gap: var(--product-item-gap);
}
.search-category-card { width: calc(33.33% - (0.35rem * 2/3)); }
@media (min-width: 768px) {
    .search-category-card.w-md-12p {
        width: calc(12.5% - (0.35rem * 7/8));
    }
}
.search-category-card-inner {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    transition: all 0.15s ease;
    height: 100%;
}
.search-category-card:hover .search-category-card-inner {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.search-category-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 6px;
}
.search-category-card-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.search-category-card-count {
    font-size: 0.65rem;
    color: #6c757d;
    margin-top: 2px;
}
.search-cats-collapsible {
    max-height: 220px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}
.search-cats-collapsible::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--bm-green-soft, #f6f9f6));
    pointer-events: none;
}
.search-cats-collapsible.search-cats--expanded { max-height: 2000px; }
.search-cats-collapsible.search-cats--expanded::after { display: none; }
.search-cats-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: -50px auto 0;
    position: relative;
    z-index: 2;
    padding: 6px 20px;
    background: #fff;
    border: 1px solid var(--bs-primary, var(--bm-green, #00a651));
    border-radius: 8px;
    color: #333;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}
.search-cats-toggle i { transition: transform 0.3s ease; }
.search-cats-toggle--active { margin-top: 10px; }
.search-cats-toggle--active i { transform: rotate(180deg); }
@media (min-width: 768px) {
    .search-cats-grid--md-all-visible .search-cats-collapsible { max-height: none; }
    .search-cats-grid--md-all-visible .search-cats-collapsible::after { display: none; }
    .search-cats-grid--md-all-visible .search-cats-toggle { display: none; }
}

/* =====================================================
   GRILĂ PRODUSE — 4 pe rând (desktop), 2 pe mobil (ca sursa)
   ===================================================== */
.category-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: stretch;
}
.category-products .biomag-card {
    max-width: none;
    margin: 0;
}
@media (max-width: 1199.98px) {
    .category-products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767.98px) {
    .category-products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* =====================================================
   MOBILE FILTER PANEL — full page pe < lg (peste header)
   ===================================================== */
.filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 3999;
}
body.filters-open .filter-backdrop {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 991.98px) {
    /* Panoul acoperă tot ecranul, peste header-ul sticky (z-index: 50). */
    .filter-sidebar {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100dvh;
        background: #fff;
        z-index: 4000;
        padding: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.28s ease;
    }
    body.filters-open {
        overflow: hidden;
    }
    body.filters-open .filter-sidebar {
        transform: translateX(0);
    }

    /* Antetul rămâne vizibil la derulare. */
    .filter-sidebar__head {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        padding: 14px 16px;
        margin: 0 !important;
    }
    .filter-sidebar__head strong {
        font-size: 17px;
    }

    /* Carduri plate, delimitate prin linie — nu blocuri cu umbră. */
    .filter-sidebar .filter-card {
        box-shadow: none;
        border-radius: 0;
        margin-bottom: 0;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
    }
    .filter-sidebar .filter-card:hover {
        box-shadow: none;
    }
    .filter-sidebar .filter-card:last-child {
        border-bottom: none;
    }
    .filter-sidebar .filter-card .form-check {
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .filter-sidebar .filter-card .form-check-input {
        width: 1.15em;
        height: 1.15em;
        margin-top: 0.15em;
    }
    .filter-sidebar .filter-card .form-check-label {
        font-size: 14px;
    }
}

@media (min-width: 992px) {
    .filter-backdrop { display: none; }
    .filter-sidebar__head { display: none !important; }
}

/* Text SEO de jos */
.category-seo-text {
    font-size: 0.85rem;
    color: #777;
    line-height: 1.7;
}
.category-seo-text h2,
.category-seo-text h3 { color: var(--bs-primary, var(--bm-green, #00a651)); font-size: 1rem; }