.tests-layout {
    display: flex;
    column-gap: 1.5rem;
    align-items: flex-start;
    min-height: 500px;
}

.tests-sidebar {    
    flex: 0 0 auto;
    width: 25%;
    min-width: 280px;
    top: 5rem;
}

.loading::after {
    display: inline-block;
    animation: dotty steps(1,end) 1s infinite;
    content: '';
}

@keyframes dotty {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

.filter-section.expanded .filter-section-body {
    max-height: 20000px;
}

.filter-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 15px 20px;
    cursor: pointer;
    color: var(--color-dark-blue);
    user-select: none;
    transition: background 0.15s;
}

.filter-section-header:hover {
    background: rgba(0, 126, 105, 0.04);
}

.filter-section-arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.filter-section.expanded .filter-section-arrow {
    transform: rotate(90deg);
}

.filter-section-title {
    flex: 1;
}

.filter-section-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(0, 0, 0, .35);
    text-transform: none;
    letter-spacing: 0;
}

.filter-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 20px 8px 20px;
    cursor: pointer;
    font-weight: 300;
    color: var(--color-dark-blue);
    transition: background 0.12s;
    user-select: none;
}

.filter-item:hover {
    background: rgba(0, 126, 105, 0.05);
}

.filter-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid rgba(0, 0, 0, .3);
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}

.filter-item input[type="checkbox"]:checked {
    background: var(--color-green);
    border-color: var(--color-green);
}

.filter-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    width: 6px;
    height: 9px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.filter-item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-item-count {
    font-size: 0.6875rem;
    color: rgba(0, 0, 0, .3);
    font-weight: 400;
    flex-shrink: 0;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--color-teal);
    font-weight: 500;
    transition: background 0.12s;
    user-select: none;
}

.filter-toggle:hover {
    background: rgba(0, 126, 105, 0.05);
}

.tests-search {
    position: relative;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
}

.tests-search-icon {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, .3);
    font-size: 0.875rem;
    pointer-events: none;
}

.tests-search input {
    width: 100%;
    padding: 8px 32px 8px 36px;
    border: 1px solid var(--color-border);
    border-radius: 25px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--color-dark-blue);
    background: var(--color-white);
    outline: none;
    transition: border-color 0.15s;
}

.tests-search input:focus {
    border-color: var(--color-green);
}

.tests-search input::placeholder {
    color: rgba(0, 0, 0, .3);
}

.tests-search-clear {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: rgba(0, 0, 0, .35);
    font-size: 0.75rem;
    transition: color 0.12s;
}

.tests-search-clear:hover {
    color: var(--color-dark-blue);
}

.tests-search-clear.visible {
    display: flex;
}

.tests-content {
    flex: 1;
    min-width: 0;
}

.tests-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    min-height: 0;
}

.tests-active-filters:empty {
    display: none;
    margin-bottom: 0;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 5px 15px;
    background: var(--color-bg-gray);
    border-radius: 1.2rem;
    font-size: 0.9rem;
    font-weight: 300;
    white-space: nowrap;
    box-shadow: var(--shadow-light);
}

.filter-badge-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 1.2rem;
    color: var(--color-dark-blue);
    line-height: 1;
}

.filter-badge-close:hover {
    background: rgba(0, 126, 105, 0.15);
}

.filter-badge-close i {
    font-size: 1.8rem;
}

.tests-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.tests-count {
    font-weight: 300;
    color: rgba(0, 0, 0, .4);
    margin-bottom: 1.5rem;
}

.tests-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    word-break: break-word;
}

.tests-table thead th {
    background-color: var(--color-dark-blue);
    color: var(--color-white);
    font-weight: 500;
}
.model-col {
    width: 40%;
}
.cat-col,
.dir-col,
.tests-table .product-category,
.tests-table .product-direction {
    display: table-cell;
}
.tests-table .product-row {
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--color-black);
    background-color: #fafafa;
}

.tests-table .product-row td,
.tests-table th {
    padding: 8px 15px;
    vertical-align: middle;
}

.tests-table .product-row:hover {
    background: rgba(0, 126, 105, 0.04);
}

.tests-table .product-row.expanded {
    background: rgba(0, 126, 105, 0.06);
    border-bottom-color: transparent;
}

.tests-table .product-model {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-dark-blue);
    padding: 0.75rem 0.75rem 0.75rem 0;
    white-space: nowrap;
    vertical-align: top;
}

.tests-table .product-descr,
.tests-table .product-category,
.tests-table .product-direction {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, .65);
    padding: 0.75rem 0;
    vertical-align: top;
    line-height: 1.45;
}

.accordion-row {
    display: none;
    border-bottom: 1px solid var(--color-black);
}

.accordion-row.open {
    display: table-row;
}

.accordion-cell {
    padding: 0 !important;
    background-color: var(--color-bg-gray);
}

.accordion-content {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(0, 0, 0, .7);
    padding: 0.75rem 1rem 1rem;
}

.accordion-content p {
    margin: 0 0 0.75rem;
}

.accordion-content p:last-child {
    margin-bottom: 0;
}

.accordion-loading {
    padding: 1rem;
    color: rgba(0, 0, 0, .35);
    font-style: italic;
}

.accordion-error {
    color: var(--color-red);
}

.tests-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(0, 0, 0, .35);
}

.tests-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}
@media (max-width: 1100px) {
    .tests-layout {
        flex-direction: column;
    }
    .tests-content {
        margin-top: 2rem;
    }
}
@media (min-width: 768px) and (max-width: 1100px) {
    .tests-sidebar {
        display: flex;
        flex-direction: row;
        width: 100%;
        flex-wrap: wrap;
    }
    .tests-search {
        flex-basis: 100%;
    }
    .filter-section {
        flex: 1;
        max-width: 33%;
    }
    .filter-section:not(:last-child) {
        width: 33%;
    }
}
@media (max-width: 768px) {
    .tests-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: none;
        border-bottom: 1px solid var(--color-border);
        padding: 0.75rem 0;
    }
    .tests-content {
        padding: 1rem;
    }
    .tests-table .product-model {
        white-space: normal;
    }
    .cat-col,
    .dir-col,
    .tests-table .product-category,
    .tests-table .product-direction {
        display: none;
    }
}