/* ============================================
   CATALOG PAGE — стили скопированы из старого catalog.html (lift-and-shift)
   ============================================ */

.catalog-page { padding-top: 100px; min-height: 100vh; }
.catalog-wrapper { padding: 4vw var(--spacing-container) var(--spacing-padding); }

/* Шапка каталога: H1 слева, описание/счётчик справа (оба сверху видны,
   чтобы при смене фильтра было очевидно какая именно категория активна). */
.catalog-top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 3vw;
}
.catalog-top-right { text-align: left; max-width: none; }

.catalog-heading {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #1a1a1a;
}
.catalog-subtitle {
  font-size: clamp(0.88rem, 1vw, 1rem);
  font-weight: 300;
  color: rgba(0,0,0,0.65);
  line-height: 1.55;
  max-width: 720px;
  margin: 0;
}
.catalog-subtitle p { margin: 0 0 6px; }
.catalog-subtitle p:last-child { margin-bottom: 0; }

/* Фильтры — выровнены по центру внутри catalog-wrapper, не выходят за края контейнера.
   Поиск шире остальных — чтобы placeholder «по названию или артикулу» читался. */
.catalog-filters {
  display: grid;
  grid-template-columns: 2.4fr 1.4fr repeat(6, minmax(0, 1fr)) 1.3fr 1.2fr;
  gap: 18px 10px;
  align-items: end;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 3vw;
  padding: 0 0 2vw;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  box-sizing: border-box;
}
.cf-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-cell > label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.5);
  font-weight: 500;
  line-height: 1.25;
  /* Разрешаем перенос — длинные лейблы («Уступаем с любовью») не будут обрезаться */
  white-space: normal;
  min-height: 1.8em;
}
.cf-cell select,
.cf-cell input[type="search"],
.cf-cell input[type="number"] {
  width: 100%; box-sizing: border-box;
  padding: 9px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.3;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.cf-cell select:hover,
.cf-cell input:hover {
  border-color: rgba(180, 154, 106, 0.55);
  background: #faf8f5;
}
/* Поиск — placeholder серый и компактный, вмещает «по названию или артикулу» */
.cf-cell.cf-search input[type="search"] {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.8);
  padding-left: 14px;
  padding-right: 12px;
  letter-spacing: 0;
}
.cf-cell input[type="search"]::placeholder {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0;
}
.cf-cell input[type="search"]::-webkit-input-placeholder { color: rgba(0,0,0,0.4); font-size: 0.75rem; font-weight: 300; }
.cf-cell input[type="search"]:-moz-placeholder { color: rgba(0,0,0,0.4); font-size: 0.75rem; font-weight: 300; opacity: 1; }
.cf-cell select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Стрелка-шеврон в стиле сайта (золотистый цвет бренда) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23b49a6a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.cf-cell select:focus,
.cf-cell input:focus {
  outline: none;
  border-color: #b49a6a;
  box-shadow: 0 0 0 3px rgba(180, 154, 106, 0.12);
  background: #fff;
}

/* Кастомный dropdown — заменяет native <select> стилизованным popup'ом.
   JS (catalog.js:enhanceDropdowns) строит .cf-dd wrapper вокруг каждого select,
   показывает .cf-dd-trigger и .cf-dd-list. Native select остаётся в DOM скрытым
   — как source-of-truth для value и change-события (existing listener'ы работают). */
