.catalog-layout {
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: 28px;
}

.catalog-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
}

.filter-block {
  margin-bottom: 28px;
}

.filter-block__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.filter-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-categories a {
  font-size: 14px;
  color: var(--color-text-secondary);
  display: flex;
  justify-content: space-between;
}

.filter-categories a:hover,
.filter-categories a.active {
  color: var(--color-primary);
}

.filter-categories span {
  color: var(--color-text-muted);
  font-size: 13px;
}

.price-range {
  margin-bottom: 16px;
  position: relative;
  padding-top: 8px;
}

.price-range__track {
  position: relative;
  height: 4px;
  margin: 0 9px 20px;
  background: var(--color-border);
  border-radius: 2px;
}

.price-range__track-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-primary);
  border-radius: 2px;
}

.price-range__slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.price-range__slider--min {
  z-index: 3;
}

.price-range__slider--max {
  z-index: 4;
}

.price-range__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

.price-range__slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

.price-range__slider::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.price-range__slider::-moz-range-track {
  height: 4px;
  background: transparent;
}

.price-range__inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.price-range__inputs input,
.price-range__input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 0;
  min-width: 0;
}

.price-range__currency {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.price-filter__reset {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
}

.filter-brands {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-brands label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.filter-brands input {
  accent-color: var(--color-primary);
}

.filter-brands span {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 13px;
}

.filter-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition);
}

.color-swatch:hover,
.color-swatch--active {
  border-color: var(--color-primary);
}

/* ── Плитка меток (теги категории) ── */
.catalog-tags {
  margin-bottom: 24px;
}

.catalog-tags__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--color-text);
}

.catalog-tags__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.catalog-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.catalog-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.catalog-tag__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
}

