/* ============================================================
   CATALOGUE UI — page background
   ============================================================ */

.main {
  background-color: #ffffff;
  background-image: url("/favicon-120x120.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* ============================================================
   RG — BOTTOM ESTIMATE BAR (catalogue only)
   Appears only after first item added (JS toggles [hidden] and body class)
   ============================================================ */

.rg-bottom-estimate {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;

  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.rg-bottom-estimate[hidden] {
  display: none !important;
}

.rg-bottom-estimate__inner {
  max-width: 980px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 12px;

  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);

  /* “как верхняя”: стекло + blur */
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.78) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.rg-bottom-estimate__left {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;

  font-size: 14px;
  line-height: 1.2;
  color: #0b0f1a;
}

.rg-bottom-estimate__label {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.rg-bottom-estimate__count {
  font-weight: 900;
}

.rg-bottom-estimate__unit {
  color: rgba(11, 15, 26, 0.55);
  font-weight: 800;
}

.rg-bottom-estimate__btn {
  height: 44px;
  padding: 0 14px;

  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);

  background: rgba(236, 72, 47, 0.95);
  color: #fff;

  font-weight: 900;
  font-size: 14px;
  line-height: 44px;

  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  white-space: nowrap;
  cursor: pointer;

  transition:
    transform 0.16s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.rg-bottom-estimate__btn:hover {
  background: rgba(236, 72, 47, 1);
  box-shadow: 0 14px 30px rgba(236, 72, 47, 0.18);
  transform: translateY(-1px);
}

.rg-bottom-estimate__btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(236, 72, 47, 0.14);
}

/* Чтобы плашка не перекрывала контент — включай классом на body в момент показа */
body.rg-bottom-estimate-open {
  padding-bottom: 96px;
}

@media (min-width: 1025px) {
  body.rg-bottom-estimate-open {
    padding-bottom: 92px;
  }
}

/* ============================================================
   BOTTOM BAR — appears when items added (markup id="rgBottombar")
   ============================================================ */

.rg-bottombar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9999;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.78) 100%
  );
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

  padding: 10px 10px;
}

.rg-bottombar.is-hidden {
  display: none;
}

.rg-bottombar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rg-bottombar__left {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #0b0f1a;

  white-space: nowrap;
}

.rg-bottombar__count {
  font-weight: 900;
}

.rg-bottombar__btn {
  height: 44px;
  padding: 0 14px;

  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);

  background: rgba(236, 72, 47, 0.95);
  color: #fff;

  font-weight: 900;
  font-size: 14px;
  line-height: 44px;

  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  white-space: nowrap;
  cursor: pointer;

  transition:
    transform 0.16s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.rg-bottombar__btn:hover {
  background: rgba(236, 72, 47, 1);
  box-shadow: 0 14px 30px rgba(236, 72, 47, 0.18);
  transform: translateY(-1px);
}

.rg-bottombar__btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(236, 72, 47, 0.14);
}

/* Чтобы бар не перекрывал контент на мобильном */
@media (max-width: 900px) {
  body {
    padding-bottom: 96px;
  }
}

.main-column {
  background: #fffffff9;
  padding-bottom: 330px;
}

.catalogue-filter-column {
  top: 36px;
}
.catalogue-filter-holder {
  border-radius: 20px;
  margin-bottom: 10px;
  background: none;
}

.page-footer {
  border-radius: 24px 24px 0 0;
}

@media (max-width: 1024px) {
  .catalogue-filter-categories {
    display: none;
  }
}

/* hide empty categories block */
.catalogue-filter-categories:not(:has(.catalogue__categories-item)) {
  display: none;
}

tr.catalogue-list-item.ajax_buy:hover img,
.catalogue-list-item.ajax_buy:hover img {
  transform: scale(0.9);
}

.check-icon,
.checkbox {
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.16);
}

.check-label span {
  color: rgba(11, 15, 26, 0.55);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
  padding-right: 10px;
}

.catalogue-filter {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.3) 100%
  );
}

.gray-butn {
  width: 100%;
  margin-top: 10px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  cursor: pointer;
  color: #a9a9a9;
}