.cf-dd {
  position: relative;
  width: 100%;
}
.cf-dd select {
  /* visually-hidden но доступен для программного доступа */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
}
.cf-dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px 9px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.3;
  color: #1a1a1a;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.cf-dd-trigger:hover {
  border-color: rgba(180, 154, 106, 0.55);
  background: #faf8f5;
}
.cf-dd.is-open .cf-dd-trigger {
  border-color: #b49a6a;
  box-shadow: 0 0 0 3px rgba(180, 154, 106, 0.15);
  background: #fff;
}
.cf-dd-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-dd-caret {
  flex-shrink: 0;
  color: #b49a6a;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}
.cf-dd.is-open .cf-dd-caret {
  transform: rotate(180deg);
}

/* Сам список — кастомный popup в стиле сайта.
   Ширина НЕ ограничена trigger'ом: popup может выходить за правую границу ячейки,
   если опции длинные (например «Текстурированная Матовая Высокой Прочности»). */
.cf-dd-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 100%;
  width: max-content;
  max-width: min(360px, 92vw);
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.cf-dd.is-open .cf-dd-list {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cf-dd-option {
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #1a1a1a;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  /* Разрешаем перенос и не обрезаем текст — длинные опции читаются целиком */
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: unset;
}
.cf-dd-option + .cf-dd-option {
  margin-top: 2px;
}
.cf-dd-option {
  /* flex чтобы swatch/icon был слева, текст посередине, галочка справа */
  display: flex;
  align-items: center;
  gap: 10px;
}
.cf-dd-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Кружок цвета (в dropdown цвета) — слева */
.cf-dd-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Фото-иконка стиля (в dropdown стиля) — слева */
.cf-dd-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: #f0ece4;
}
.cf-dd-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dropdown стиля: фото-иконка 2× крупнее (и слот под неё) */
.cf-dd[data-filter="filterStyle"] .cf-dd-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}
.cf-dd[data-filter="filterStyle"] .cf-dd-slot {
  width: 36px;
}

/* Пустой слот (у опции «Все» или если декор не нужен) — держит выравнивание */
.cf-dd-slot {
  width: 16px;
  flex-shrink: 0;
  display: inline-block;
}

/* В trigger'е label содержит такой же контент — swatch/icon + текст. */
.cf-dd-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.66rem;      /* меньше когда что-то выбрано — помещается в окошко */
  letter-spacing: 0.01em;
}
.cf-dd-label .cf-dd-swatch { width: 12px; height: 12px; }
.cf-dd-label .cf-dd-icon { width: 16px; height: 16px; }
.cf-dd[data-filter="filterStyle"] .cf-dd-label .cf-dd-icon { width: 26px; height: 26px; border-radius: 4px; }
.cf-dd-label .cf-dd-slot { display: none; }
.cf-dd-label .cf-dd-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.cf-dd-option:hover {
  background: #faf8f5;
  color: #b49a6a;
}
.cf-dd-option.is-active {
  background: rgba(180, 154, 106, 0.12);
  color: #8a7550;
  font-weight: 500;
}
.cf-dd-option.is-active::after {
  content: "✓";
  flex-shrink: 0;
  color: #b49a6a;
  font-weight: 600;
}
/* Scrollbar в popup — тонкий */
.cf-dd-list::-webkit-scrollbar { width: 6px; }
.cf-dd-list::-webkit-scrollbar-track { background: transparent; }
.cf-dd-list::-webkit-scrollbar-thumb { background: rgba(180, 154, 106, 0.3); border-radius: 3px; }
.cf-dd-list::-webkit-scrollbar-thumb:hover { background: rgba(180, 154, 106, 0.5); }

.cf-price-inputs { display: flex; gap: 6px; }
.cf-price-inputs input { padding: 8px 10px; text-align: left; }
.cf-price-inputs input::-webkit-outer-spin-button,
.cf-price-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cf-price-inputs input[type="number"] { -moz-appearance: textfield; }

