.nga-filter-container {
    width: 100%;
    margin-bottom: 30px;
    font-family: inherit;
}

#nga-filter-app {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.nga-filter-box {
    position: relative;
    flex: 1;
    min-width: 220px;
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    border-radius: 1px;
    transition: all 0.2s ease;
}

.nga-filter-box:hover, .nga-filter-box.is-open {
    border-color: #02A388;
    box-shadow: 0 2px 8px rgba(2, 163, 136, 0.1);
}

.tovarblock__wish {
    bottom: 20px!important;
}

.nga-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    user-select: none;
}

.nga-filter-title {
    font-weight: 600;
    font-size: 14px;
    color: #334155;
}

.nga-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -4px;
}

.nga-filter-box.is-open .nga-arrow {
    transform: rotate(-135deg);
    margin-top: 2px;
}

/* Контейнер для выбранных тегов под заголовком */
.nga-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 15px 10px 15px;
}

.nga-selected-tags:empty {
    padding: 0;
}

.nga-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(2, 163, 136, 0.1);
    color: #02A388;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.nga-tag-close:hover {
    color: #017360;
}

/* Выпадающие списки */
.nga-filter-dropdown {
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    background: #ffffff;
    border: 1px solid #02A388;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 999;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.nga-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nga-option {
    display: flex;
    align-items: flex-start; /* Изменено на flex-start, чтобы чекбокс ровнялся по первой строке текста */
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 13px;
    color: #475569;
}

.nga-option:hover {
    background: #f8fafc;
}

.nga-option.active {
    background: rgba(2, 163, 136, 0.05);
    color: #02A388;
    font-weight: 500;
}

/* Кастомные чекбоксы с защитой от ужимания */
.nga-checkbox {
    width: 16px;
    height: 16px;
    min-width: 16px; /* Защита от сжатия flex-контейнером */
    flex-shrink: 0;  /* Запрет на уменьшение элемента */
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.15s ease;
    background: #fff;
    margin-top: 2px; /* Небольшой отступ сверху для выравнивания по тексту */
}

.nga-option:hover .nga-checkbox {
    border-color: #02A388;
}

.nga-option.active .nga-checkbox {
    background: #02A388;
    border-color: #02A388;
}

.nga-option.active .nga-checkbox::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.nga-option-name {
    flex-grow: 1;
}

.nga-count {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 8px;
}

/* Кнопки действий */
.nga-filter-actions {
    display: flex;
    gap: 12px;
    flex-basis: 100%;
    width: 100%;
    margin-top: 1.5rem;
    align-items: center;
    justify-content: center;
}

.nga-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 1px !important;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    outline: none;
    
    /* Ограничиваем размер кнопок */
    width: auto;             /* Ширина по контенту */
    min-width: 140px;        /* Минимальная комфортная ширина */
    max-width: 220px;        /* Ограничение, чтобы не раздувало */
    box-sizing: border-box;
    text-align: center;
}

/* Кнопка "Show" */
.nga-btn-primary {
    background: #02A388;
    color: #ffffff;
    flex: 1 1 auto;          /* Можно немного растягиваться, но не дальше max-width */
}

.nga-btn-primary:hover {
    background: #01856f;
}

/* Кнопка "Reset" */
.nga-btn-secondary {
    background: #E8F5F0;
    color: #000;
    border: none;
    flex: 0 0 auto;          /* Фиксированный размер по содержимому */
}

.nga-btn-secondary:hover {
    background: #01856f;
    color: #ffffff;
}

/* Контейнер кнопки "Показать больше" */
.nga-load-more-container {
    width: 100%;
    text-align: center;
    margin: 30px 0;
}

/* Неактивная по умолчанию кнопка "Показать больше" */
.nga-btn-loadmore {
    background: #E8F5F0;
    color: #000;
    border: none;
    padding: 10px 40px;
    position: relative;
    min-width: 180px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 1px !important; /* У всех кнопок бордер радиус 1пх */
}

.nga-btn-loadmore:hover {
    background: #01856f; /* Как активная, но немного темнее */
    color: #ffffff;
}

/* Состояние загрузки */
.nga-btn-loadmore.nga-loading {
    color: transparent !important;
    cursor: not-allowed;
    background: #02A388; /* Удерживаем фон во время загрузки */
}

/* Спиннер */
.nga-btn-loadmore.nga-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: nga-spin 0.8s linear infinite;
}

@keyframes nga-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Стили заголовка результатов */
.nga-results-message {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 10px;
}

.nga-results-message-top {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 25px;
    margin-top: 10px;
    width: 100%;
    clear: both;
}

.nga-no-results {
    font-size: 16px;
    color: #64748b;
    padding: 20px 0;
    width: 100%;
}

.nga-products-grid > * {
    animation: ngaFadeIn 0.4s ease-out forwards;
}

@keyframes ngaFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tovarblock__wish a {
    width: 100%;
    padding: 5px;
    border: 1px solid;
    text-align: center;
}

.tovarblock__wish .added {
    display: none !important;
}


.nga-selected-tags-global {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-basis: 100%;
    width: 100%;
}
.nga-selected-tags-global:empty { display: none; }

.nga-selected-tags-global .nga-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(2, 163, 136, 0.08);
    border: 1px solid rgba(2, 163, 136, 0.3);
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 1px;
}
.nga-selected-tags-global .nga-tag-value {
    color: #02A388;
    font-weight: 600;
    margin-left: 4px;
}
.nga-selected-tags-global .nga-tag-close {
    margin-left: 6px;
    cursor: pointer;
    font-style: normal;
    font-weight: bold;
    color: #fff;
    font-size: 17px;
    border: none;
    padding: 0 2.5px;
    border-radius: 3px;
    line-height: 14.5px;
    background: #02A388;
}
.nga-selected-tags-global .nga-tag-close:hover { background: #017360; }