.filter-section .section-list .range-inputs .text-input.price-range {
  flex: 1;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  text-align: center;
  color: rgba(15, 23, 42, 0.82);
  font-variant-numeric: tabular-nums;
}

.ui-slider-range {
  height: 6px;
  background-color: #ffb3b3;
}

/* ============================================================
   CATALOGUE UI — title
   ============================================================ */

.catalogue-title {
  margin-bottom: 0em;
}

.catalogue-title h1 {
  display: block;
  margin-block-start: 0.67em;
  margin-block-end: 0.67em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #0b0f1a;
}

.product-preview .name {
  padding-left: 5px;
  padding-right: 5px;
}

.catalog-filter {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.78) 100%
  );
}

.breadcrumbs {
  padding-top: 25px;
}

.product-preview__old-price {
  font-size: 12px;
  font-weight: 400;
}

.product-preview__main-price {
  font-size: 15px;
  font-weight: 900;
}

.dark-red-butn {
  border: 1px solid #adadad;
  background: #adadad;
  border-radius: 15px;
}

.dark-red-butn:hover {
  color: #adadad;
  border: 1px solid #adadad;
  background: white;
}

.product-preview .price {
  margin-top: 8px;
  margin-bottom: 8px;
  display: block;
  margin-left: 5px;
  margin-right: 5px;
  padding: 0;
}

/* ============================================================
   CATALOGUE UI — grid
   ============================================================ */

@media (max-width: 768px) {
  .catalogue-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    grid-auto-flow: row dense !important;
  }

  .catalogue-list .catalogue-list-item.ajax_buy.wide-cart,
  .catalogue-list .catalogue-list-item.ajax_buy.buy-wide-cart,
  .catalogue-list .catalogue-list-item.ajax_buy.wide-left,
  .catalogue-list .catalogue-list-item.ajax_buy.wide-right {
    grid-column: 1 / -1 !important;
  }
}

/* ============================================================
   CATALOGUE UI — product preview (inside card)
   ============================================================ */

.product-preview {
}

.product-preview .image {
  background-color: white;
  margin-top: 10px;
}

.product-preview .name {
  margin: 0;
  font-size: 15px;
  line-height: 1.32;
  letter-spacing: -0.012em;
  font-weight: 700;
  color: #0f172a;
  min-height: 40px;
}

.products__premium {
  top: 10px;
}

/* ============================================================
   CATALOGUE UI — card + reveal
   Боевой: .catalogue-list-item.ajax_buy
   ============================================================ */

/* базовая карточка (работает и для tr>td, и для div/li) */
tr.catalogue-list-item.ajax_buy > td,
.catalogue-list-item.ajax_buy > td,
.catalogue-list-item.ajax_buy:not(tr) {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.3) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow:
    0 18px 90px rgb(181 181 181 / 23%),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  overflow: hidden;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  transition:
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    transform 0.16s ease;
}

tr.catalogue-list-item.ajax_buy:hover > td,
.catalogue-list-item.ajax_buy:hover > td,
.catalogue-list-item.ajax_buy:not(tr):hover {
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  border-color: rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}

tr.catalogue-list-item.ajax_buy:active > td,
.catalogue-list-item.ajax_buy:active > td,
.catalogue-list-item.ajax_buy:not(tr):active {
  transform: translateY(0);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
}

/* reveal */
.catalogue-list-item.ajax_buy.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rgCardIn 0.55s ease forwards;
}

