@import "./tokens.css";


:is(body.route-catalog-index, body.route-catalog, body.route-shop-view) {
  overflow-x: hidden;
}

:is(body.route-catalog-index, body.route-catalog, body.route-shop-view) .page-main-inner {
  width: 100%;
  max-width: 1360px;
  min-width: 0;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-3xl);
}

:is(body.route-catalog-index, body.route-catalog, body.route-shop-view) .catalog-layout {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

:is(body.route-catalog-index, body.route-catalog, body.route-shop-view) .catalog-grid {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.catalog-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  position: relative;
}

.catalog-hero .pill {
  margin-bottom: var(--space-xs);
}

.catalog-title {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-main);
  margin-bottom: 4px;
}

.catalog-layout {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
}

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

.catalog-filters {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  position: sticky;
  top: 90px;
  padding: 20px;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.catalog-filters .card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-categories {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catalog-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  background-color: var(--color-bg-subtle);
  color: var(--color-text-main);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--motion-base), color var(--motion-base), border-color var(--motion-base), box-shadow var(--motion-base);
  user-select: none;
  white-space: nowrap;
}

.catalog-category__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

@media (hover: hover) and (pointer: fine) {
  .catalog-category:hover:not(.is-active) {
    background-color: var(--color-bg-muted);
    color: var(--color-text-main);
    border-color: var(--color-border-hover);
  }
}

/* Метка категории в списке каталога. Кнопка — space-between, поэтому метка
   встаёт к правому краю сама, без абсолютного позиционирования. */
.catalog-category__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

/* На активной кнопке фон уже зелёный — метка того же цвета исчезла бы,
   поэтому там она выворачивается: белая подложка, зелёный текст. */
.catalog-category.is-active .catalog-category__badge {
  background: #FFFFFF;
  color: var(--color-primary);
}

.catalog-category.is-active {
  background-color: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (max-width: 1024px) {
  .catalog-hero {
    display: none;
  }

  .catalog-filters {
    position: static;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 8px;
  }

  .catalog-filters .card-title {
    display: none;
  }

  .catalog-categories {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 8px;
  }

  .catalog-categories::-webkit-scrollbar {
    display: none;
  }

  .catalog-category {
    flex: 0 0 auto;
    width: auto;
    scroll-snap-align: start;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: #FFFFFF;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
  }

  .catalog-category.is-active {
    background-color: var(--color-primary);
    color: var(--color-primary-text);
    border-color: var(--color-primary);
    font-weight: 700;
  }

  .catalog-filters .catalog-filters__rest {
    display: none;
  }
}

.catalog-brands {
  display: block;
  margin-bottom: 12px;
}

.catalog-brands.is-hidden {
  display: none;
}

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

.catalog-brands__desktop-only {
  display: flex;
}

.catalog-brands__mobile-trigger {
  display: none;
}

.catalog-brands__mobile-panel {
  display: none;
}

.catalog-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.catalog-brand,
.catalog-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  background-color: var(--color-bg-surface);
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background-color var(--motion-base), color var(--motion-base), border-color var(--motion-base), box-shadow var(--motion-base), transform var(--motion-fast);
  user-select: none;
}

@media (hover: hover) and (pointer: fine) {
  .catalog-brand:hover:not(.is-active):not(.is-unavailable),
  .catalog-chip:hover:not(.is-active):not(.is-unavailable) {
    border-color: var(--color-text-main);
    background-color: var(--color-bg-subtle);
  }
}

.catalog-brand:active,
.catalog-chip:active {
  transform: scale(0.97);
}

.catalog-brand.is-active,
.catalog-chip.is-active {
  background-color: var(--color-text-main);
  color: #FFFFFF;
  border-color: var(--color-text-main);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.catalog-brand.is-unavailable,
.catalog-chip.is-unavailable {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.4);
}

.catalog-brand.is-hidden-by-search {
  display: none !important;
}

.catalog-chip--badge {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.catalog-chip__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.catalog-chip--badge[data-hot-sale="1"].is-active {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
  color: #FFFFFF;
}

.catalog-chip--badge[data-premium="1"].is-active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFFFFF;
}

