/* Catalog page */
.om-catalog {
  padding: 28px 0 48px;
}
.om-catalog__layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

/* Sidebar filters */
.om-filters {
  position: sticky;
  top: 80px;
}
.om-filter {
  background: #fff;
  border: 1px solid var(--om-border);
  border-radius: var(--om-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.om-filter__title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}
.om-filter__list { display: flex; flex-direction: column; gap: 4px; }
.om-filter__cat-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding-left: calc(10px + var(--cat-depth, 0) * 14px);
}
.om-filter__cat-toggle,
.om-filter__cat-toggle-spacer {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 6px;
}
.om-filter__cat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--om-border);
  border-radius: 6px;
  background: #fff;
  color: var(--om-muted);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.om-filter__cat-toggle:hover {
  border-color: var(--om-blue);
  color: var(--om-blue);
  background: var(--om-blue-light);
}
.om-filter__cat-toggle-icon {
  display: block;
  width: 12px;
  height: 12px;
  position: relative;
}
.om-filter__cat-toggle-icon::before,
.om-filter__cat-toggle-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: transform 0.2s, opacity 0.2s;
}
.om-filter__cat-toggle-icon::before {
  width: 10px;
  height: 2px;
}
.om-filter__cat-toggle-icon::after {
  width: 2px;
  height: 10px;
}
.om-filter__cat.is-open > .om-filter__cat-row .om-filter__cat-toggle-icon::after {
  transform: translate(-50%, -50%) scaleY(0);
  opacity: 0;
}
.om-filter__cat-children {
  display: none;
  flex-direction: column;
  gap: 4px;
}
.om-filter__cat.is-open > .om-filter__cat-children {
  display: flex;
}
.om-filter__cat-row .om-filter__link {
  flex: 1;
  min-width: 0;
}
.om-filter__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--om-text);
}
.om-filter__link:hover { background: var(--om-surface); }
.om-filter__link.is-active {
  background: var(--om-blue-light);
  color: var(--om-blue);
  font-weight: 600;
}
.om-filter__count { color: var(--om-muted); font-size: 12px; }

.om-filter__range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.om-filter__input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--om-border);
  border-radius: 8px;
  font-size: 13px;
}
.om-filter__slider {
  width: 100%;
  accent-color: var(--om-blue);
}

.om-filter__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
}
.om-filter__check input { accent-color: var(--om-blue); }

.om-filter__select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--om-border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.om-filter__search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--om-border);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
}
.om-filter__more {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--om-blue);
}

.om-filters__banners { margin-top: 16px; }

/* Toolbar */
.om-catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.om-catalog-toolbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.om-catalog-toolbar__count {
  font-size: 14px;
  color: var(--om-muted);
}
.om-catalog-toolbar__count strong { color: var(--om-text); }
.om-view-toggle {
  display: flex;
  border: 1px solid var(--om-border);
  border-radius: 8px;
  overflow: hidden;
}
.om-view-toggle__btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #fff;
  color: var(--om-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.om-view-toggle__btn.is-active {
  background: var(--om-blue-light);
  color: var(--om-blue);
}
.om-catalog-toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.om-catalog-toolbar__field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--om-muted);
}
.om-catalog-toolbar__select {
  padding: 8px 12px;
  border: 1px solid var(--om-border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

/* Catalog grid */
.om-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
  background: var(--om-surface);
  padding: 28px;
  border-radius: var(--om-radius-lg);
}
.om-catalog-grid:not(.om-catalog-grid--list) > .om-catalog-card,
.om-catalog-grid:not(.om-catalog-grid--list) > .om-ad-wrap--grid {
  min-width: 0;
  align-self: start;
}
.om-catalog-grid .om-ad-wrap--card .om-ad {
  width: 100%;
}
.om-catalog-grid .om-catalog-card {
  position: relative;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  min-height: 100%;
  padding: 18px;
}
.om-catalog-grid .om-catalog-card__thumb {
  display: block;
}
.om-catalog-grid .om-product__img {
  height: 190px;
  margin-bottom: 14px;
}
.om-catalog-grid .om-product__name {
  font-size: 15px;
  min-height: 2.8em;
  margin-bottom: 10px;
}
.om-catalog-grid .om-product__price {
  font-size: 18px;
  margin-bottom: 4px;
}
.om-catalog-grid .om-product__moq {
  font-size: 13px;
  margin-bottom: 12px;
}
.om-catalog-grid .om-catalog-card__meta {
  font-size: 13px;
  margin-bottom: 6px;
}
.om-catalog-grid .om-catalog-card__city {
  font-size: 13px;
  margin-bottom: 14px;
}
.om-catalog-grid .om-product__cart {
  width: 40px;
  height: 40px;
}
.om-catalog-card {
  position: relative;
}
.om-catalog-card__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--om-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--om-shadow-sm);
}
.om-catalog-card__fav:hover { color: #ef4444; }
.om-catalog-card__fav.is-active {
  color: #dc2626;
}
.om-catalog-card__fav.is-active svg {
  fill: #dc2626;
  stroke: #dc2626;
}
.om-catalog-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.om-catalog-card__brand { color: var(--om-muted); }
.om-catalog-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #f59e0b;
  font-weight: 600;
}
.om-catalog-card__city {
  font-size: 12px;
  color: var(--om-muted);
  margin-bottom: 10px;
}
.om-product__cart--outline {
  background: transparent;
  border: 1px solid var(--om-blue);
  color: var(--om-blue);
}
.om-product__cart--outline:hover {
  background: var(--om-blue-light);
}
.om-product__cart--outline.is-in-cart {
  background: var(--om-green);
  border-color: var(--om-green);
  color: #fff;
}
.om-product__cart--outline.is-in-cart:hover {
  background: #15803d;
  border-color: #15803d;
}
.om-badge--sale {
  background: #fef2f2;
  color: #dc2626;
}

