/* ========== CATALOG PAGE ========== */

.header-nav-links a.nav-active { color: #fff !important; }

.container {
  max-width: var(--site-max, 1560px);
  margin: 0 auto;
  padding: 0 var(--site-gutter, 40px);
}

/* Отступ сверху: header в потоке страницы (не sticky) */
:root {
  --catalog-header-clear: 16px;
}

/* Breadcrumbs */
.bc,
.breadcrumbs {
  padding: var(--catalog-header-clear) 0 18px;
  background: var(--off-white);
  border-bottom: 1px solid var(--border);
}
.bc .container,
.breadcrumbs .container {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.bc a,
.breadcrumbs a {
  color: var(--text-2); text-decoration: none; font-size: 13px;
  letter-spacing: 0.5px; transition: color 0.3s;
}
.bc a:hover,
.breadcrumbs a:hover { color: var(--accent); }
.bc span,
.breadcrumbs span,
.bc-sep,
.breadcrumbs .bc-sep { color: var(--text-2); font-size: 13px; }
.bc-active,
.bc-current,
.breadcrumbs .bc-current {
  color: var(--text) !important; letter-spacing: 0.5px; font-size: 14px;
}

/* Layout */
.catalog,
.catalog-section {
  padding: 0 0 88px;
  background: var(--off-white);
}

.catalog-header {
  padding: 4px 0 28px;
  margin-bottom: 8px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.catalog-header .section-title {
  margin: 8px 0 0;
  line-height: 1.15;
}
.catalog-header .section-tag { margin-bottom: 0; }

.catalog-main {
  min-width: 0;
}

.catalog-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 0 0;
  display: grid; grid-template-columns: minmax(250px, 285px) 1fr; gap: 26px; align-items: start;
}

/* Sidebar */
.filters {
  position: sticky;
  top: 16px;
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 18px;
  z-index: 2;
  min-width: 300px;
  align-self: start;
}

.filter-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 500;
  color: var(--text); margin-bottom: 12px;
}

.filter-group { margin-bottom: 12px; }
.filter-group:last-of-type { margin-bottom: 0; }
.filter-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 7px;
}

.filter-check {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0; cursor: pointer; font-size: 14px; color: var(--text-2);
}
.filter-check input { display: none; }

.checkmark {
  width: 16px; height: 16px; border-radius: 3px;
  background: var(--white); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}

.filter-check input:checked + .checkmark {
  background: var(--accent); border-color: var(--accent);
}
.filter-check input:checked + .checkmark::after {
  content: '\2713'; color: #fff; font-size: 10px; font-weight: 700;
}