@media (max-width: 1024px) {
  .catalog-brands__desktop-only,
  .catalog-brands__header {
    display: none !important;
  }

  .catalog-brands__mobile-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface);
    color: var(--color-text-main);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--motion-base), background-color var(--motion-base);
  }

  .catalog-brands__mobile-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-left: auto;
    margin-right: 8px;
  }

  .catalog-brands__trigger-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .catalog-brands__mobile-trigger[aria-expanded="true"] .catalog-brands__trigger-arrow {
    transform: rotate(180deg);
  }

  .catalog-brands__mobile-panel {
    display: block;
    margin-top: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface);
    box-shadow: var(--shadow-dropdown);
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: height 0.22s ease, opacity 0.18s ease;
  }

  .catalog-brands__mobile-panel.is-open {
    opacity: 1;
  }

  .catalog-brands__mobile-panel-inner {
    padding: 12px;
  }

  .catalog-brands__mobile-panel[hidden] {
    display: none !important;
    height: 0;
  }

  input.catalog-brands__search[type="search"] {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    font-size: 13px;
    color: var(--color-text-main);
  }

  .catalog-brands__list {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
  }

  .catalog-brands__list .catalog-brand {
    width: 100% !important;
    text-align: left;
    justify-content: flex-start;
    border-radius: var(--radius-sm);
  }
}

.catalog-price,
.catalog-price-slider {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.catalog-price__range {
  position: relative;
  height: 6px;
  --price-min-pct: 0%;
  --price-max-pct: 100%;
  margin: 16px 4px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-pill);
}

.catalog-price__range::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--price-min-pct);
  right: calc(100% - var(--price-max-pct));
  background: var(--color-primary);
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.catalog-price__range input[type="range"] {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
}

.catalog-price__range input[data-price-min] {
  z-index: 3;
}

.catalog-price__range input[data-price-max] {
  z-index: 2;
}

.catalog-price__range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: grab;
  pointer-events: auto;
  margin-top: -7px;
  transition: transform var(--motion-fast), border-color var(--motion-fast);
}

.catalog-price__range input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  border-color: var(--color-primary-hover);
}

.catalog-price__range input[type="range"]::-webkit-slider-runnable-track {
  background: transparent;
  height: 6px;
  cursor: pointer;
}

.catalog-price__range input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: grab;
  pointer-events: auto;
}

.catalog-price__range input[type="range"]::-moz-range-track {
  background: transparent;
  height: 6px;
}

.catalog-reset-all {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background-color var(--motion-base), color var(--motion-base), border-color var(--motion-base);
}

@media (hover: hover) and (pointer: fine) {
  .catalog-reset-all:hover {
    background-color: var(--color-bg-subtle);
    color: var(--color-text-main);
    border-color: var(--color-border-hover);
  }
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.catalog-search {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  min-width: 0;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--motion-base), box-shadow var(--motion-base), background-color var(--motion-base);
}

.catalog-search:focus-within {
  border-color: var(--focus-field-border);
  box-shadow: inset 0 0 0 1px var(--focus-field-border);
  background: #FFFFFF;
}

.catalog-search__icon {
  flex-shrink: 0;
  margin-right: 8px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}

.catalog-search__icon svg {
  display: block;
}

.catalog-search__input[type="search"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  line-height: 1.4;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--color-text-main);
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.catalog-search__input[type="search"]::-webkit-search-decoration,
.catalog-search__input[type="search"]::-webkit-search-cancel-button,
.catalog-search__input[type="search"]::-webkit-search-results-button,
.catalog-search__input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

.catalog-search__input[type="search"]:focus,
.catalog-search__input[type="search"]:focus-visible {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.catalog-search__clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--motion-fast), color var(--motion-fast);
}

.catalog-search__clear[hidden] {
  display: none;
}

.catalog-search__clear:hover {
  background: var(--color-bg-muted);
  color: var(--color-text-main);
}

.catalog-results-meta {
  margin-bottom: 12px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.catalog-results-meta strong {
  color: var(--color-text-main);
  font-weight: 700;
}

.catalog-grid-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  color: var(--color-text-main);
  cursor: pointer;
  flex-shrink: 0;
  margin: 1px 2px;
  outline: none;
  transition: border-color var(--motion-base), background-color var(--motion-base), box-shadow var(--motion-base);
}

@media (max-width: 768px) {
  .catalog-grid-toggle {
    display: inline-flex;
  }
}

.catalog-grid-toggle:hover {
  border-color: var(--color-border-hover);
  background-color: var(--color-bg-subtle);
}