.catalog-tag__count {
  flex-shrink: 0;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.catalog-tag--blue { background: #DBEAFE; }
.catalog-tag--pink { background: #FCE7F3; }
.catalog-tag--green { background: #D1FAE5; }
.catalog-tag--yellow { background: #FEF3C7; }
.catalog-tag--purple { background: #EDE9FE; }
.catalog-tag--orange { background: #FFEDD5; }
.catalog-tag--cyan { background: #CFFAFE; }
.catalog-tag--red { background: #FEE2E2; }
.catalog-tag--lime { background: #ECFCCB; }
.catalog-tag--gray { background: #F3F4F6; }

.catalog-seo--term {
  margin-top: 32px;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.catalog-toolbar__left {
  flex: 1;
  min-width: 0;
}

.catalog-toolbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.catalog-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-secondary);
  flex: 1 1 auto;
  min-width: 0;
}

.catalog-sort .woocommerce-ordering {
  display: block;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.catalog-sort__label {
  white-space: nowrap;
}

.catalog-sort select,
.catalog-sort .orderby,
.woocommerce-ordering .orderby {
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  appearance: none;
  min-width: 220px;
  max-width: 100%;
  line-height: 1.4;
}

.woocommerce-ordering {
  margin: 0;
  float: none;
}

.view-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.view-toggle button,
.view-toggle__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.view-toggle button:hover,
.view-toggle__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.view-toggle button.active,
.view-toggle__btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

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

.catalog-grid--list {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ── Карточка в режиме списка ── */
.product-card--list {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 200px;
  gap: 8px 20px;
  align-items: center;
  padding: 16px 20px;
  height: auto;
}

.product-card--list .product-card__media {
  grid-column: 1;
  grid-row: 1;
}

.product-card--list .product-card__body {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.product-card--list .product-card__aside {
  grid-column: 3;
  grid-row: 1;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 180px;
}

.product-card--list .product-card__image {
  width: 140px;
  height: 120px;
  margin-bottom: 0;
}

.product-card--list .product-card__image img {
  max-height: 110px;
}

.product-card--list .product-card__title {
  font-size: 15px;
  font-weight: 600;
  min-height: auto;
  margin-bottom: 6px;
}

.product-card--list .product-card__rating {
  margin-bottom: 6px;
}

.product-card--list .product-card__desc {
  display: -webkit-box;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card--list .product-card__price {
  margin-bottom: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.product-card--list .product-card__actions {
  width: 100%;
}

.product-card--list .product-card__actions .btn {
  white-space: nowrap;
}

.product-card--list .product-card__favorite {
  top: 16px;
  right: 16px;
}

/* WooCommerce flat card — list view */
.product-card--list > .product-card__badges {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
}

.product-card--list > .product-card__image {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: center;
  width: 140px;
  height: 120px;
  margin-bottom: 0;
}

.product-card--list > .product-card__image img {
  max-height: 110px;
}

.product-card--list > .product-card__title {
  grid-column: 2;
  grid-row: 1;
  font-size: 15px;
  font-weight: 600;
  min-height: auto;
  margin-bottom: 6px;
}

.product-card--list > .product-card__rating {
  grid-column: 2;
  grid-row: 2;
  margin-bottom: 6px;
}

.product-card--list > .product-card__desc {
  grid-column: 2;
  grid-row: 3;
  display: -webkit-box;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card--list > .product-card__price {
  grid-column: 3;
  grid-row: 1;
  margin-bottom: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  justify-self: end;
}

.product-card--list > .product-card__actions {
  grid-column: 3;
  grid-row: 2 / span 2;
  align-self: end;
  width: 100%;
}

/* WooCommerce catalog — list view */
.premier-content ul.products li.product .product-card.product-card--list {
  display: grid;
  flex-direction: unset;
  height: auto;
}

.premier-content ul.products li.product .product-card.product-card--list .product-card__aside {
  margin-top: 0;
}

.premier-content ul.products li.product .product-card.product-card--list .product-card__actions .button {
  margin-top: 0;
}

@media (max-width: 1024px) {
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .catalog-sidebar {
    position: static;
  }

  .catalog-tags__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .catalog-tags__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-toolbar__right {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .catalog-sort {
    flex: 1;
    min-width: 0;
  }

  .catalog-sort select,
  .catalog-sort .orderby,
  .woocommerce-ordering .orderby {
    min-width: 0;
    width: 100%;
  }

  .catalog-grid--list li.product .product-card.product-card--list,
  .product-card--list {
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .product-card--list .product-card__media,
  .catalog-grid--list li.product .product-card.product-card--list .product-card__media {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .product-card--list .product-card__body,
  .catalog-grid--list li.product .product-card.product-card--list .product-card__body {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .product-card--list .product-card__aside,
  .catalog-grid--list li.product .product-card.product-card--list .product-card__aside {
    grid-column: 1 / -1;
    grid-row: 3;
    align-items: stretch;
    min-width: 0;
  }

  .product-card--list .product-card__price,
  .catalog-grid--list li.product .product-card.product-card--list .product-card__price {
    align-items: flex-start;
  }

  .product-card--list .product-card__actions,
  .catalog-grid--list li.product .product-card.product-card--list .product-card__actions {
    grid-row: auto;
  }

  .product-card--list > .product-card__image {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 100px;
  }

  .product-card--list > .product-card__title,
  .product-card--list > .product-card__rating,
  .product-card--list > .product-card__desc {
    grid-column: 2;
  }

  .product-card--list > .product-card__title {
    grid-row: 1;
  }

  .product-card--list > .product-card__rating {
    grid-row: 2;
  }

  .product-card--list > .product-card__desc {
    grid-row: 3;
    grid-column: 2;
  }

  .product-card--list > .product-card__price,
  .product-card--list > .product-card__actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    align-items: stretch;
  }

  .product-card--list > .product-card__price {
    grid-row: 3;
    align-items: flex-start;
  }

  .product-card--list > .product-card__actions {
    grid-row: 4;
  }
}

.catalog-seo {
  margin-top: 48px;
  padding: 28px 32px;
  background: var(--color-bg-gray);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}

.catalog-seo__content {
  max-height: 120px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.35s ease;
}

.catalog-seo__content::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--color-bg-gray));
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.catalog-seo__content--expanded {
  max-height: none;
}

.catalog-seo__content--expanded::after {
  opacity: 0;
}

.catalog-seo__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text);
}

.catalog-seo__subtitle {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--color-text);
}

.catalog-seo__content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.catalog-seo__content p:last-child {
  margin-bottom: 0;
}

.catalog-seo__content a {
  color: var(--color-primary);
}

.catalog-seo__content a:hover {
  text-decoration: underline;
}

.catalog-seo__list {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.catalog-seo__list li {
  margin-bottom: 6px;
}

.catalog-seo__toggle {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  transition: color var(--transition);
}

.catalog-seo__toggle:hover {
  color: var(--color-primary-dark);
}
