/* Запчасти — панель фильтров + таблица (раздел «Сервис/Запчасти»).
   Таблица переопределяет старые flex-правила .part-wrap своей grid-сеткой
   (всё ограничено областью .parts-filter-block, чтобы не задеть страницы /part_brands/). */

.parts-filter {
    margin: 20px 0 8px;
}
.parts-filter__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.parts-filter__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 180px;
    min-width: 150px;
}
.parts-filter__field label {
    font-size: 13px;
    font-weight: 500;
    color: #8C8C8C;
}
.parts-filter__field input,
.parts-filter__select {
    height: 46px;
    width: 100%;
    padding: 0 14px;
    font-size: 15px;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
}
.parts-filter__field input:focus,
.parts-filter__select:focus {
    outline: none;
    border-color: var(--main-color);
}
.parts-filter__actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}
.parts-filter__submit,
.parts-filter__reset {
    height: 46px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--main-color);
    cursor: pointer;
    transition: 0.2s;
}
.parts-filter__submit {
    background: var(--main-color);
    color: #1c1c1c;
}
.parts-filter__reset {
    background: #fff;
    color: #333;
}
.parts-filter__submit:hover,
.parts-filter__reset:hover {
    transform: scale(0.97);
}

.parts-filter__count {
    margin: 12px 0;
    font-weight: 600;
    color: #333;
    min-height: 1em;
}

/* ---------- Таблица (grid) ---------- */
.parts-filter-block .filters__content {
    width: 100%;
}
.parts-filter-block .articles__container,
.parts-filter-block .container-flex {
    display: block;
    width: 100%;
}
.parts-filter-block .parts-wrap {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    overflow: hidden;
}
.parts-filter-block .part-wrap {
    display: grid;
    grid-template-columns: 1.2fr 1.3fr 2.2fr 1fr 0.9fr 160px;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 0;
    padding: 13px 18px;
    border-bottom: 1px solid #eee;
    flex-wrap: nowrap;
}
.parts-filter-block .part-wrap:last-child {
    border-bottom: none;
}
.parts-filter-block .part-char-wrap {
    width: auto;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: 0;
    color: #555;
    overflow-wrap: anywhere;
}
.parts-filter-block .part-char-title {
    font-weight: 600;
    color: #222;
}
.parts-filter-block .part-header-wrap {
    background: var(--main-color);
    border-bottom: none;
}
.parts-filter-block .part-header-wrap .part-char-wrap {
    color: #1c1c1c;
    font-weight: 700;
    font-size: 15px;
}
.part-availability.in-stock {
    color: #2a9c2f;
    font-weight: 600;
}
.part-availability.out-stock {
    color: #E08A00;
}
.parts-filter-block .part-action {
    text-align: right;
}
.parts-order-btn {
    display: inline-block;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1c;
    background: var(--main-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}
.parts-order-btn:hover {
    transform: scale(0.96);
    filter: brightness(0.97);
}

.parts-empty {
    width: 100%;
    padding: 28px 16px;
    text-align: center;
    color: #8C8C8C;
}

.parts-loadmore-wrap {
    text-align: center;
    margin: 24px 0 8px;
}
.parts-loadmore {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #fff;
    border: 1px solid var(--main-color);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}
.parts-loadmore:hover {
    background: var(--main-color);
}
.parts-loader {
    margin-top: 10px;
    color: #8C8C8C;
}

/* ---------- Аннотация + блок-подсказка (редактируется в админке) ---------- */
.parts-lead {
    margin: 6px 0 18px;
    max-width: 900px;
    font-size: 16px;
    line-height: 1.55;
    color: #4a4f57;
}

.parts-info {
    margin: 0 0 22px;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
}
.parts-info__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 15px;
    color: #2b2f34;
    user-select: none;
}
.parts-info__summary::-webkit-details-marker { display: none; }
.parts-info__summary::after {
    content: "";
    margin-left: auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid #9aa0a6;
    border-bottom: 2px solid #9aa0a6;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}
.parts-info[open] .parts-info__summary::after { transform: rotate(-135deg); }
.parts-info__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--main-color);
    color: #1c1c1c;
    font-size: 14px;
    font-weight: 700;
}
.parts-info__body {
    padding: 0 18px 18px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: start;
}
.parts-info__help {
    font-size: 15px;
    line-height: 1.6;
    color: #4a4f57;
}
.parts-info__help p { margin: 0 0 10px; }
.parts-info__help p:last-child { margin-bottom: 0; }
.parts-info__gloss-title {
    font-weight: 700;
    font-size: 15px;
    color: #2b2f34;
    margin-bottom: 10px;
}
.parts-gloss {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 20px;
}
.parts-gloss__item {
    display: flex;
    gap: 8px;
    align-items: baseline;
}
.parts-gloss dt {
    font-weight: 700;
    color: #2b2f34;
    white-space: nowrap;
}
.parts-gloss dd {
    margin: 0;
    color: #5a5f66;
    font-size: 14px;
}

/* ---------- Мобильная версия: строки → карточки ---------- */
@media only screen and (max-width: 869px) {
    .parts-lead {
        font-size: 15px;
        margin: 6px 0 14px;
    }
    .parts-info { margin-bottom: 16px; }
    .parts-info__body {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .parts-filter__row {
        flex-direction: column;
        align-items: stretch;
    }
    .parts-filter__field {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }
    .parts-filter__field input,
    .parts-filter__select {
        height: 48px;
        font-size: 16px;
    }
    .parts-filter__field label {
        font-size: 14px;
    }
    .parts-filter__actions {
        width: 100%;
    }
    .parts-filter__submit,
    .parts-filter__reset {
        flex: 1;
        height: 48px;
        font-size: 16px;
    }

    .parts-filter-block .parts-wrap {
        border: none;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }
    .parts-filter-block .part-header-wrap {
        display: none !important;
    }
    .parts-filter-block .part-wrap {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100%;
        padding: 16px;
        margin-bottom: 14px;
        background: #fff;
        border: 1px solid #e3e3e3;
        border-radius: 14px;
    }
    .parts-filter-block .part-char-wrap {
        font-size: 15px;
        line-height: 1.45;
    }
    /* подпись перед значением в карточке */
    .parts-filter-block .part-char-wrap[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #8C8C8C;
        margin-right: 4px;
    }
    .parts-filter-block .part-char-title {
        font-size: 16px;
    }
    /* пустые ячейки (нет артикула/бренда и т.п.) скрываем в карточке */
    .parts-filter-block .part-char-wrap:not(.part-action):empty {
        display: none;
    }
    .parts-filter-block .part-action {
        text-align: stretch;
        margin-top: 8px;
    }
    .parts-order-btn {
        display: block;
        width: 100%;
        padding: 13px;
        font-size: 16px;
    }
    .parts-loadmore {
        width: 100%;
        font-size: 16px;
        padding: 14px 0;
    }
}
