/* Catalog / category listing — match brand cards & kill Bootstrap blue */

/* Hide leftover OC top bar if present */
#top { display: none !important; }

.sb-bc {
  padding: 18px 0 10px;
  font-size: 13px;
  color: #8f867e;
}
.sb-bc a { color: #8f867e; text-decoration: none; }
.sb-bc a:hover { color: #3B2438; }
.sb-bc span { margin: 0 8px; color: #cfc5bc; }

.sb-catalog {
  background: #f7f3ef;
  padding-bottom: 48px;
  min-height: 50vh;
}

.sb-catalog__layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.sb-catalog__layout:not(:has(.sb-catalog__aside)) {
  grid-template-columns: 1fr;
}

.sb-catalog__aside {
  position: static;
  top: auto;
}

.sb-catalog__aside .col-sm-3,
.sb-catalog__aside #column-left,
.sb-catalog__aside #column-right,
.sb-catalog__aside .sb-column {
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
  position: static !important;
}

.sb-catalog__head {
  margin: 0 0 20px;
}
.sb-catalog__head h1 {
  margin: 0 0 8px;
  font-family: var(--sb-serif);
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 600;
  color: #3B2438;
  line-height: 1.15;
}
.sb-catalog__desc {
  max-width: 640px;
  font-size: 14px;
  color: #7A6B7A;
  line-height: 1.5;
}

/* Hide broken/placeholder category thumbs if any slip through */
.sb-catalog .img-thumbnail,
#product-category .img-thumbnail {
  display: none !important;
}

.sb-catalog__subs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.sb-catalog__sub {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #E5DCEB;
  font-size: 13px;
  font-weight: 500;
  color: #3B2438;
  text-decoration: none;
}
.sb-catalog__sub:hover {
  border-color: #3B2438;
  color: #3B2438;
}

/* Toolbar */
.sb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #E5DCEB;
  border-radius: 14px;
}
.sb-toolbar__compare {
  font-size: 13px;
  font-weight: 600;
  color: #3B2438;
  text-decoration: none;
}
.sb-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.sb-toolbar__filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #7A6B7A;
}
.sb-toolbar__filters select,
.sb-toolbar select,
.sb-toolbar .form-control {
  height: 38px;
  min-width: 140px;
  border: 1px solid #E5DCEB;
  border-radius: 10px;
  background: #faf6f2;
  padding: 0 12px;
  font-size: 13px;
  color: #3B2438;
  box-shadow: none !important;
  outline: none;
  appearance: auto;
}
.sb-toolbar__filters select:focus {
  border-color: #3B2438;
}

/* Product grid */
.sb-product-grid,
.sb-product-grid--4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
  float: none !important;
}
.sb-product-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Specials page — full container width, always 4 cols */
.sb-catalog--special .sb-catalog__wrap,
.sb-catalog--special .sb-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}
.sb-catalog--special .sb-catalog__main,
.sb-catalog--special #content {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  padding: 0 !important;
}
.sb-catalog--special .sb-product-grid,
.sb-catalog--special .sb-product-grid--4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
}
.sb-catalog--special .sb-card {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
}

