/* ===== Таблица товаров: шаблон catalog.section «table» ===== */

/* --- раскладка страницы на argos-electron.ru ---
   На десктопе левая колонка фильтров скрыта, таблица занимает всю ширину
   от левого края заголовка страницы. Файл подключается только там, где
   используется этот шаблон, поэтому другие разделы каталога не затронуты.
   Ширину переключения (992px) подгоните под брейкпоинт, на котором у вас
   фильтр уходит в мобильную кнопку. */
@media (min-width: 992px) {
    .inner__aside--filter { display: none !important; }
    .inner__main { flex: 1 1 100% !important; width: 100% !important; max-width: 100% !important; margin-left: 0 !important; }
}
/* переключатель «плитка / список» рядом с сортировкой в табличном виде ничего не меняет — скрываем */
.sort__cards { display: none !important; }
/* колонка каталога — flex-элемент; без этого она растягивается под ширину таблицы */
.inner__main, .inner__main > * { min-width: 0; }

.pt {
    /* цвета как у выпадающей сортировки «По алфавиту А-Я»: фон #f5f5f5, рамка #e1e1e1 */
    --pt-head: #f5f5f5;   /* заголовки столбцов */
    --pt-group: #ececec;  /* строки разделов — тот же серый, чуть темнее */
    --pt-frame: #e1e1e1;  /* рамка таблицы и линии закреплённых колонок */
    --pt-border: #ebebeb; /* линии между строками */
    --pt-hover: #fafafa;  /* строка под курсором */
    --pt-muted: #7a8591;
    --pt-accent: #d71920;
    min-width: 0;
    max-width: 100%;
    margin-top: 8px;
    font-size: 14px;
}
.pt [hidden] { display: none !important; }

/* --- панель над таблицей --- */
.pt__toolbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.pt__btn { padding: 8px 14px; border: 1px solid #d8dde3; border-radius: 4px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.pt__btn:hover { border-color: #b9c0c8; }
.pt__hint { color: var(--pt-accent); font-size: 13px; } /* красным, как «Открыть раздел» */
.pt__found { margin-left: auto; color: var(--pt-muted); font-size: 13px; }

/* --- «Показать колонки» --- */
.pt__cols {
    position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 6px;
    width: min(760px, 100%); padding: 14px 16px;
    background: #fff; border: 1px solid #d8dde3; border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .1); font-size: 13px;
}
.pt__cols-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--pt-border); font-weight: 600;
}
.pt__cols-head button { margin-left: 14px; padding: 0; border: 0; background: none; color: var(--pt-accent); font: inherit; font-weight: 400; cursor: pointer; }
.pt__cols-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }

/* свой чекбокс: стили сайта прячут стандартные, поэтому рисуем квадрат с галочкой сами */
.pt__check { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 0; line-height: 1.3; cursor: pointer; }
.pt__check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pt__check-box {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border: 1.5px solid #b9c0c8; border-radius: 3px; background: #fff;
    transition: background-color .12s, border-color .12s;
}
.pt__check-box::after {
    content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px); opacity: 0;
}
.pt__check:hover .pt__check-box { border-color: #8a939c; }
.pt__check input:checked + .pt__check-box { background: var(--pt-accent); border-color: var(--pt-accent); }
.pt__check input:checked + .pt__check-box::after { opacity: 1; }
.pt__check input:focus-visible + .pt__check-box { box-shadow: 0 0 0 3px rgba(215, 25, 32, .25); }

/* --- таблица --- */
/* таблица прокручивается внутри своего окна высотой в экран (минус шапка сайта 71px),
   поэтому строка с названиями колонок может быть закреплена сверху */
.pt__scroll { max-width: 100%; max-height: calc(100vh - 90px); overflow: auto; border: 1px solid var(--pt-frame); border-radius: 6px; }
.pt__table { width: 100%; border-collapse: separate; border-spacing: 0; }
/* перебиваем общие стили таблиц сайта (рамки у ячеек) */
.pt__table, .pt__table th, .pt__table td { border: 0; border-bottom: 1px solid var(--pt-border); }
.pt__table th, .pt__table td { padding: 6px 12px; text-align: left; vertical-align: middle; line-height: 1.3; }
.pt__table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt__table td.is-yes { color: #1a7f37; }
.pt__table td.is-no { color: #9aa3ac; }

/* шапка: длинные названия свойств переносятся */
.pt__table thead th {
    min-width: 90px; max-width: 160px; padding: 10px 12px;
    background: var(--pt-head); color: #5b6570; font-size: 12px; font-weight: 600;
    white-space: normal; vertical-align: bottom;
}
.pt__th { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; }
.pt__sort { all: unset; cursor: pointer; }
.pt__sort:focus-visible { outline: 2px solid var(--pt-accent); outline-offset: 2px; }
.pt__sort::after { content: " ⇅"; color: #b0b7bf; }
.pt__table thead th[aria-sort] { color: #111; }
.pt__table thead th[aria-sort="ascending"] .pt__sort::after { content: " ↑"; color: var(--pt-accent); }
.pt__table thead th[aria-sort="descending"] .pt__sort::after { content: " ↓"; color: var(--pt-accent); }

/* кнопка-воронка фильтра */
.pt__filter {
    flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 1px;
    min-width: 22px; height: 22px; margin-bottom: -3px; padding: 0 3px;
    border: 1px solid transparent; border-radius: 3px; background: none; color: #9aa3ac; cursor: pointer;
}
.pt__filter:hover, .pt__filter[aria-expanded="true"] { border-color: #d0d5da; background: #fff; color: #5b6570; }
.pt__filter-n { font-size: 10px; font-weight: 700; }
.pt__filter-n:empty { display: none; }
.pt__table thead th.is-filtered { background: #fdeeee; color: #111; }
.pt__table thead th.is-filtered .pt__filter { border-color: var(--pt-accent); background: var(--pt-accent); color: #fff; }

/* первая колонка (картинка + название) не уезжает при горизонтальной прокрутке */
.pt__sticky { position: sticky; left: 0; z-index: 2; min-width: 330px; background: #fff; box-shadow: 1px 0 0 var(--pt-frame); }
.pt__table thead .pt__sticky { max-width: none; background: var(--pt-head); }

/* закреплённая строка с названиями колонок */
.pt__table thead th { position: sticky; top: 0; z-index: 4; box-shadow: 0 1px 0 var(--pt-frame); }
.pt__table thead th.pt__sticky { left: 0; z-index: 6; box-shadow: 1px 1px 0 var(--pt-frame); }

.pt__name { display: flex; align-items: center; gap: 12px; color: #111; text-decoration: none; }
.pt__name:hover span:last-child { color: var(--pt-accent); }
.pt__img { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 37px; }
.pt__img img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* строка-заголовок группы */
.pt__group th { padding: 0; background: var(--pt-group); max-width: none; }
.pt__group-label { position: sticky; left: 0; display: inline-flex; align-items: center; } /* не уезжает при прокрутке */
.pt__group button { all: unset; display: inline-block; padding: 11px 12px; color: #1c2b3a; font-size: 14px; font-weight: 600; cursor: pointer; }
.pt__group button::before { content: "▾ "; }
tbody.is-collapsed .pt__group button::before { content: "▸ "; }
tbody.is-collapsed tr:not(.pt__group) { display: none; }
.pt__count { margin-left: 6px; color: var(--pt-muted); font-weight: 400; }
.pt__count::before { content: "("; }
.pt__count::after { content: ")"; }
.pt__group-link { margin-left: 4px; color: var(--pt-accent); font-size: 13px; font-weight: 400; }

.pt__table tbody tr:not(.pt__group):hover td { background: var(--pt-hover); }

/* скрытые фильтром строки и пустой результат */
.pt__table tr.is-filtered-out { display: none; }
/* заглушка «ничего не найдено» */
.pt__table .pt__empty td { padding: 0; border-bottom: 0; white-space: normal; }
.pt__empty-box { position: sticky; left: 0; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px 52px; text-align: center; }
.pt__empty-icon { color: #c3c7cc; margin-bottom: 4px; }
.pt__empty-title { color: #111; font-size: 18px; font-weight: 600; line-height: 1.3; }
.pt__empty-text { max-width: 460px; color: var(--pt-muted); font-size: 14px; line-height: 1.45; }
.pt__empty-reset { margin-top: 10px; border-color: var(--pt-accent); color: var(--pt-accent); }
.pt__empty-reset:hover { background: var(--pt-accent); border-color: var(--pt-accent); color: #fff; }
/* «не найдено» в окне фильтра и предупреждение у «от–до» */
.pt__pop-empty { padding: 10px 0 6px; color: var(--pt-accent); font-size: 13px; }
.pt__range-warn { margin-top: 6px; color: var(--pt-accent); font-size: 12px; }
.pt__reset { padding: 0 4px; border: 0; background: none; color: var(--pt-accent); font: inherit; font-size: 13px; cursor: pointer; }

/* --- «Сравнить»: всегда видна, закреплена у правого края --- */
.pt__compare-col { position: sticky; right: 0; z-index: 2; background: #fff; box-shadow: -1px 0 0 var(--pt-frame); white-space: nowrap; }
.pt__table thead th.pt__compare-col { right: 0; z-index: 6; background: var(--pt-head); vertical-align: bottom; box-shadow: -1px 1px 0 var(--pt-frame); }
.pt__compare-col .btn__comp { white-space: nowrap; }
/* в ячейке только квадратик-чекбокс сайта, без значка и подписи (на любой ширине экрана);
   подпись «Сравнить» есть в заголовке колонки */
.pt__table th.pt__compare-col, .pt__table td.pt__compare-col { min-width: 0; text-align: center; }
.pt__compare-col .btn__comp { width: auto !important; justify-content: center; }
.pt__compare-col .btn__comp .icon,
.pt__compare-col .btn__comp span:not(.btn__comp-box) { display: none !important; }
.pt__compare-col .btn__comp .btn__comp-box { display: block !important; flex: none; margin-right: 0; }

/* --- плашки активных фильтров --- */
.pt__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; }
.pt__chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px;
    background: #fdeeee; border: 1px solid #f3c6c8; border-radius: 14px; color: #7a1015; font-size: 13px;
}
.pt__chip b { font-weight: 600; }
.pt__chip button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #7a1015; font-size: 14px; line-height: 1; cursor: pointer; }
.pt__chip button:hover { background: #f3c6c8; }

/* --- окно фильтра колонки --- */
.pt { position: relative; }
.pt__pop {
    position: absolute; z-index: 40; width: 280px;
    background: #fff; border: 1px solid #d8dde3; border-radius: 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
    color: #111; font-size: 13px;
}
.pt__pop-title { padding: 12px 14px 8px; font-weight: 600; line-height: 1.3; }
.pt__pop-sub { padding: 0 14px 6px; color: var(--pt-muted); font-size: 12px; }
.pt__pop-search, .pt__range input {
    box-sizing: border-box; padding: 7px 10px; border: 1px solid #d8dde3; border-radius: 4px; font: inherit; font-size: 13px;
}
.pt__pop-search { width: calc(100% - 28px); margin: 0 14px 8px; }
.pt__pop-search:focus, .pt__range input:focus { outline: none; border-color: var(--pt-accent); box-shadow: 0 0 0 3px rgba(215, 25, 32, .15); }
.pt__pop-list { max-height: 260px; overflow: auto; padding: 0 14px; }
.pt__check-text { flex: 1; }
.pt__check-n { color: #9aa3ac; font-size: 12px; }
.pt__check.is-off { color: #b5bcc3; }
.pt__check.is-off .pt__check-box { border-color: #dde1e5; }
.pt__check[hidden] { display: none; }
.pt__pop-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding: 10px 14px; border-top: 1px solid var(--pt-border); }
.pt__pop-foot button { padding: 0; border: 0; background: none; color: var(--pt-accent); font: inherit; cursor: pointer; }
.pt__pop-foot .pt__pop-ok { padding: 6px 14px; border-radius: 4px; background: var(--pt-accent); color: #fff; }

/* «от–до» для числовых колонок */
.pt__range { margin-bottom: 8px; padding: 2px 14px 10px; border-bottom: 1px solid var(--pt-border); }
.pt__range-label { margin-bottom: 6px; color: var(--pt-muted); font-size: 12px; }
.pt__range-inputs { display: flex; align-items: center; gap: 8px; color: #9aa3ac; }
.pt__range-inputs input { flex: 1; width: 0; }
.pt__range-hint { margin-top: 6px; color: #9aa3ac; font-size: 12px; }
.pt__range-clear { padding: 0; border: 0; background: none; color: var(--pt-accent); font: inherit; font-size: 12px; cursor: pointer; }
.pt__range-clear[hidden] { display: none; }

/* --- прокрутка перетаскиванием --- */
.pt__scroll[data-pt-drag] { cursor: grab; }
.pt__scroll.is-dragging { cursor: grabbing; user-select: none; }
.pt__scroll.is-dragging a { pointer-events: none; }