/* Catalog list view */
.om-catalog-grid--list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.om-catalog-grid--list > .om-catalog-card,
.om-catalog-grid--list > .om-ad-wrap--grid {
  align-self: stretch;
  width: 100%;
}
.om-catalog-grid--list .om-catalog-card--list {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 0 24px;
  align-items: center;
  padding: 16px 20px 16px 16px;
  min-height: auto;
  width: 100%;
}
.om-catalog-grid--list .om-catalog-card__thumb {
  display: block;
  grid-row: 1;
}
.om-catalog-grid--list .om-product__img {
  width: 148px;
  height: 112px;
  margin-bottom: 0;
  border-radius: 10px;
}
.om-catalog-grid--list .om-catalog-card__info {
  min-width: 0;
  padding-right: 16px;
}
.om-catalog-grid--list .om-product__name {
  font-size: 16px;
  min-height: 0;
  margin-bottom: 8px;
  -webkit-line-clamp: 2;
}
.om-catalog-grid--list .om-catalog-card__meta--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-bottom: 6px;
  font-size: 13px;
}
.om-catalog-grid--list .om-catalog-card__meta--inline .om-catalog-card__brand,
.om-catalog-grid--list .om-catalog-card__meta--inline .om-catalog-card__city {
  margin-bottom: 0;
}
.om-catalog-grid--list .om-catalog-card__meta--inline .om-catalog-card__city::before {
  content: "·";
  margin-right: 16px;
  color: #cbd5e1;
}
.om-catalog-grid--list .om-product__moq--list {
  font-size: 13px;
  color: var(--om-muted);
  margin-bottom: 0;
}
.om-catalog-grid--list .om-catalog-card__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 160px;
  padding-left: 20px;
  border-left: 1px solid var(--om-border);
}
.om-catalog-grid--list .om-product__price--list {
  font-size: 20px;
  text-align: right;
  white-space: nowrap;
  margin-bottom: 0;
}
.om-catalog-grid--list .om-product__footer--list {
  margin-top: 0;
  width: 100%;
  justify-content: flex-end;
}
.om-catalog-grid--list .om-catalog-card__fav {
  top: 14px;
  right: 14px;
}

/* Pagination */
.om-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.om-pagination__btn,
.om-pagination__page {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--om-border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--om-text);
}
.om-pagination__page.is-active {
  background: var(--om-blue);
  border-color: var(--om-blue);
  color: #fff;
  font-weight: 600;
}
.om-pagination__dots { color: var(--om-muted); padding: 0 4px; }
.om-pagination__perpage {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--om-muted);
}

@media (max-width: 1200px) {
  .om-catalog-grid:not(.om-catalog-grid--list) { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .om-catalog__layout { grid-template-columns: 1fr; }
  .om-filters { position: static; }
  .om-catalog-grid:not(.om-catalog-grid--list) { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .om-catalog-grid:not(.om-catalog-grid--list) { grid-template-columns: repeat(2, 1fr); }
  .om-catalog-grid--list .om-catalog-card--list {
    grid-template-columns: 96px 1fr;
    gap: 12px 16px;
    padding: 14px;
  }
  .om-catalog-grid--list .om-product__img {
    width: 96px;
    height: 80px;
  }
  .om-catalog-grid--list .om-catalog-card__aside {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-left: none;
    border-top: 1px solid var(--om-border);
    padding: 12px 0 0;
    min-width: 0;
    width: 100%;
  }
  .om-catalog-grid--list .om-product__price--list {
    font-size: 17px;
  }
  .om-pagination__perpage { margin-left: 0; width: 100%; justify-content: center; }
}
