/* Страница /catalog — каталог разделов (inc/catalog-page.php) по макету Figma «Каталог · по образцу»:
 * ширина контента — как у шапки сайта: 1160 px по центру, на узких экранах поля по 20 px;
 * ≥1200 px — десктоп 59:2 (описание раздела слева, сетка карточек справа);
 * 1024–1199 — описание строкой над карточками, все карточки видны (мышью ленту вбок листать неудобно);
 * <1024 px — планшет 71:2 и телефон 71:544 (быстрый переход, раздел — строка заголовка и лента карточек вбок). */

.ptvc {
  --bg: #204547; --line: #e7e3dc; --ink: #1e1e1e; --muted: #6e655b; --link: #2e7d5f; --media: #f3f2ef; --tile: #f2eed6;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.ptvc *, .ptvc *::before, .ptvc *::after { box-sizing: border-box; }
.ptvc a { color: inherit; text-decoration: none; }
.ptvc img { display: block; max-width: 100%; height: auto; }
:where(.ptvc) :where(h1, h2, p) { margin: 0; padding: 0; }
/* края контента совпадают с шапкой Тильды (контейнер 1160 px по центру) */
.ptvc-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* строка разделов */
.ptvc-nav { background: #fff; border-bottom: 1px solid var(--line); }
.ptvc-nav .ptvc-wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.ptvc-nav .ptvc-wrap::-webkit-scrollbar { display: none; }
.ptvc-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 15px 0; font-weight: 600; font-size: 13px; color: var(--ink); }
.ptvc-nav a:hover { color: var(--link); }
.ptvc-new { display: inline-block; background: #204547; color: #fff; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px 4px; border-radius: 4px; }

/* крошки и заголовок */
.ptvc-head .ptvc-wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 28px; padding-bottom: 20px; }
.ptvc-crumbs { font-size: 13px; color: #dcdcdc; margin-bottom: 6px; }
.ptvc-crumbs a:hover { color: #fff; text-decoration: underline; }
.ptvc-sep { margin: 0 8px; }
.ptvc h1 { font-family: 'Scada', Arial, sans-serif; font-weight: 700; font-size: 30px; line-height: 1.2; color: #fff; }
.ptvc-total { font-size: 14px; color: #dcdcdc; white-space: nowrap; }

/* быстрый переход — только на узких экранах */
.ptvc-quick { display: none; }

/* разделы */
.ptvc-sections { display: flex; flex-direction: column; gap: 16px; padding-bottom: 48px; }
.ptvc-sec {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start;
}
.ptvc-info {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-content: start;
  grid-template-areas: "icon badge" "title title" "desc desc" "meta meta" "link link";
}
.ptvc-icon { grid-area: icon; width: 64px; height: 64px; border-radius: 10px; background: var(--tile); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.ptvc-icon img { width: 48px; height: 48px; object-fit: contain; mix-blend-mode: multiply; }
.ptvc-badge { grid-area: badge; justify-self: start; align-self: center; margin-bottom: 16px; background: #d6cf8b; color: #462e21; font-size: 12px; font-weight: 600; line-height: 1.3; padding: 3px 8px 4px; border-radius: 4px; }
.ptvc-sec h2 { grid-area: title; font-family: 'Scada', Arial, sans-serif; font-weight: 700; font-size: 22px; line-height: 1.2; color: var(--ink); margin-bottom: 12px; }
.ptvc-desc { grid-area: desc; color: var(--muted); line-height: 1.5; margin-bottom: 14px; }
.ptvc-meta { grid-area: meta; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.ptvc-all { grid-area: link; justify-self: start; color: var(--link) !important; font-weight: 600; white-space: nowrap; }
.ptvc-all:hover { text-decoration: underline; }
.ptvc-all__s { display: none; }

.ptvc-grid { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ptvc-group { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(var(--min, 300px), 1fr)); }

/* карточка */
.ptvc-card {
  display: flex; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ptvc-card:hover { border-color: #b9c6c2; box-shadow: 0 4px 14px rgba(32, 69, 71, .10); }
.ptvc-media { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ptvc-media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.ptvc-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.ptvc-t { font-weight: 600; font-size: 14px; line-height: 1.35; color: var(--ink); overflow-wrap: break-word; }
.ptvc-sub, .ptvc-n { font-size: 12px; line-height: 1.4; color: var(--muted); }

/* текст слева, картинка справа */
.ptvc-group--a, .ptvc-group--a-wide, .ptvc-group--series, .ptvc-group--a-tall { --min: 270px; }
.ptvc-group--a-wide { --min: 380px; }
.ptvc-group--series { --min: 158px; }
.ptvc-group--a .ptvc-card, .ptvc-group--a-wide .ptvc-card, .ptvc-group--series .ptvc-card, .ptvc-group--a-tall .ptvc-card {
  flex-direction: row-reverse; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; min-height: var(--h, 84px);
}
.ptvc-group--a .ptvc-media { width: 78px; height: 56px; }
.ptvc-group--a-wide { --h: 96px; }
.ptvc-group--a-wide .ptvc-media { width: 132px; height: 76px; }
.ptvc-group--series { --h: 80px; }
.ptvc-group--series .ptvc-card { padding: 10px 8px 10px 12px; gap: 8px; }
.ptvc-group--series .ptvc-media { width: 56px; height: 46px; }
.ptvc-group--series .ptvc-t { font-size: 13px; }
.ptvc-group--a-tall { --h: 132px; grid-template-columns: 1fr; }
.ptvc-group--a-tall .ptvc-media { width: 120px; height: 88px; }

/* плитки: картинка сверху, подпись снизу */
.ptvc-group--tiles, .ptvc-group--tiles-md { --min: 128px; }
.ptvc-group--tiles-lg { --min: 200px; }
.ptvc-group--tiles-xl { --min: 260px; }
.ptvc-group--tiles .ptvc-card, .ptvc-group--tiles-md .ptvc-card, .ptvc-group--tiles-lg .ptvc-card, .ptvc-group--tiles-xl .ptvc-card { flex-direction: column; }
.ptvc-group--tiles .ptvc-media, .ptvc-group--tiles-md .ptvc-media, .ptvc-group--tiles-lg .ptvc-media, .ptvc-group--tiles-xl .ptvc-media { width: 100%; padding: 8px; }
.ptvc-group--tiles .ptvc-media { height: 100px; padding-bottom: 0; }
.ptvc-group--tiles-md .ptvc-media { height: 128px; background: var(--media); }
.ptvc-group--tiles-lg .ptvc-media { height: 140px; background: var(--media); }
.ptvc-group--tiles-xl .ptvc-media { height: 156px; background: var(--media); }
.ptvc-group--tiles .ptvc-body, .ptvc-group--tiles-md .ptvc-body, .ptvc-group--tiles-lg .ptvc-body, .ptvc-group--tiles-xl .ptvc-body { justify-content: flex-start; gap: 3px; padding: 10px 6px 12px 8px; }
.ptvc-group--tiles .ptvc-t, .ptvc-group--tiles-md .ptvc-t { font-size: 13px; }
.ptvc-group--tiles-lg .ptvc-body, .ptvc-group--tiles-xl .ptvc-body { padding: 12px 12px 14px; }

/* двигатели и компрессоры — две половины рядом */
.ptvc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ptvc-sec--half { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }

/* преимущества */
.ptvc-adv { background: #f0f0f0; }
.ptvc-adv .ptvc-wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding-top: 28px; padding-bottom: 28px; }
.ptvc-adv__i { display: flex; align-items: center; gap: 14px; }
.ptvc-adv svg { flex: 0 0 36px; }
.ptvc-adv b { display: block; color: #204547; font-weight: 600; font-size: 15px; line-height: 1.35; }
.ptvc-adv small { display: block; color: #303030; font-size: 13px; line-height: 1.4; }

/* небольшие экраны с мышью (1024–1199): описание раздела строкой сверху, сетка на всю ширину */
@media (min-width: 1024px) and (max-width: 1199px) {
  .ptvc-sec, .ptvc-sec--half { display: block; padding: 20px; }
  .ptvc-info {
    grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 14px; align-items: center;
    grid-template-areas: "icon badge link" "icon title link" "icon meta link"; margin-bottom: 16px;
  }
  .ptvc-icon { grid-row: 1 / 4; width: 56px; height: 56px; margin: 0; }
  .ptvc-icon img { width: 44px; height: 44px; }
  .ptvc-badge { margin: 0 0 4px; }
  .ptvc-sec h2 { font-size: 20px; margin: 0; }
  .ptvc-desc { display: none; }
  .ptvc-meta { font-weight: 400; color: var(--muted); margin: 2px 0 0; }
  .ptvc-group { grid-template-columns: repeat(auto-fit, minmax(var(--min, 300px), 1fr)); }
  .ptvc-group--tiles, .ptvc-group--tiles-md { --min: 150px; }
  .ptvc-group--a .ptvc-media { width: 104px; height: 64px; }
  .ptvc-group--series .ptvc-media { width: 64px; height: 50px; }
  .ptvc-nav .ptvc-wrap { justify-content: flex-start; gap: 20px; }
  .ptvc-pair .ptvc-all__l { display: none; }
  .ptvc-pair .ptvc-all__s { display: inline; }
}

/* ---------- планшет и телефон ---------- */
@media (max-width: 1023px) {
  .ptvc-wrap { padding: 0 24px; }
  .ptvc-nav { display: none; }
  .ptvc-head .ptvc-wrap { padding-top: 24px; padding-bottom: 14px; }
  .ptvc h1 { font-size: 26px; }

  .ptvc-quick { display: block; }
  .ptvc-quick .ptvc-wrap { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; padding-bottom: 20px; }
  .ptvc-q {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #fff; border-radius: 10px; padding: 10px 2px; text-align: center;
    font-size: 11px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; color: var(--ink);
  }
  .ptvc-q:active { background: #f6f5f2; }
  .ptvc-q__i { width: 48px; height: 48px; border-radius: 8px; background: var(--tile); display: flex; align-items: center; justify-content: center; }
  .ptvc-q__i img { width: 40px; height: 40px; object-fit: contain; mix-blend-mode: multiply; }
  .ptvc-q .ptvc-new { position: absolute; top: 4px; right: 4px; font-size: 9px; padding: 2px 5px 3px; }

  .ptvc-sections { padding-bottom: 32px; }
  .ptvc-sec, .ptvc-sec--half { display: block; padding: 20px 0 20px 20px; overflow: hidden; }
  .ptvc-info {
    grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
    grid-template-areas: "icon badge link" "icon title link" "icon meta link";
    padding-right: 20px; margin-bottom: 16px;
  }
  .ptvc-icon { grid-row: 1 / 4; width: 56px; height: 56px; margin: 0; }
  .ptvc-icon img { width: 44px; height: 44px; }
  .ptvc-badge { margin: 0 0 4px; }
  .ptvc-sec h2 { font-size: 19px; margin: 0; }
  .ptvc-desc { display: none; }
  .ptvc-meta { font-size: 13px; font-weight: 400; color: var(--muted); margin: 2px 0 0; }
  .ptvc-all { align-self: center; }

  /* лента карточек вбок: крайняя карточка выглядывает из-за края */
  .ptvc-grid {
    flex-direction: row; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-right: 20px;
  }
  .ptvc-grid::-webkit-scrollbar { display: none; }
  .ptvc-group { display: contents; }
  .ptvc-grid .ptvc-card {
    flex: 0 0 156px; flex-direction: column; align-items: stretch; gap: 0; padding: 0; min-height: 0; scroll-snap-align: start;
  }
  .ptvc-grid .ptvc-media { width: auto; height: 116px; padding: 8px; background: var(--media); }
  .ptvc-grid .ptvc-body { justify-content: flex-start; gap: 3px; padding: 10px 8px 12px 10px; }
  .ptvc-grid .ptvc-t { font-size: 12px; }

  .ptvc-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ptvc-pair .ptvc-all__l { display: none; }
  .ptvc-pair .ptvc-all__s { display: inline; }
  /* у двигателей и компрессоров по две карточки — помещаются в половину без прокрутки */
  .ptvc-pair .ptvc-grid { gap: 10px; padding-right: 16px; }
  .ptvc-pair .ptvc-grid .ptvc-card { flex: 1 1 0; min-width: 136px; }

  .ptvc-adv .ptvc-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
}

@media (max-width: 639px) {
  .ptvc-wrap { padding: 0 16px; }
  .ptvc-head .ptvc-wrap { display: block; padding-top: 20px; padding-bottom: 12px; }
  .ptvc h1 { font-size: 24px; line-height: 1.15; }
  .ptvc-total { margin-top: 6px; }

  .ptvc-quick .ptvc-wrap { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-bottom: 16px; }
  .ptvc-q__i { width: 44px; height: 44px; }
  .ptvc-q__i img { width: 36px; height: 36px; }

  .ptvc-sections { gap: 12px; padding-bottom: 28px; }
  .ptvc-sec, .ptvc-sec--half { padding: 16px 0 16px 16px; }
  .ptvc-info { padding-right: 16px; margin-bottom: 14px; }
  .ptvc-icon { width: 44px; height: 44px; border-radius: 8px; }
  .ptvc-icon img { width: 36px; height: 36px; }
  .ptvc-sec h2 { font-size: 17px; line-height: 1.18; }
  .ptvc-meta { font-size: 12px; }
  .ptvc-all__l { display: none; }
  .ptvc-all__s { display: inline; }

  .ptvc-grid { gap: 10px; padding-right: 16px; }
  .ptvc-grid .ptvc-card { flex-basis: 196px; }
  .ptvc-grid .ptvc-media { height: 132px; }
  .ptvc-grid .ptvc-body { padding: 10px 10px 12px 12px; }
  .ptvc-grid .ptvc-t { font-size: 13px; }
  .ptvc-grid .ptvc-sub { display: none; }

  .ptvc-pair { grid-template-columns: 1fr; gap: 12px; }

  .ptvc-adv .ptvc-wrap { grid-template-columns: 1fr; gap: 18px; padding-top: 24px; padding-bottom: 24px; }
}