@keyframes rgCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* картинки внутри карточки */
tr.catalogue-list-item.ajax_buy img,
.catalogue-list-item.ajax_buy img {
  transform: scale(1);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

tr.catalogue-list-item.ajax_buy:hover img,
.catalogue-list-item.ajax_buy:hover img {
  transform: scale(1.035);
}

/* ============================================================
   CATALOGUE UI — wide-cart (same as card card--featured reveal)
   Правка: на боевом класс buy-wide-cart (а не wide-cart)
   ============================================================ */

/* основной боевой селектор + запасной wide-cart */
/* основной боевой селектор + запасной wide-cart */
.catalogue-list-item.ajax_buy.buy-wide-cart,
.wide-cart {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  transition:
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 400px;

  /* перебиваем базовую glass-карточку */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* wide — image wrapper as layout root */

/* wide: keep card height, shrink main image to fit thumbs below */
.catalogue-list-item.ajax_buy.wide-cart .product-preview {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.catalogue-list-item.ajax_buy.wide-cart .product-preview .image {
  position: relative;
  height: 350px; /* основная картинка меньше, чтобы влезли превью снизу */
  box-sizing: border-box;
}

.catalogue-list-item.ajax_buy.wide-cart .product-preview .image > span {
  display: block;
  width: 100%;
  height: 100%;
}

.catalogue-list-item.ajax_buy.wide-cart .product-preview .image > span img {
  width: 90%;
  height: 90%;
  object-fit: cover;
  display: inline;
}

.catalogue-list-item.ajax_buy.buy-wide-cart:hover,
.wide-cart:hover {
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  border-color: rgba(15, 23, 42, 0.16);
}

.catalogue-list-item.ajax_buy.buy-wide-cart.reveal,
.wide-cart.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rgWideIn 0.55s ease forwards;
}

@keyframes rgWideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* wide-cart override (wins over .catalogue-list-item.ajax_buy:not(tr)) */
.catalogue-list-item.ajax_buy.wide-cart:not(tr) {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  transition:
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 400px;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.catalogue-list-item.ajax_buy.wide-cart:not(tr):hover {
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  border-color: rgba(15, 23, 42, 0.16);
}

.catalogue-list-item.ajax_buy.wide-cart.reveal:not(tr) {
  opacity: 0;
  transform: translateY(10px);
  animation: rgWideIn 0.55s ease forwards;
}

/* ============================================================
   CATALOGUE UI — wide extra photos (overlay under main image)
   ============================================================ */

.catalogue-list-item.ajax_buy.wide-cart .wide-extra-photos {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  grid-auto-rows: 52px;

  margin: 10px 12px 12px;

  pointer-events: auto;
  z-index: 1;
}

.catalogue-list-item.ajax_buy.wide-cart .wide-extra-photos__item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  position: relative !important; /* перебиваем .product-preview .image a { position:absolute } */
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;

  width: 100%;
  height: 52px;

  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
}

.catalogue-list-item.ajax_buy.wide-cart .wide-extra-photos__item img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: static !important;
}

/* ============================================================
   CATALOGUE UI — wide-cart layout (wide-left / wide-right)
   ============================================================ */

/* wide слева: колонки 1–2 */
.catalogue-list .catalogue-list-item.ajax_buy.wide-left {
  grid-column: 1 / span 2;
}

/* wide справа: колонки 3–4 */
.catalogue-list .catalogue-list-item.ajax_buy.wide-right {
  grid-column: 3 / span 2;
}

/* fallback: если wide без side-класса */
.catalogue-list .catalogue-list-item.ajax_buy.buy-wide-cart,
.catalogue-list .catalogue-list-item.ajax_buy.wide-cart {
  grid-column: span 2;
}

/* на мобиле возвращаем обычную ширину */
@media (max-width: 768px) {
  .catalogue-list .catalogue-list-item.ajax_buy.wide-left,
  .catalogue-list .catalogue-list-item.ajax_buy.wide-right,
  .catalogue-list .catalogue-list-item.ajax_buy.buy-wide-cart,
  .catalogue-list .catalogue-list-item.ajax_buy.wide-cart {
    grid-column: 1 / -1 !important;
  }

  .catalogue-list-item.ajax_buy.wide-cart .product-preview .image {
    height: 350px;
  }
  .catalogue-list-item.ajax_buy.wide-cart .wide-extra-photos__item {
    height: 48px;
  }
  .catalogue-list-item.ajax_buy.wide-cart .wide-extra-photos__item img {
    height: 48px;
  }
}

/* ============================================================
   CATALOGUE UI — action icons (favorite / cart)
   ============================================================ */

/* чтобы кликабельный оверлей по карточке не перекрывал экшены */
.catalogue-list-item.ajax_buy {
  position: relative;
}

.catalogue-list-item.ajax_buy .product-preview-link {
  z-index: 1;
}

.catalogue-list-item.ajax_buy .btns,
.catalogue-list-item.ajax_buy .product-actions {
  position: relative;
  z-index: 2;
}

/* контейнер иконок */
.product-preview .product-actions {
  display: flex;
  align-items: center;
  width: 100%;
}

/* glass icon button */
.product-preview .product-actions a {
  width: 34px;
  height: 34px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0.48) 100%
  );

  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);

  text-decoration: none;
  cursor: pointer;

  transition:
    transform 0.16s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.product-preview .product-actions a:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, 0.14);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(255, 255, 255, 0.58) 100%
  );
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.product-preview .product-actions a:active {
  transform: translateY(0);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.1),
    inset 0 2px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