/* Cards — reference style */
.sb-catalog .sb-card,
.sb-product-grid .sb-card {
  background: #FFFEFC;
  border: 1px solid #E5DCEB;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  transition: box-shadow .2s, transform .2s;
}
.sb-catalog .sb-card:hover {
  box-shadow: 0 10px 28px rgba(59,36,56,.08);
  transform: translateY(-2px);
}
.sb-catalog .sb-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 18px;
  background: #F5F0F8;
  text-decoration: none;
}
.sb-catalog .sb-card__media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.sb-catalog .sb-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff;
  background: #3B2438;
}
.sb-catalog .sb-badge--sale { background: #c24b3a; }
.sb-catalog .sb-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.sb-catalog .sb-card__name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  min-height: 2.5em;
}
.sb-catalog .sb-card__name a {
  color: #3B2438;
  text-decoration: none;
}
.sb-catalog .sb-card__name a:hover { color: #3B2438; }
.sb-catalog .sb-stars {
  color: #3B2438;
  font-size: 12px;
  letter-spacing: 1px;
}
.sb-catalog .sb-card__bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}
.sb-catalog .sb-price {
  font-size: 17px;
  font-weight: 700;
  color: #3B2438;
  line-height: 1.2;
}
.sb-catalog .sb-price .price-new {
  display: block;
  color: #c24b3a;
}
.sb-catalog .sb-price .price-old {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #7A6B7A;
  text-decoration: line-through;
}
.sb-catalog .sb-cart-round {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #3B2438;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sb-catalog .sb-cart-round:hover { background: #2A1929; color: #fff; }
.sb-catalog .sb-cart-round.is-in-cart {
  width: auto !important;
  height: 40px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  gap: 6px;
  background: #f5ebe3 !important;
  color: #3B2438 !important;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.sb-catalog .sb-cart-round.is-in-cart:hover { background: #efe2d7 !important; color: #3B2438 !important; }

.sb-catalog__pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding: 16px 18px;
  background: #FFFEFC;
  border: 1px solid #E5DCEB;
  border-radius: 14px;
  font-size: 13px;
  color: #7A6B7A;
}
.sb-pagination,
.sb-catalog__pager .pagination,
.sb-catalog__pager ul.pagination {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none !important;
  float: none !important;
}
.sb-catalog__pager .pagination > li,
.sb-pagination .pagination > li {
  display: inline-flex !important;
  float: none !important;
  margin: 0 !important;
}
.sb-catalog__pager .pagination > li > a,
.sb-catalog__pager .pagination > li > span,
.sb-pagination .pagination > li > a,
.sb-pagination .pagination > li > span {
  border: 1px solid #E5DCEB !important;
  border-radius: 10px !important;
  margin: 0 !important;
  color: #3B2438 !important;
  background: #fff !important;
  padding: 9px 13px !important;
  min-width: 40px;
  text-align: center;
  line-height: 1.2;
  text-decoration: none !important;
  box-shadow: none !important;
}
.sb-catalog__pager .pagination > li > a:hover,
.sb-pagination .pagination > li > a:hover {
  border-color: #3B2438 !important;
  color: #3B2438 !important;
  background: #fff !important;
}
.sb-catalog__pager .pagination > .active > span,
.sb-catalog__pager .pagination > .active > a,
.sb-pagination .pagination > .active > span,
.sb-pagination .pagination > .active > a {
  background: #3B2438 !important;
  border-color: #3B2438 !important;
  color: #fff !important;
}
.sb-catalog__pager .pagination > .disabled > span,
.sb-catalog__pager .pagination > .disabled > a {
  opacity: 0.45;
  pointer-events: none;
}
.sb-catalog__results {
  margin-left: auto;
}

/* Hide leftover empty recommend boxes */
.sb-catalog__aside .box:empty,
#column-left > div:empty,
#column-right > div:empty {
  display: none !important;
}

.sb-side-products {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sb-side-product {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none !important;
  color: inherit !important;
}
.sb-side-product img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3ece6;
}
.sb-side-product strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #3B2438;
}
.sb-side-product em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  color: #3B2438;
}
.sb-catalog__empty {
  padding: 48px 24px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #E5DCEB;
}

/* Sidebar */
.sb-sidebox {
  background: #fff;
  border: 1px solid #E5DCEB;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.sb-sidebox__title {
  margin: 0 0 12px;
  font-family: var(--sb-serif);
  font-size: 22px;
  font-weight: 600;
  color: #3B2438;
}
.sb-side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-side-nav__item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #3B2438;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.sb-side-nav__item:hover {
  background: #f8eee9;
  color: #3B2438;
}
.sb-side-nav__item.is-active {
  background: #3B2438 !important;
  color: #fff !important;
}
.sb-side-nav__children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 8px 10px;
  padding-left: 10px;
  border-left: 2px solid #f0e6e0;
}
.sb-side-nav__children a {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #7A6B7A;
  text-decoration: none;
}
.sb-side-nav__children a:hover,
.sb-side-nav__children a.is-active {
  color: #3B2438;
  background: #f8eee9;
}