.cf-checkbox-wrap {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid rgba(0,0,0,0.15);
  border-radius: 50px; background: #fff; cursor: pointer;
  font-size: 0.85rem; color: #1a1a1a; user-select: none;
  transition: background 0.2s, border-color 0.2s;
}
.cf-checkbox-wrap:hover { border-color: #b49a6a; }
.cf-checkbox-wrap input { width: 14px; height: 14px; margin: 0; accent-color: #b49a6a; }
.cf-checkbox-wrap input:checked ~ span { color: #b49a6a; font-weight: 500; }

.cf-reset-btn {
  padding: 8px 16px; border: 1px solid #b49a6a;
  border-radius: 50px; font-family: inherit; font-size: 0.85rem;
  font-weight: 500; color: #b49a6a; background: #fff;
  cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.cf-reset-btn:hover { background: #b49a6a; color: #fff; }
.cf-reset-btn .catalog-results-count {
  font-size: 0.75rem; padding: 2px 8px; border-radius: 50px;
  background: rgba(180,154,106,0.15); color: inherit; font-weight: 400;
}
.cf-reset-btn:hover .catalog-results-count { background: rgba(255,255,255,0.25); }

/* Discount badge on card */
.catalog-card { position: relative; }
.catalog-card-discount {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  background: #b49a6a; color: #fff;
  padding: 4px 10px; border-radius: 50px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em;
}
/* Ряд «цена + в наличии» на карточке — в одну строку */
.catalog-card-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.catalog-card-price {
  font-size: 0.95rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
}
.catalog-card-price span {
  font-size: 0.75rem;
  color: rgba(0,0,0,0.5);
  font-weight: 400;
}

/* Остаток на карточке каталога. Бордер — только вокруг лейбла («В наличии:» /
   «Под заказ»), цифры рядом без рамки. */
.catalog-card-stock {
  font-size: 0.78rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.catalog-card-stock-label {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.5);
}
.catalog-card-stock-value {
  font-weight: 500;
  color: inherit;
}
.catalog-card-stock-in {
  color: #2a7a2a;
}
.catalog-card-stock-in .catalog-card-stock-label {
  border-color: rgba(42, 122, 42, 0.35);
  color: #2a7a2a;
  background: rgba(42, 122, 42, 0.06);
}
.catalog-card-stock-pre {
  color: rgba(0, 0, 0, 0.45);
  font-weight: 400;
}
.catalog-card-stock-pre .catalog-card-stock-label {
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.55);
}

/* Collection group */
.catalog-group { margin-bottom: 4vw; }
.catalog-group.is-hidden { display: none; }
.catalog-group-name {
  font-size: clamp(1.5rem, 2.5vw, 2.5vw); font-weight: 200;
  letter-spacing: -0.02em; color: #1a1a1a;
  padding: 1.5vw 0; border-bottom: 1px solid rgba(0,0,0,0.1);
  margin-bottom: 2vw;
}

/* Cards grid */
.catalog-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.catalog-card {
  border: 1px solid rgba(0,0,0,0.08); border-radius: 16px;
  overflow: hidden; transition: box-shadow 0.4s ease, transform 0.4s ease;
  cursor: pointer; text-decoration: none; color: inherit; display: block;
}
.catalog-card.is-hidden { display: none; }
.catalog-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08); transform: translateY(-4px);
  opacity: 1;
}
.catalog-card-image {
  overflow: hidden; background: #f5f5f5;
  aspect-ratio: 600 / 1200;
}
.catalog-card[data-size="600X900"] .catalog-card-image { aspect-ratio: 600 / 900; }
/* Узкая планка 200×1200 (коллекция «Окаменелый лес») — фото по центру блока,
   чтобы не «висело» слева и не выглядело ошибкой. */
.catalog-card[data-size="200X1200"] .catalog-card-image {
  aspect-ratio: auto;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}
.catalog-card[data-size="200X1200"] .catalog-card-image img {
  width: auto;
  max-width: 60%;
  height: 100%;
  object-fit: contain;
}

.catalog-card-image img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 0.5s ease;
}
.catalog-card:hover .catalog-card-image img { transform: scale(1.05); }
.catalog-card-image .catalog-card-noimage {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,0.18); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
}