.catalog-grid-toggle:focus-visible,
.catalog-grid-toggle.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-subtle, rgba(0, 208, 108, 0.2));
  outline: none;
}

.catalog-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.catalog-sort__label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.catalog-sort__select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 30px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-bg-surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--color-text-main);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

@media (max-width: 768px) {
  .catalog-sort__label {
    display: none;
  }
}

.catalog-sort--enhanced .catalog-sort__select {
  display: none;
}

.catalog-sort__control {
  position: relative;
}

.catalog-sort__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-surface);
  color: var(--color-text-main);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--motion-base), box-shadow var(--motion-base);
}

.catalog-sort__trigger:hover {
  border-color: var(--color-border-hover);
}

.catalog-sort__trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-sort__caret {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--motion-fast);
}

.catalog-sort__trigger[aria-expanded="true"] .catalog-sort__caret {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.catalog-sort__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 50;
  min-width: 180px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  box-shadow: var(--shadow-dropdown);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalog-sort__menu[hidden] {
  display: none;
}

.catalog-sort__option {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-main);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--motion-fast);
}

.catalog-sort__option:hover:not(.is-current) {
  background-color: var(--color-bg-subtle);
}

.catalog-sort__option.is-current {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-hover);
  font-weight: 700;
}

@media (max-width: 768px) {
  .catalog-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }

  .catalog-toolbar .catalog-search {
    display: none;
  }

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

  .catalog-sort--enhanced .catalog-sort__control {
    position: static;
    width: 100%;
  }

  .catalog-sort__trigger {
    width: 100%;
    justify-content: space-between;
  }

  .catalog-sort--enhanced .catalog-sort__menu {
    left: 0;
    right: 0;
    max-width: none;
  }
}

.product-card__volume-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-text-dark);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.catalog-cards-grid,
.catalog-grid .grid-2,
[data-catalog-cards] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

@media (max-width: 1200px) {
  .catalog-cards-grid,
  .catalog-grid .grid-2,
  [data-catalog-cards] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .catalog-cards-grid,
  .catalog-grid .grid-2,
  .catalog-grid [data-catalog-cards],
  [data-catalog-cards] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .catalog-cards-grid.grid-3,
  .catalog-grid .grid-3,
  .catalog-grid [data-catalog-cards].grid-3,
  [data-catalog-cards].grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .catalog-cards-grid.grid-3 .product-card__body,
  [data-catalog-cards].grid-3 .product-card__body {
    padding: 6px 6px 8px !important;
  }

  .catalog-cards-grid.grid-3 .product-card__title,
  [data-catalog-cards].grid-3 .product-card__title {
    font-size: 11px !important;
    min-height: auto !important;
  }

  .catalog-cards-grid.grid-3 .product-card__price,
  [data-catalog-cards].grid-3 .product-card__price {
    font-size: 12.5px !important;
  }

  .catalog-cards-grid.grid-3 .product-card__volume-badge,
  [data-catalog-cards].grid-3 .product-card__volume-badge {
    font-size: 9px !important;
    padding: 1px 4px !important;
  }
}

.catalog-grid .product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color var(--motion-base), box-shadow var(--motion-base), transform var(--motion-base);
}

@media (hover: hover) and (pointer: fine) {
  .catalog-grid .product-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
  }
}

.catalog-grid .product-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-bg-subtle);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-grid .product-card-carousel__circle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.catalog-grid .product-card-carousel__circle picture {
  display: contents;
}

.catalog-grid .product-card-carousel__circle .product-card-carousel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-base);
}

.catalog-grid .product-card-carousel__circle .product-card-carousel__img.is-visible {
  opacity: 1;
  visibility: visible;
}

.catalog-grid .product-card-carousel__circle--placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-subtle);
  font-size: 12px;
}

.catalog-grid .product-card__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  max-width: calc(100% - 16px);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
}

.catalog-grid .product-card__badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.catalog-grid .product-card__badge--hot {
  background: var(--color-danger);
  color: #FFFFFF;
}

.catalog-grid .product-card__badge--premium {
  background: var(--color-primary);
  color: #FFFFFF;
}

.catalog-grid .product-card__badge--promo {
  background: #FFFFFF;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}

.product-card-carousel__prev,
.product-card-carousel__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text-main);
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--motion-fast), background-color var(--motion-fast);
}