.filter-search {
  width: 100%;
  padding: 10px 12px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.filter-search:focus { border-color: var(--accent); }
.filter-search::placeholder { color: var(--text-3); }

.filter-group--search { margin-bottom: 14px; }

/* Price range */
.price-range { display: flex; gap: 8px; align-items: center; }
.price-range input {
  width: 100%; padding: 12px 14px;
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color 0.3s;
}
.price-range input:focus { border-color: var(--accent); }
.price-range span { color: var(--text-2); font-size: 13px; }

/* Sort */
#sort-select {
  width: 100%; padding: 9px 36px 9px 12px;
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  outline: none; appearance: none; cursor: pointer; transition: border-color 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23a8a29e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
#sort-select:focus { border-color: var(--accent); }

/* Buttons */
.filter-actions { display: flex; gap: 8px; margin-top: 8px; }

.btn-apply {
  flex: 1; padding: 9px 10px;
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s;
}
.btn-apply:hover { background: var(--accent-light); }

.btn-reset {
  flex: 1; padding: 9px 10px;
  background: transparent; color: var(--text-3);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s;
}
.btn-reset:hover { border-color: var(--text-3); color: var(--text-2); }
.btn-reset--full { width: 100%; }

/* Product count */
.catalog-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.catalog-count {
  font-size: 13px; color: var(--text-2);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.catalog-count span { font-weight: 700; color: var(--accent); }

/* Grid */
.catalog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}

/* Cards — NO borders, NO shadows at rest */
.catalog-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; transition: all 0.35s;
  opacity: 0; animation: cardFadeIn 0.4s ease forwards;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

/* WHITE image zone — photo edges invisible */
.catalog-card-img {
  height: 270px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

.catalog-card-img img {
  max-height: 240px; max-width: 90%; width: auto;
  object-fit: contain; transition: transform 0.4s;
}

.catalog-card:hover .catalog-card-img img { transform: scale(1.05); }

.catalog-card-info { padding: 20px; display: flex; flex-direction: column; }

.catalog-card-name {
  font-family: var(--font-display); font-size: 21px; font-weight: 500;
  color: var(--text); margin-bottom: 2px;
}
.catalog-card-variant { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }

.catalog-card-stock {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); margin-bottom: 16px;
}
.stock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.stock-dot.in-stock { background: #22c55e; }

/* Specs */
.catalog-card-specs { margin-bottom: 16px; }
.spec-row {
  display: flex; justify-content: space-between; padding: 5px 0;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.spec-row:last-child { border-bottom: none; }
.spec-row span:first-child { color: var(--text-3); }
.spec-row span:last-child { color: var(--text-2); font-weight: 500; text-align: right; }

/* Bottom */
.catalog-card-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px; border-top: 1px solid var(--border);
}

.catalog-card-price {
  font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--accent);
}
.catalog-card-price small { font-size: 14px; color: var(--text-2); font-weight: 400; }

.btn-order {
  padding: 10px 20px; background: transparent;
  border: 1.5px solid var(--accent); border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s;
}
.btn-order:hover { background: var(--accent); color: #fff; }

.product-tags {
  position: absolute; top: 16px; left: 16px;
  display: flex; flex-direction: column; gap: 6px; z-index: 2;
}
.product-tag {
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: 5px 12px; border-radius: 4px;
}
.product-tag--thermo { background: #1a1714; }
.product-tag--hit { background: var(--accent); }
.product-tag--new { background: #2f6b4f; }

.no-results {
  grid-column: 1 / -1; text-align: center; padding: 80px 20px;
  font-size: 16px; color: var(--text-3);
}

/* Responsive */
@media (max-width: 1200px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; display: flex; flex-wrap: wrap; gap: 20px; }
  .filter-group { flex: 1; min-width: 180px; margin-bottom: 0; }
}
@media (max-width: 640px) {
  .catalog-layout { padding: 0 20px; }
  .catalog-grid { grid-template-columns: 1fr; }
}

/* ========== НОВЫЕ ФИЛЬТРЫ ========== */

/* Steel chips */
.steel-options {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.steel-chip {
  cursor: pointer;
}
.steel-chip input { display: none; }
.steel-chip span {
  display: inline-block; padding: 6px 10px;
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 11px; color: var(--text-2);
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 36px;
  text-align: center;
}
.steel-chip input:checked + span {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* Color swatches */
.color-swatches {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px;
}
.swatch {
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.swatch img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--accent); transform: scale(1.15); }

/* Кружок "Все цвета" — радужный градиент */
.swatch--all {
  background: conic-gradient(
    #8B4513 0deg 40deg,
    #D2691E 40deg 80deg,
    #DAA520 80deg 120deg,
    #C8C8A0 120deg 160deg,
    #A9A9A9 160deg 200deg,
    #F5F5DC 200deg 240deg,
    #8B6914 240deg 280deg,
    #696969 280deg 320deg,
    #8B4513 320deg 360deg
  );
  display: flex; align-items: center; justify-content: center;
}
.swatch--all span {
  font-family: 'Montserrat', sans-serif;
  font-size: 7px; font-weight: 700;
  color: #fff; letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  text-transform: uppercase;
}
.color-label {
  font-size: 11px; color: var(--text-3); min-height: 14px;
}

/* Brand tiles (производители с логотипами) */
.brand-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.brand-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.brand-tile input { display: none; }
.brand-tile img {
  max-width: 100%;
  max-height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}
.brand-tile--all {
  grid-column: 1 / -1;
  min-height: 36px;
  padding: 8px 12px;
}
.brand-tile--all span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
}
.brand-tile--text span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-2);
}
.brand-tile--text.is-active span { color: var(--accent); }
.brand-tile:hover {
  border-color: var(--accent-light);
  transform: translateY(-1px);
}
.brand-tile.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.brand-tile.is-active.brand-tile--all span { color: var(--accent); }

/* Price slider */
.price-inputs {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.price-inputs input {
  width: 100%; padding: 7px 10px;
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 13px; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.price-inputs input:focus { border-color: var(--accent); }
.price-inputs span { color: var(--text-3); flex-shrink: 0; }

.range-track {
  position: relative; height: 4px;
  background: var(--border); border-radius: 2px; margin-bottom: 6px;
}
.range-fill {
  position: absolute; height: 100%;
  background: var(--accent); border-radius: 2px;
  pointer-events: none;
}
.range-track input[type="range"] {
  position: absolute; width: 100%; height: 4px;
  top: 0; left: 0; background: none;
  appearance: none; pointer-events: none;
  outline: none;
}
.range-track input[type="range"]::-webkit-slider-thumb {
  appearance: none; pointer-events: all;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer; transition: transform 0.2s;
}
.range-track input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-3);
}

/* ========== PAGINATION ========== */
.pagination {
  margin: 40px 0 20px;
  text-align: center;
}
.pagination-info {
  font-size: 13px; color: #888; margin-bottom: 12px;
}
.pagination-pages {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; flex-wrap: wrap;
}
.pagination-label {
  font-size: 14px; color: #555; margin-right: 4px;
}
.page-num {
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid #ddd; background: #fff;
  border-radius: 4px; cursor: pointer;
  font-family: 'Montserrat', sans-serif; font-size: 14px;
  color: #333; transition: all 0.2s;
}
.page-num:hover {
  border-color: var(--accent); color: var(--accent);
}
.page-num--active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}