.catalog-card-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 180px; /* нижняя кромка стабильна для «Подробнее» */
}
.catalog-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 16px 12px;
}
.catalog-card-art {
  font-size: 0.7rem; color: rgba(0,0,0,0.35); font-weight: 400; letter-spacing: 0.02em;
}
.catalog-card-design {
  font-size: 0.78rem; color: #b49a6a; text-align: right; line-height: 1.35;
  letter-spacing: 0.02em; font-weight: 500; transition: color 0.3s;
}
.catalog-card:hover .catalog-card-design { color: #8a7550; }

.catalog-card-name {
  font-size: 0.95rem; font-weight: 400; letter-spacing: -0.01em;
  color: #1a1a1a; margin-bottom: 8px; line-height: 1.3;
}
.catalog-card-specs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.catalog-card-specs span {
  padding: 4px 12px; border: 1px solid rgba(0,0,0,0.12);
  border-radius: 50px; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: rgba(0,0,0,0.5);
}
.catalog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.56rem;        /* 30% меньше (было 0.8rem) */
  font-weight: 400;
  color: #b49a6a;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.3s ease, color 0.2s ease;
  margin-top: auto;          /* прижато к низу карточки */
  align-self: flex-end;      /* справа */
  padding-top: 14px;         /* визуальный отрыв от блока цены/наличия */
}
.catalog-card:hover .catalog-card-link { color: #8a7550; }
.catalog-card-link:hover { opacity: 1; color: #8a7550; }
.catalog-card-link .material-icons { font-size: 14px; }
.catalog-card-link.disabled { color: rgba(0,0,0,0.2); pointer-events: none; }

/* Empty state */
.catalog-empty {
  text-align: center; padding: 6vw 0;
  font-size: 1.1rem; font-weight: 300; color: rgba(0,0,0,0.4);
}

/* Responsive */
@media (max-width: 991px) {
  .catalog-top { grid-template-columns: 1fr; gap: 1.2rem; }
  .catalog-top-right { text-align: left; max-width: 100%; }
  .catalog-subtitle { margin: 0; max-width: 100%; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 1199px) {
  .catalog-filters {
    grid-template-columns: 1.4fr 1.4fr repeat(3, 1fr);
    row-gap: 18px;
  }
}
@media (max-width: 767px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-filters { grid-template-columns: 1fr 1fr; }
  .cf-cell.cf-search { grid-column: 1 / -1; }
  .cf-cell.cf-reset { grid-column: 1 / -1; }
  /* Дропдаун фильтра не должен вылезать за правый край: на узкой сетке (2 колонки)
     ограничиваем шириной ячейки (left:0). Опции переносятся (white-space:normal). */
  .cf-dd-list { max-width: 100%; }
}

/* Пагинация и фильтр-скрытие. Карточки остаются в DOM (SEO), но прячутся от
   пользователя через display:none когда не попадают в текущую страницу
   или не соответствуют фильтру. */
.catalog-card.is-filter-hidden,
.catalog-card.is-page-hidden { display: none; }

.catalog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.catalog-pagination--top    { margin: 16px 0 24px; }
.catalog-pagination--bottom { margin-top: 48px; }
.catalog-pagination:empty { display: none; }
.catalog-pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}
.catalog-pagination-btn:hover:not(:disabled):not(.is-active) {
  background: #f5f0ea;
  border-color: rgba(0, 0, 0, 0.3);
}
.catalog-pagination-btn.is-active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  cursor: default;
}
.catalog-pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.catalog-pagination-ellipsis {
  padding: 0 4px;
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  user-select: none;
}

/* Хлебные крошки на фасетной странице */
.catalog-crumb {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 1.2vw;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.catalog-crumb a {
  color: rgba(0, 0, 0, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}
.catalog-crumb a:hover { color: #b49a6a; }
.catalog-crumb-sep { color: rgba(0, 0, 0, 0.3); }

.catalog-subtitle .catalog-count {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.55);
  margin-top: 8px;
}

/* Активный фасет в фильтре */
.cf-active-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: rgba(0, 0, 0, 0.55);
}
.cf-active-label { letter-spacing: 0.05em; text-transform: uppercase; }
.cf-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 50px;
  background: #b49a6a;
  color: #fff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.2s;
}
.cf-active-badge:hover { background: #8a7550; }
.cf-active-badge span {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Популярные сочетания (L1 → L2 перелинковка) */
.catalog-popular-combos {
  margin-top: 6vw;
  padding-top: 3vw;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.cpc-heading {
  font-size: clamp(1.4rem, 2vw, 2vw);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin-bottom: 10px;
}
.cpc-lead {
  font-size: 0.92rem;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 2vw;
  max-width: 640px;
  line-height: 1.55;
}
.cpc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.cpc-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  background: #faf8f5;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
}
.cpc-card:hover {
  background: #f2ece2;
  border-color: #b49a6a;
  transform: translateX(2px);
}
/* 2 первые фото товаров — стопкой со сдвигом, как «карточный веер» */
.cpc-card-thumbs {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.cpc-thumb {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #fff;
  background: #f0ece4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.cpc-thumb + .cpc-thumb { margin-left: -10px; }
.cpc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cpc-card-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.35;
  min-width: 0;
  align-self: center;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}
.cpc-card-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
  align-self: start;
  line-height: 1.1;
}
.cpc-count-num {
  font-size: 1.05rem;
  font-weight: 600;
  color: #b49a6a;
  font-variant-numeric: tabular-nums;
}
.cpc-count-label {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.5);
  text-transform: lowercase;
  margin-top: 2px;
  letter-spacing: 0.01em;
}
.cpc-card:hover .cpc-count-num { color: #8a7550; }
.cpc-card:hover .cpc-count-label { color: #8a7550; }
@media (max-width: 767px) {
  .cpc-grid { grid-template-columns: 1fr; }
}

/* SEO-текст внизу */
.catalog-seo-text {
  margin-top: 6vw;
  padding-top: 3vw;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 960px;
}
.catalog-seo-text h2 {
  font-size: clamp(1.3rem, 1.8vw, 1.8vw);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin: 1.5vw 0 0.8vw;
}
.catalog-seo-text p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.75);
  margin-bottom: 1vw;
}
.catalog-seo-internal {
  margin-top: 2vw;
  font-size: 0.85rem !important;
  color: rgba(0, 0, 0, 0.55) !important;
}
.catalog-seo-internal a {
  color: #b49a6a;
  text-decoration: none;
  border-bottom: 1px dotted rgba(180, 154, 106, 0.4);
  transition: all 0.2s;
}
.catalog-seo-internal a:hover {
  color: #8a7550;
  border-bottom-color: currentColor;
}

/* Чип счётчика результатов + view-toggle в одну строку — справа от subtitle */
.catalog-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.catalog-results-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(180, 154, 106, 0.35);
  background: rgba(180, 154, 106, 0.08);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #8a7550;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.catalog-results-chip .catalog-results-count {
  font-weight: 600;
  color: #1a1a1a;
}

/* ============= View Toggle (сетка / таблица) ============= */
.catalog-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  margin-top: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
}
.catalog-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.18s ease, color 0.18s ease;
}
.catalog-view-btn:hover { color: #1a1a1a; }
.catalog-view-btn.is-active {
  background: rgba(180, 154, 106, 0.14);
  color: #8a7550;
}
.catalog-view-btn svg { display: block; }

/* Видимость двух представлений: переключается через data-view на .catalog-page */
.catalog-page[data-view="grid"]  .catalog-table-wrapper { display: none; }
.catalog-page[data-view="table"] .catalog-groups-wrap   { display: none; }

/* ============= Catalog Table ============= */
.catalog-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fff;
  margin-top: 18px;
}
.catalog-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 0.78rem;
  color: #1a1a1a;
}
.catalog-table thead {
  background: #faf8f5;
  border-bottom: 1px solid rgba(180, 154, 106, 0.35);
}
.catalog-table thead th {
  position: sticky;
  top: 0;
  background: #faf8f5;
  z-index: 1;
  padding: 12px 10px;
  text-align: left;
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  border-bottom: 1px solid rgba(180, 154, 106, 0.35);
}
.catalog-table thead th.cr-price,
.catalog-table thead th.cr-discount,
.catalog-table thead th.cr-stock {
  text-align: right;
}
.catalog-row {
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.catalog-row:last-child { border-bottom: none; }
.catalog-row:hover { background: rgba(180, 154, 106, 0.06); }
.catalog-row td {
  padding: 10px;
  vertical-align: middle;
  white-space: nowrap;
}
.catalog-row td.cr-name {
  white-space: normal;
  font-weight: 500;
  min-width: 200px;
}
.catalog-row td.cr-collection { color: rgba(0, 0, 0, 0.65); }
.catalog-row td.cr-thumb {
  width: 64px;
  padding: 6px 10px;
}
.catalog-row td.cr-thumb img,
.catalog-row td.cr-thumb .cr-noimage {
  /* Размеры (width/height) задаются inline-style в productRow() — пропорционально
     реальным габаритам плитки. Здесь только общие свойства. */
  display: block;
  object-fit: cover;
  border-radius: 4px;
  background: #f4f2ec;
}
.catalog-row td.cr-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.catalog-row td.cr-discount {
  text-align: right;
  color: #c0392b;
  font-weight: 500;
}
.catalog-row td.cr-stock { text-align: right; }
.cr-stock-in {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(46, 125, 50, 0.3);
  border-radius: 50px;
  color: #2e7d32;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: rgba(46, 125, 50, 0.06);
}
.cr-stock-pre {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50px;
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.72rem;
}
.catalog-row.is-filter-hidden,
.catalog-row.is-page-hidden { display: none; }

@media (max-width: 640px) {
  .catalog-table thead th { padding: 8px 6px; font-size: 0.68rem; }
  .catalog-row td { padding: 6px; }
  .catalog-row td.cr-name { min-width: 160px; }
  .catalog-view-toggle { margin-top: 8px; }
}

/* Сортировка таблицы — индикаторы на заголовках */
.catalog-table th[data-sort] {
  cursor: pointer;
  user-select: none;
  padding-right: 22px;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}
.catalog-table th[data-sort]:hover { color: #1a1a1a; background: #f4f1e8; }
.catalog-table th[data-sort]::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 12px;
  margin-top: -6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='12' viewBox='0 0 8 12'%3E%3Cpath d='M4 0l4 4H0z' fill='%23999' opacity='0.5'/%3E%3Cpath d='M4 12l-4-4h8z' fill='%23999' opacity='0.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.catalog-table th.is-sort-asc::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='12' viewBox='0 0 8 12'%3E%3Cpath d='M4 0l4 4H0z' fill='%23b49a6a'/%3E%3Cpath d='M4 12l-4-4h8z' fill='%23999' opacity='0.25'/%3E%3C/svg%3E");
}
.catalog-table th.is-sort-desc::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='12' viewBox='0 0 8 12'%3E%3Cpath d='M4 0l4 4H0z' fill='%23999' opacity='0.25'/%3E%3Cpath d='M4 12l-4-4h8z' fill='%23b49a6a'/%3E%3C/svg%3E");
}
.catalog-table th.is-sort-asc, .catalog-table th.is-sort-desc { color: #8a7550; }

/* Toolbar над таблицей — кнопка шестерёнки справа, под ней тонкая линия-разделитель.
   Линия близко к фильтрам (filter margin-bottom = 0; гэп — padding снизу toolbar). */
.catalog-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  padding-bottom: 8px;
  margin: 0 0 14px;
}
.catalog-table-toolbar::before { content: none; display: none; }
.catalog-table-toolbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}
.catalog-page[data-view="grid"] .catalog-table-toolbar { display: none; }
/* В табличном виде линия — у toolbar; у фильтра убираем border и сжимаем gap */
.catalog-page[data-view="table"] .catalog-filters {
  border-bottom: none;
  margin-bottom: 8px;
  padding-bottom: 0;
}
.catalog-page[data-view="table"] .catalog-table-wrapper { margin-top: 0; }
.cp-wrap { position: relative; }
.catalog-cols-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  color: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.catalog-cols-btn:hover {
  border-color: rgba(180, 154, 106, 0.55);
  color: #8a7550;
  background: #faf8f5;
}
.catalog-cols-btn[aria-expanded="true"] {
  border-color: #b49a6a;
  color: #8a7550;
  box-shadow: 0 0 0 3px rgba(180, 154, 106, 0.15);
}
.catalog-cols-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 240px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.cp-wrap.is-open .catalog-cols-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cp-title {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(0, 0, 0, 0.5);
}
.cp-list { display: flex; flex-direction: column; gap: 2px; }
.cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  color: #1a1a1a;
}
.cp-row:hover { background: #faf8f5; }
.cp-name { flex: 1 1 auto; }

/* Переключатель в стиле iOS */
.cp-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.cp-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 50px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.cp-switch::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s ease;
}
.cp-input:checked + .cp-switch { background: #b49a6a; }
.cp-input:checked + .cp-switch::before { left: 16px; }
.cp-input:focus-visible + .cp-switch {
  outline: 2px solid rgba(180, 154, 106, 0.4);
  outline-offset: 2px;
}

/* Скрытие колонок: класс на .catalog-table управляет видимостью */
.catalog-table.col-hide-thumb      .cr-thumb,
.catalog-table.col-hide-sku        .cr-sku,
.catalog-table.col-hide-name       .cr-name,
.catalog-table.col-hide-collection .cr-collection,
.catalog-table.col-hide-size       .cr-size,
.catalog-table.col-hide-style      .cr-style,
.catalog-table.col-hide-finish     .cr-finish,
.catalog-table.col-hide-color      .cr-color,
.catalog-table.col-hide-price      .cr-price,
.catalog-table.col-hide-discount   .cr-discount,
.catalog-table.col-hide-stock      .cr-stock,
.catalog-table.col-hide-reserve    .cr-reserve,
.catalog-table.col-hide-transit    .cr-transit { display: none; }

/* Резерв/Ожидание — выровнены вправо как и Остаток */
.catalog-table thead th.cr-reserve,
.catalog-table thead th.cr-transit { text-align: right; }
.catalog-row td.cr-reserve,
.catalog-row td.cr-transit {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cr-reserve-on {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(180, 154, 106, 0.35);
  border-radius: 50px;
  color: #8a7550;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: rgba(180, 154, 106, 0.08);
}
.cr-transit-on {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(74, 124, 188, 0.35);
  border-radius: 50px;
  color: #3a6ba0;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: rgba(74, 124, 188, 0.08);
}
.cr-zero { color: rgba(0, 0, 0, 0.3); }

/* Визуальные подсказки в ячейках таблицы (как в выпадашках фильтра) */
.catalog-row td.cr-color,
.catalog-row td.cr-style {
  white-space: nowrap;
}
.cr-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  vertical-align: -3px;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.cr-icon {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  overflow: hidden;
  vertical-align: -8px;
  margin-right: 8px;
  background: #f0ece4;
}
.cr-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Скидка — красный пилл (как .catalog-card-discount) */
.cr-discount-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 50px;
  background: rgba(192, 57, 43, 0.1);
  border: 1px solid rgba(192, 57, 43, 0.25);
  color: #c0392b;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.catalog-row td.cr-discount { color: inherit; font-weight: 400; }

@media (max-width: 640px) {
  .cr-icon { width: 22px; height: 22px; vertical-align: -6px; margin-right: 6px; }
  .cr-swatch { width: 12px; height: 12px; margin-right: 6px; }
}

/* Drag-разделители для resize колонок таблицы */
.catalog-table th { position: relative; }
.cr-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
  transition: background 0.15s ease;
}
.cr-resize:hover { background: rgba(180, 154, 106, 0.4); }
.catalog-table.is-resizing,
.catalog-table.is-resizing th { cursor: col-resize; user-select: none; }
.catalog-table.is-resizing .cr-resize { background: rgba(180, 154, 106, 0.6); }

/* Активные чипы фильтра — над таблицей/карточками */
.catalog-active-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 14px;
  min-height: 0;
}
.catalog-active-row:empty { display: none; }
.cf-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 4px 4px 12px;
  border-radius: 50px;
  background: rgba(180, 154, 106, 0.1);
  border: 1px solid rgba(180, 154, 106, 0.3);
  font-size: 0.74rem;
  color: #8a7550;
  font-weight: 500;
  white-space: nowrap;
}
.cf-chip-label {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border: none;
  background: rgba(180, 154, 106, 0.18);
  border-radius: 50%;
  cursor: pointer;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.cf-chip-remove:hover {
  background: #b49a6a;
  color: #fff;
}