.product-card-carousel__prev::before {
  content: "‹";
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.product-card-carousel__next::before {
  content: "›";
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.product-card-carousel__prev {
  left: 6px;
}

.product-card-carousel__next {
  right: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover .product-card-carousel__prev,
  .product-card:hover .product-card-carousel__next {
    opacity: 1;
  }
}

.product-card-carousel__dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  z-index: 4;
}

.product-card-carousel__dot {
  width: 18px;
  height: 18px;
  padding: 6px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  background-clip: content-box;
  border: 0;
  cursor: pointer;
}

.product-card-carousel__dot.is-active {
  background-color: var(--color-primary);
}

.catalog-grid .product-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.catalog-grid .product-card__meta {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.product-card__seller {
  display: flex;
  align-items: baseline;
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.product-card__seller-label {
  flex: 0 0 auto;
}

.product-card__seller-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.product-card__seller-name--link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(75, 85, 99, 0.3);
  text-underline-offset: 2px;
}

.product-card__seller-name--link:hover {
  color: var(--color-primary-hover);
  text-decoration-color: currentColor;
}

.product-card__seller-verified {
  flex: 0 0 auto;
  color: var(--color-primary);
  font-size: 12px;
}

.catalog-grid .product-card__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-main);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  overflow-wrap: break-word;
  word-break: break-word;
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-bottom: 8px;
}

.product-card__rating-star {
  color: #F5A623;
  font-size: 13px;
}

.product-card__rating-value {
  font-weight: 700;
  color: var(--color-text-main);
}

.product-card__rating-count {
  color: var(--color-text-muted);
}

.catalog-grid .product-card__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalog-grid .product-card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.product-card__price-old {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-subtle);
  text-decoration: line-through;
}

.product-card__price-discount {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-hover);
}

.catalog-grid .product-card__discount-slot {
  min-height: 1.4em;
  display: flex;
  align-items: flex-end;
}

.catalog-grid .product-card__discount-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.25;
}

@media (max-width: 768px) {
  .catalog-grid .product-card {
    border-radius: var(--radius-md);
  }

  .catalog-grid .product-card__body {
    padding: 8px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .catalog-grid .product-card__meta {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
  }

  .catalog-grid .product-card__title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .catalog-grid .product-card__price {
    font-size: 15px;
    font-weight: 800;
  }

  .catalog-grid .product-card__discount-slot {
    min-height: 1.4em;
    margin-top: 2px;
  }

  .catalog-grid .grid-3 .product-card__body {
    padding: 6px;
  }

  .catalog-grid .grid-3 .product-card__title {
    font-size: 11px;
  }

  .catalog-grid .grid-3 .product-card__price {
    font-size: 13px;
  }
}

.catalog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.catalog-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  padding: 24px;
}

.catalog-loading.is-hidden {
  display: none !important;
}

.catalog-loading__spinner {
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: catalog-spin 0.75s linear infinite;
}

.catalog-loading__text {
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.catalog-skeleton {
  background: linear-gradient(90deg, var(--color-bg-subtle) 25%, var(--color-bg-muted) 50%, var(--color-bg-subtle) 75%);
  background-size: 200% 100%;
  animation: catalog-shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
  min-height: 280px;
  border: 1px solid var(--color-border);
}

@keyframes catalog-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes catalog-spin {
  to {
    transform: rotate(360deg);
  }
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 0 12px;
  user-select: none;
}

.catalog-pagination__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.catalog-pagination__btn,
.catalog-pagination__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  color: var(--color-text-main);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--motion-base), color var(--motion-base), border-color var(--motion-base), box-shadow var(--motion-base);
}

.catalog-pagination__btn:hover:not(:disabled),
.catalog-pagination__num:hover:not(.is-active) {
  background: var(--color-bg-subtle);
  border-color: var(--color-border-hover);
}

.catalog-pagination__num.is-active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.catalog-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.catalog-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 38px;
  color: var(--color-text-muted);
  font-size: 14px;
}

@media (max-width: 768px) {
  .catalog-pagination__btn,
  .catalog-pagination__num {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
    border-radius: var(--radius-sm);
  }
}

.catalog-filters-fab {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: fixed;
  bottom: calc(var(--nav-total-height, calc(var(--nav-height, 60px) + var(--safe-bottom))) + 16px);
  right: max(16px, var(--safe-right));
  z-index: 950;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-text-main);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-dropdown);
  transition: transform var(--motion-fast), background-color var(--motion-base);
  -webkit-tap-highlight-color: transparent;
}