/* Override Bootstrap / OC default category list-group (blue active) */
#column-left .list-group,
#column-right .list-group,
.sb-catalog__aside .list-group {
  margin: 0 0 16px;
  border: 1px solid #E5DCEB;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  padding: 8px;
}
#column-left .list-group-item,
#column-right .list-group-item,
.sb-catalog__aside .list-group-item {
  border: 0 !important;
  border-radius: 10px !important;
  margin: 2px 0 !important;
  padding: 10px 12px !important;
  color: #3B2438 !important;
  background: transparent !important;
  font-size: 14px;
  font-weight: 500;
}
#column-left .list-group-item:hover,
#column-right .list-group-item:hover,
.sb-catalog__aside .list-group-item:hover {
  background: #f8eee9 !important;
  color: #3B2438 !important;
}
#column-left .list-group-item.active,
#column-right .list-group-item.active,
.sb-catalog__aside .list-group-item.active,
.list-group-item.active {
  background: #3B2438 !important;
  border-color: #3B2438 !important;
  color: #fff !important;
  z-index: 1;
}

/* Banner modules in sidebar */
.sb-catalog__aside img,
#column-left img {
  max-width: 100%;
  border-radius: 12px;
}

/* Extra: hide leftover banner modules in sidebar */
#column-left .swiper-viewport,
#column-right .swiper-viewport,
.sb-catalog__aside .swiper-viewport,
#column-left > .banner,
#column-right > .banner {
  display: none !important;
}

@media (max-width: 991px) {
  .sb-catalog__layout {
    grid-template-columns: 1fr !important;
  }
  /* Боковой каталог брендов — только десктоп; на мобиле есть бургер */
  .sb-catalog__aside,
  .sb-sidebox,
  #column-left .sb-sidebox,
  #column-right .sb-sidebox,
  .sb-catalog__aside .sb-side-nav,
  #column-left > .list-group,
  #column-right > .list-group {
    display: none !important;
  }
  .sb-product-grid--3,
  .sb-product-grid--4,
  .sb-catalog--special .sb-product-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px) {
  .sb-product-grid--3,
  .sb-product-grid--4,
  .sb-product-grid,
  .sb-catalog--special .sb-product-grid--4 {
    grid-template-columns: 1fr !important;
  }
  .sb-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
/* ========== SEARCH PAGE ========== */
/* LiveStore/Bootstrap часто сжимает .container — выравниваем под шапку 1240px */
#product-search.sb-search-page {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}
.sb-search-page__wrap.sb-wrap,
#product-search .sb-search-page__wrap {
  width: 100% !important;
  max-width: 1240px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
  float: none !important;
}
body:has(#product-search) #sb-main > .container {
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
  float: none !important;
}
body:has(#product-search) #sb-main > .container > .row,
body:has(#product-search) #product-search .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: block !important;
  width: 100% !important;
}
body:has(#product-search) #sb-main [class*="col-sm-"],
body:has(#product-search) #sb-main [class*="col-md-"],
#product-search #content,
#product-search .sb-catalog__main {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
#product-search .sb-catalog__layout {
  grid-template-columns: 1fr !important;
  width: 100% !important;
}
#product-search .sb-catalog__aside {
  display: none !important;
}
.sb-search-page .sb-search-panel {
  background: #FFFEFC;
  border: 1px solid #E5DCEB;
  border-radius: 16px;
  padding: 20px 22px;
  margin: 0 0 28px;
  box-shadow: 0 8px 28px rgba(59, 36, 56, 0.06);
  width: 100%;
  box-sizing: border-box;
}
.sb-search-panel__row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.sb-search-panel__label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #7A6B7A;
}
.sb-search-panel__input,
.sb-search-panel__select {
  width: 100%;
  height: 48px;
  border: 1px solid #E5DCEB;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: #3B2438;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sb-search-panel__input:focus,
.sb-search-panel__select:focus {
  border-color: #3B2438;
  box-shadow: 0 0 0 3px rgba(216, 203, 228, 0.55);
}
.sb-search-panel__btn {
  height: 48px;
  min-width: 120px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #3B2438;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.sb-search-panel__btn:hover {
  background: #2A1929;
  transform: translateY(-1px);
}
.sb-search-panel__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #E5DCEB;
}
.sb-search-panel__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #3B2438;
  cursor: pointer;
}
.sb-search-panel__check input {
  width: 16px;
  height: 16px;
  accent-color: #3B2438;
}
.sb-search-page__results-title {
  margin: 0 0 16px;
  font-family: var(--sb-serif, Georgia, serif);
  font-size: 28px;
  font-weight: 600;
  color: #3B2438;
}
@media (max-width: 900px) {
  .sb-search-panel__row {
    grid-template-columns: 1fr;
  }
  .sb-search-panel__btn {
    width: 100%;
  }
}