/* иконки внутри */
.product-preview .product-actions a svg {
  width: 20px;
  height: 20px;
  display: block;
  opacity: 0.86;
}

/* active/added state */
.product-preview .product-actions a.is-added,
.product-preview .product-actions a.active {
  border-color: rgba(239, 68, 68, 0.22);
  box-shadow:
    0 12px 26px rgba(239, 68, 68, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ============================================================
   CATALOGUE UI — footer (buttons pinned to edges)
   ============================================================ */

.catalogue-list-item.ajax_buy .btns {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

/* артикул по центру */
.catalogue-list-item.ajax_buy .btns .art {
  display: block;
  max-width: 100%;
  text-align: center;
  font-size: 12px;
  color: #9aa0ab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 44px; /* резерв под кнопки слева/справа */
}

/* кнопки по краям — если они лежат прямо в .btns */
.catalogue-list-item.ajax_buy .btns > a.add-to-favorite {
  position: absolute;
  left: 0;
  top: -10px;
}

.catalogue-list-item.ajax_buy .btns > a.add-to-cart {
  position: absolute;
  right: 0;
  top: -10px;
}

/* кнопки по краям — если они внутри .product-actions */
.catalogue-list-item.ajax_buy .btns .product-actions {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none; /* клики отдадим самим кнопкам */
}

.catalogue-list-item.ajax_buy .btns .product-actions > a.add-to-favorite,
.catalogue-list-item.ajax_buy .btns .product-actions > a.add-to-cart {
  position: absolute;
  top: 0;
  pointer-events: auto;
}

.catalogue-list-item.ajax_buy .btns .product-actions > a.add-to-favorite {
  left: 10px;
  top: -8px;
}

.catalogue-list-item.ajax_buy .btns .product-actions > a.add-to-cart {
  right: 10px;
  top: -8px;
}

@media (max-width: 768px) {
  .catalogue-list-item.ajax_buy a.in-favorite {
    left: auto !important;
    right: 35px;
    top: 10px;
  }
  .product-preview .product-actions a.add-to-favorite svg {
    width: 16px;
    height: 16px;
  }
  .product-preview .product-actions a.add-to-cart svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 375px) {
  .catalogue-list-item.ajax_buy .btns > a.add-to-cart {
    right: 2px;
  }

  .catalogue-list-item.ajax_buy .btns > a.add-to-favorite {
    left: 2px;
  }
  .breadcrumbs li {
    font-size: 11px;
  }
}

/* ============================================================
   FILTER — active category (cat--active style)
   ============================================================ */

.filter-section .section-list li.is-active > a {
  position: relative;
  display: block;

  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);

  padding: 12px 14px 12px 26px;
  font-weight: 650;
}

.filter-section .section-list li.is-active > a::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.7);
}

/* ============================================================
   FILTER — hover category (cat--active style)
   ============================================================ */

.filter-section .section-list li:hover a {
  position: relative;
  display: block;

  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);

  padding: 12px 14px 12px 26px;
  font-weight: 650;
  text-decoration: none;
}

.filter-section .section-list li:hover a::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.7);
}
/* ============================================================
   CATALOGUE UI — grid override (force 4 cols on desktop)
   ============================================================ */

@media (min-width: 769px) {
  .catalogue-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    box-sizing: border-box !important;
    grid-auto-flow: row dense !important;
  }
}

.g2-page-nav {
  top: 167px;
}