/* ========================================
   АДАПТИВ КАТАЛОГА
   ======================================== */

/* ---- 1024px ---- */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .catalog-header { padding: 0 0 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .catalog-layout { padding: 20px 24px 0; gap: 24px; }

  /* Фильтры горизонтально */
  .filters {
    position: static;
    max-height: none;
    min-width: 0;
    width: 100%;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .filter-title { grid-column: 1 / -1; margin-bottom: 0; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-group { margin-bottom: 0; }
  .filter-group--brands { grid-column: 1 / -1; }
  .filter-group--brands .brand-tiles {
    grid-template-columns: repeat(3, 1fr);
  }
  .filter-group--brands .brand-tile--all {
    grid-column: 1 / -1;
  }
}

/* ---- 768px ---- */
@media (max-width: 768px) {
  :root { --catalog-header-clear: 12px; }
  .bc,
  .breadcrumbs { padding-bottom: 14px; }
  .catalog-header { padding: 0 0 12px; }
  .catalog-layout { padding: 16px 16px 0; }

  /* Фильтры — кнопка показать/скрыть */
  .filters {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .catalog-card-img { height: 200px; }
  .catalog-card-img img { max-height: 170px; }
  .catalog-card-info { padding: 14px; }
  .catalog-card-name { font-size: 17px; }
  .catalog-card-price { font-size: 20px; }

  .catalog-top { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Пагинация */
  .pagination-pages { gap: 4px; }
  .page-num { min-width: 30px; height: 30px; font-size: 13px; }
}

/* ---- 480px ---- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .catalog-layout { padding: 12px 16px 0; }
  .catalog-header { padding: 0 0 10px; }

  /* Фильтры компактные */
  .catalog-card { min-width: 0; }
  .catalog-card-name { overflow-wrap: anywhere; }
  .filter-group { min-width: 100%; }
  .steel-options { gap: 6px; }
  .steel-chip span { padding: 5px 10px; font-size: 11px; }
  .color-swatches { gap: 6px; }
  .swatch { width: 28px; height: 28px; }
  .brand-tiles { gap: 8px; }
  .brand-tile { min-height: 56px; padding: 10px 12px; }
  .brand-tile img { max-height: 42px; }
  .filter-group--brands .brand-tiles { grid-template-columns: repeat(2, 1fr); }

  /* Сетка товаров */
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Карточка компактная */
  .catalog-card-img { height: 160px; }
  .catalog-card-img img { max-height: 140px; }
  .catalog-card-info { padding: 12px; }
  .catalog-card-name { font-size: 15px; margin-bottom: 2px; }
  .catalog-card-variant { font-size: 11px; margin-bottom: 6px; }
  .catalog-card-stock { font-size: 10px; margin-bottom: 10px; }

  /* Скрываем спеки на маленьких — слишком тесно */
  .catalog-card-specs { display: none; }

  /* Низ карточки */
  .catalog-card-bottom { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 10px; }
  .catalog-card-price { font-size: 18px; }
  .btn-order { width: 100%; text-align: center; padding: 8px 12px; font-size: 9px; }

  /* Пагинация */
  .pagination { margin: 24px 0 16px; }
  .pagination-pages { gap: 3px; }
  .page-num { min-width: 28px; height: 28px; font-size: 12px; padding: 0 6px; }
}

/* ---- 360px ---- */
@media (max-width: 360px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-card-img { height: 200px; }
  .catalog-card-specs { display: flex; }
  .catalog-card-bottom { flex-direction: row; align-items: center; }
  .btn-order { width: auto; }
}