.catalog-filters-fab:active {
  transform: scale(0.92);
}

.catalog-filters-fab__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-filters-fab__icon svg {
  display: block;
}

.catalog-filters-fab__label {
  display: none;
}

@media (max-width: 1024px) {
  .catalog-filters-fab {
    display: inline-flex;
  }
}

.catalog-filters-overlay {
  position: fixed;
  inset: 0;
  z-index: 1005;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--motion-slow), visibility var(--motion-slow);
}

.catalog-filters-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.catalog-filters-overlay[hidden] {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

.catalog-filters-drawer {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 85dvh;
  background: var(--color-bg-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-modal);
  transform: translateY(100%);
  transition: transform var(--motion-slow);
  will-change: transform;
}

.catalog-filters-overlay.is-open .catalog-filters-drawer {
  transform: translateY(0);
}

.catalog-filters-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.catalog-filters-drawer__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-main);
}

.catalog-filters-drawer__close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  color: var(--color-text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.catalog-filters-drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
}

.catalog-filters-drawer__body .catalog-filters__rest {
  display: block !important;
}

.catalog-filters-drawer__body .catalog-reset-all {
  display: none !important;
}

.catalog-filters-drawer__footer {
  flex-shrink: 0;
  padding: 14px 20px;
  padding-bottom: calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
}

@media (max-width: 768px) {
  .catalog-filters-drawer__footer {
    padding-bottom: calc(14px + var(--nav-height, 60px) + var(--safe-bottom));
  }
}

.catalog-filters-drawer__reset {
  flex: 1;
  margin-top: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  color: var(--color-text-main);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.catalog-filters-drawer__apply {
  display: none;
}

.reviews-block {
  margin-top: 24px;
  padding: 24px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.reviews-block__title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.reviews-summary {
  margin-bottom: 18px;
}

.reviews-summary__score {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reviews-summary__value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text-main);
}

.reviews-summary__note {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.reviews-stars {
  display: inline-flex;
  gap: 2px;
  line-height: 1;
}

.reviews-star {
  color: var(--color-border-hover);
  font-size: 16px;
}

.reviews-star.is-filled {
  color: #F5A623;
}

.reviews-flash {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  margin: 12px 0;
}

.reviews-flash--ok {
  background-color: var(--color-primary-subtle);
  color: var(--color-success-text);
  border: 1px solid var(--color-primary-border);
}

.reviews-flash--error {
  background-color: var(--color-danger-subtle);
  color: var(--color-danger-text);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.reviews-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reviews-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--color-bg-surface);
}

.reviews-item__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reviews-item__author {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--color-text-main);
}

.reviews-item__rating-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.reviews-item__date {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-muted);
}

.reviews-item__text {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  word-break: break-word;
}

.reviews-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reviews-more:hover {
  color: var(--color-primary-hover);
}

.reviews-already {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--color-text-muted);
}

.reviews-form {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reviews-form__rating {
  border: none;
  margin: 0;
  padding: 0;
}

.reviews-form__legend {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 8px;
  padding: 0;
}

.reviews-form__stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.reviews-form__star-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.reviews-form__star {
  font-size: 26px;
  line-height: 1;
  color: var(--color-border-hover);
  cursor: pointer;
  padding: 2px;
  transition: color 0.12s ease, transform 0.12s ease;
}

.reviews-form__star:hover,
.reviews-form__star:hover ~ .reviews-form__star,
.reviews-form__star-input:checked ~ .reviews-form__star {
  color: #F5A623;
}

.reviews-form__text-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reviews-form__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.reviews-form__textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
  min-height: 90px;
  background: var(--color-bg-surface);
  color: var(--color-text-main);
}

.reviews-form__textarea:focus {
  outline: none;
  border-color: var(--focus-field-border);
  box-shadow: inset 0 0 0 1px var(--focus-field-border);
}

.reviews-form__submit {
  align-self: flex-start;
}

@media (max-width: 768px) {
  .reviews-block {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
  }

  .reviews-item__date {
    margin-left: 0;
    width: 100%;
  }

  .reviews-form__submit {
    align-self: stretch;
    width: 100%;
  }
}
