.cm-catalog {
  padding: 34px 0 100px;
  background: #ffffff;
  font-family: 'Montserrat', sans-serif;
  color: #2f2f2f;
}

.cm-catalog-container {
  width: min(1680px, calc(100% - 64px));
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

.cm-catalog-hero {
  margin-bottom: 28px;
}

.cm-catalog-title {
  margin: 0 0 10px;
  font-size: 52px;
  line-height: 1.02;
  font-weight: 700;
  color: #d3d3cf;
  text-transform: lowercase;
}

.cm-catalog-subtitle {
  margin: 0;
  max-width: 820px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 500;
  color: #3f3f3f;
}

/* FILTER TABS — Pixory-style pills (весь каталог / журналы / постеры) */
.cm-catalog-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 36px;
  position: relative;
  z-index: 5;
}

.cm-catalog-tab {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid #444;
  background: #ffffff;
  color: #444;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  box-sizing: border-box;
}

.cm-catalog-tab:hover {
  background: #444;
  border-color: #444;
  color: #ffffff;
}

.cm-catalog-tab:focus,
.cm-catalog-tab:focus-visible {
  outline: none;
  box-shadow: none;
}

.cm-catalog-tab.is-active {
  background: #444;
  border-color: #444;
  color: #ffffff;
}

/* GRID — 4 in a row like homepage */
.cm-catalog-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

@keyframes cm-catalog-skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.cm-catalog-grid:not(.is-ready) .cm-catalog-card {
  pointer-events: none;
}

.cm-catalog-grid:not(.is-ready) .cm-catalog-image img,
.cm-catalog-grid:not(.is-ready) .cm-catalog-overlay,
.cm-catalog-grid:not(.is-ready) .cm-catalog-card-hover,
.cm-catalog-grid:not(.is-ready) .cm-catalog-promo-bg img,
.cm-catalog-grid:not(.is-ready) .cm-catalog-promo-inner {
  opacity: 0 !important;
  visibility: hidden !important;
}

.cm-catalog-grid:not(.is-ready) .cm-catalog-card--product .cm-catalog-media,
.cm-catalog-grid:not(.is-ready) .cm-catalog-card--promo {
  background:
    linear-gradient(90deg, #ececec 0%, #f6f6f6 40%, #ececec 80%);
  background-size: 220% 100%;
  animation: cm-catalog-skel 1.15s ease-in-out infinite;
}

.cm-catalog-grid:not(.is-ready) .cm-catalog-card-type,
.cm-catalog-grid:not(.is-ready) .cm-catalog-card-title,
.cm-catalog-grid:not(.is-ready) .cm-catalog-card-price {
  color: transparent !important;
  background:
    linear-gradient(90deg, #ececec 0%, #f6f6f6 40%, #ececec 80%);
  background-size: 220% 100%;
  animation: cm-catalog-skel 1.15s ease-in-out infinite;
  border-radius: 8px;
}

.cm-catalog-grid:not(.is-ready) .cm-catalog-card-title {
  min-height: 28px;
  max-width: 58%;
}

.cm-catalog-grid:not(.is-ready) .cm-catalog-card-type {
  min-height: 12px;
  max-width: 72%;
}

.cm-catalog-grid:not(.is-ready) .cm-catalog-card-price {
  min-height: 22px;
  min-width: 92px;
}

.cm-catalog-grid.is-ready .cm-catalog-card--skel {
  display: none;
}

/* CARDS */
.cm-catalog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 28px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .25s ease;
  min-height: 100%;
  height: 100%;
  box-shadow: 0 6px 24px rgba(0,0,0,0.09);
}

.cm-catalog-card:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.cm-catalog-card-default,
.cm-catalog-card-hover {
  transition: opacity .38s ease, visibility .38s ease;
}

.cm-catalog-card-default {
  position: relative;
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.cm-catalog-card-hover {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  border-radius: inherit;
}

.cm-catalog-card--product:hover .cm-catalog-card-default {
  opacity: 0;
  visibility: hidden;
}

.cm-catalog-card--product:hover .cm-catalog-card-hover {
  opacity: 1;
  visibility: visible;
}

.cm-catalog-card--product .cm-catalog-media {
  position: relative;
  aspect-ratio: 0.96 / 1;
  overflow: hidden;
  background: #f0f0ec;
}

.cm-catalog-image {
  position: absolute;
  inset: 0;
}

.cm-catalog-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cm-catalog-card--from-design .cm-catalog-media {
  background: #ffffff;
}

.cm-catalog-card--from-design .cm-catalog-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.cm-catalog-card--from-design .cm-catalog-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 52%;
  max-height: 70%;
  object-fit: contain;
  object-position: center;
  padding: 0;
  border-radius: 2px;
  /* без aspect-ratio — иначе белые полосы внутри тени */
  box-shadow:
    0 8px 20px rgba(40, 28, 16, 0.24),
    0 2px 6px rgba(40, 28, 16, 0.14);
}

.cm-catalog-image-empty {
  display: block;
  width: 36%;
  height: 64%;
  border-radius: 3px;
  background: #f4f4f4;
  box-shadow:
    0 5px 12px rgba(40, 28, 16, 0.22),
    0 2px 4px rgba(40, 28, 16, 0.12);
}

.cm-catalog-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 18px;
  pointer-events: none;
}

.cm-catalog-badge,
.cm-catalog-card--product[data-badge]:not([data-badge=""])::before {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: var(--cm-badge-new-pad-y, 2px) var(--cm-badge-new-pad-x, 8px);
  border-radius: 999px;
  background: var(--cm-badge-new-bg, #fde8e2);
  color: var(--cm-badge-new-fg, #c45d3a);
  font-size: var(--cm-badge-new-size, 11px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
  text-transform: lowercase;
  box-shadow: none;
  clip-path: none;
}

.cm-catalog-card--product[data-badge]:not([data-badge=""])::before {
  content: attr(data-badge);
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 3;
  pointer-events: none;
}

.cm-catalog-card--product[data-badge]:not([data-badge=""]) .cm-catalog-overlay .cm-catalog-badge,
.cm-catalog-card--product[data-badge]:not([data-badge=""]) .cm-catalog-card-hover-overlay .cm-catalog-badge {
  visibility: hidden;
}

.cm-catalog-card-body {
  padding: 14px 32px 16px;
  background: #ffffff;
}

.cm-catalog-card-type {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9d9d97;
}

.cm-catalog-card-text {
  display: none !important;
}

/* Home-style cards reuse this class for title/price — must be visible */
.cm-catalog-card--home .cm-catalog-card-text {
  display: flex !important;
}

.cm-catalog-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cm-catalog-card-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 31px;
  line-height: 1.02;
  font-weight: 700;
  text-transform: lowercase;
  color: #2f2f2f;
}

.cm-catalog-card-price {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: #2f2f2f;
}

.cm-catalog-price-old {
  color: #9a9a9a !important;
  font-weight: 500 !important;
  text-decoration: line-through;
  margin-right: 8px;
}

.cm-catalog-price-new {
  color: inherit;
  font-weight: 700;
}

.cm-catalog-card-hover-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .45s ease, opacity .3s ease;
}

.cm-catalog-card.has-spread .cm-catalog-card-hover-image {
  opacity: 0;
}

.cm-catalog-spread {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px 78px;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.cm-catalog-card.has-spread .cm-catalog-spread {
  opacity: 1;
}

.cm-catalog-spread-book {
  position: relative;
  width: min(92%, 500px);
  aspect-ratio: 420 / 297;
  max-height: 100%;
  overflow: hidden;
  background: #fff;
  transform: translate3d(0, 0, 0);
  box-shadow: 0 3px 6px rgba(40, 28, 16, 0.18);
}

.cm-catalog-spread-page {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.cm-catalog-spread-page--left {
  left: 0;
}

.cm-catalog-spread-page--right {
  left: 50%;
}

.cm-catalog-spread-page img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #fff;
}

.cm-catalog-spread-shadow {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 46%,
    rgba(0, 0, 0, 0.08) 49.4%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.08) 50.6%,
    rgba(0, 0, 0, 0) 54%
  );
}

.cm-catalog-card--product:hover .cm-catalog-card-hover-image {
  transform: scale(1);
}

.cm-catalog-card-hover-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: transparent;
}

.cm-catalog-card-hover-btn {
  align-self: stretch;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 52px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  color: #2f2f2f;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 3px 6px rgba(0,0,0,0.14);
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .28s ease, transform .32s ease;
}

.cm-catalog-card--product:hover .cm-catalog-card-hover-btn {
  opacity: 1;
  transform: translateY(0);
}

/* PROMO CARD */
.cm-catalog-card--promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  height: 100%;
  background: #ece9e7;
  overflow: hidden;
  aspect-ratio: auto;
}

.cm-catalog-promo-bg {
  position: absolute;
  inset: 0;
}

.cm-catalog-promo-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(18, 18, 18, 0.30) 0%,
    rgba(18, 18, 18, 0.12) 28%,
    rgba(18, 18, 18, 0.00) 58%
  );
}

.cm-catalog-promo-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: none;
}

.cm-catalog-card--promo:hover .cm-catalog-promo-bg img {
  transform: scale(1);
}

.cm-catalog-promo-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 24px;
  color: #ffffff;
}

.cm-catalog-promo-top {
  display: none;
}

.cm-catalog-promo-tag {
  display: none;
}

.cm-catalog-promo-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: auto;
  max-width: 72%;
}

.cm-catalog-promo-title {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #ffffff;
}

.cm-catalog-promo-text {
  margin: 0 0 18px;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.32;
  font-weight: 500;
  color: rgba(255,255,255,0.94);
}

.cm-catalog-promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.92);
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  transition:
    background .25s ease,
    color .25s ease,
    border-color .25s ease,
    transform .25s ease;
}

.cm-catalog-card--promo:hover .cm-catalog-promo-btn {
  background: #ffffff;
  color: #2f2f2f;
  border-color: #ffffff;
  transform: translateY(-1px);
}

.cm-catalog-card--promo-dark .cm-catalog-promo-bg::after {
  background: linear-gradient(
    to top,
    rgba(16,14,14,0.38) 0%,
    rgba(16,14,14,0.14) 30%,
    rgba(16,14,14,0.00) 60%
  );
}

.cm-catalog-badge:empty {
  opacity: 0;
  visibility: hidden;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .cm-catalog-container {
    width: min(100% - 40px, 100%);
  }

  .cm-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .cm-catalog-title {
    font-size: 42px;
  }

  .cm-catalog-subtitle {
    font-size: 18px;
  }

  .cm-catalog-card {
    border-radius: 22px;
    background: #ffffff;
  }

  .cm-catalog-card--product .cm-catalog-media {
    aspect-ratio: 0.92 / 1;
  }

  .cm-catalog-card--promo {
    aspect-ratio: auto;
    height: 100%;
  }

  .cm-catalog-card-body {
    padding: 12px 28px 14px;
    background: #ffffff;
  }

  .cm-catalog-promo-inner {
    padding: 20px;
  }

  .cm-catalog-promo-bottom {
    max-width: 74%;
  }

  .cm-catalog-card-title {
    font-size: 24px;
    line-height: 1;
  }

  .cm-catalog-card-price {
    font-size: 18px;
    line-height: 1;
  }

  .cm-catalog-promo-title {
    font-size: 28px;
    line-height: 0.98;
    margin-bottom: 8px;
  }

  .cm-catalog-promo-text {
    font-size: 13px;
    line-height: 1.28;
    margin-bottom: 14px;
  }

  .cm-catalog-promo-btn {
    min-width: 150px;
    height: 42px;
    padding: 0 14px;
    font-size: 12px;
    border-width: 1px;
  }
}

@media (min-width: 981px) and (max-width: 1280px) {
  .cm-catalog-card-body {
    padding: 12px 28px 14px;
  }

  .cm-catalog-card-type {
    margin: 0 0 6px;
    font-size: 11px;
  }

  .cm-catalog-card-bottom {
    gap: 12px;
    align-items: flex-end;
  }

  .cm-catalog-card-title {
    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cm-catalog-card-price {
    font-size: 17px;
    line-height: 1;
  }
}

@media (max-width: 980px) {
  .cm-catalog {
    padding: 24px 0 64px;
  }

  .cm-catalog-container {
    width: min(100% - 28px, 100%);
  }

  .cm-catalog-hero {
    margin-bottom: 22px;
  }

  .cm-catalog-title {
    font-size: 34px;
    margin-bottom: 8px;
  }

  .cm-catalog-subtitle {
    font-size: 15px;
    line-height: 1.4;
    max-width: 100%;
  }

  .cm-catalog-filters {
    gap: 8px;
    margin: 4px 0 28px;
  }

  .cm-catalog-tab {
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
  }

  .cm-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .cm-catalog-card {
    border-radius: 18px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    background: #ffffff;
  }

  .cm-catalog-card:hover {
    box-shadow: 0 5px 14px rgba(0,0,0,0.07);
  }

  .cm-catalog-card--product .cm-catalog-media {
    aspect-ratio: 0.92 / 1;
    background: #ffffff;
  }

  .cm-catalog-card--promo {
    aspect-ratio: auto;
    height: 100%;
    background: #ffffff;
  }

  .cm-catalog-overlay,
  .cm-catalog-card-hover-overlay {
    padding: 12px;
  }

  .cm-catalog-badge,
  .cm-catalog-card--product[data-badge]:not([data-badge=""])::before {
    min-height: 0;
    padding: var(--cm-badge-new-pad-y, 2px) var(--cm-badge-new-pad-x, 8px);
    font-size: var(--cm-badge-new-size, 11px);
  }

  .cm-catalog-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title title"
      "type price";
    row-gap: 4px;
    column-gap: 10px;
    padding: 10px 22px 12px;
    background: #ffffff;
    align-items: end;
  }

  .cm-catalog-card-title {
    grid-area: title;
    font-size: 17px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }

  .cm-catalog-card-type {
    grid-area: type;
    margin: 0;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.06em;
    align-self: end;
  }

  .cm-catalog-card-price {
    grid-area: price;
    font-size: 15px;
    line-height: 1;
    align-self: end;
  }

  .cm-catalog-card-bottom {
    display: contents;
  }

  .cm-catalog-promo-inner {
    padding: 16px;
  }

  .cm-catalog-promo-bottom {
    max-width: 88%;
  }

  .cm-catalog-promo-title {
    margin: 0 0 6px;
    font-size: 23px;
    line-height: 0.98;
  }

  .cm-catalog-promo-text {
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 1.24;
    max-width: 100%;
  }

  .cm-catalog-promo-btn {
    min-width: 120px;
    height: 34px;
    padding: 0 12px;
    font-size: 11px;
    border-width: 1px;
  }

  .cm-catalog-card-hover {
    display: none;
  }

  .cm-catalog-card-default {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

@media (max-width: 767px) {
  .cm-catalog {
    padding: 18px 0 50px;
  }

  .cm-catalog-container {
    width: min(100% - 20px, 100%);
  }

  .cm-catalog-title {
    font-size: 28px;
  }

  .cm-catalog-subtitle {
    font-size: 14px;
  }

  .cm-catalog-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 22px;
  }

  .cm-catalog-tab {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }

  .cm-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cm-catalog-card {
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    background: #ffffff;
  }

  .cm-catalog-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  }

  .cm-catalog-card--product .cm-catalog-media {
    aspect-ratio: 0.92 / 1.02;
    background: #ffffff;
  }

  .cm-catalog-card--promo {
    aspect-ratio: auto;
    height: 100%;
    background: #ffffff;
  }

  .cm-catalog-overlay {
    padding: 10px;
  }

  .cm-catalog-badge,
  .cm-catalog-card--product[data-badge]:not([data-badge=""])::before {
    min-height: 0;
    padding: var(--cm-badge-new-pad-y, 2px) var(--cm-badge-new-pad-x, 8px);
    font-size: 10px;
  }

  .cm-catalog-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title title"
      "type price";
    row-gap: 4px;
    column-gap: 8px;
    padding: 8px 20px 16px;
    background: #ffffff;
    align-items: end;
  }

  .cm-catalog-card-title {
    grid-area: title;
    font-size: 14px;
    line-height: 1;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin: 0;
  }

  .cm-catalog-card-type {
    grid-area: type;
    font-size: 8px;
    margin: 0;
    line-height: 1;
    align-self: end;
  }

  .cm-catalog-card-price {
    grid-area: price;
    font-size: 13px;
    line-height: 1;
    align-self: end;
  }

  .cm-catalog-card-bottom {
    display: contents;
  }

  .cm-catalog-promo-inner {
    padding: 14px;
  }

  .cm-catalog-promo-bottom {
    max-width: 100%;
  }

  .cm-catalog-promo-title {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .cm-catalog-promo-text {
    font-size: 10px;
    line-height: 1.22;
    margin-bottom: 10px;
    max-width: 100%;
  }

  .cm-catalog-promo-btn {
    min-width: 110px;
    height: 32px;
    padding: 0 10px;
    font-size: 10px;
    border-width: 1px;
  }

  .cm-catalog-card-hover {
    display: none;
  }

  .cm-catalog-card-default {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

@media (max-width: 420px) {
  .cm-catalog-grid {
    gap: 8px;
  }

  .cm-catalog-card-bottom {
    gap: 8px;
  }

  .cm-catalog-card-title {
    font-size: 13px;
  }

  .cm-catalog-card-price {
    font-size: 12px;
  }

  .cm-catalog-promo-title {
    font-size: 18px;
  }

  .cm-catalog-promo-text {
    font-size: 10px;
  }

  .cm-catalog-promo-btn {
    min-width: 104px;
    height: 30px;
    font-size: 10px;
  }
}


/* ===== Homepage-style product cards (popular) ===== */
.cm-catalog-card--home {
  /* Fluid type: scales with viewport, no per-breakpoint px tweaks */
  --cm-fs-title: clamp(0.8125rem, 0.55rem + 0.9vw, 1.25rem); /* 13→20 */
  --cm-fs-category: clamp(0.6875rem, 0.5rem + 0.55vw, 0.9375rem); /* 11→15 */
  --cm-fs-price: clamp(0.75rem, 0.52rem + 0.7vw, 1rem); /* 12→16 */
  --cm-fs-from: clamp(0.75rem, 0.52rem + 0.7vw, 1rem); /* same as price */
  --cm-fs-cta: clamp(0.75rem, 0.55rem + 0.55vw, 1rem);
  --cm-pad-x: clamp(0.25rem, 0.15rem + 0.4vw, 0.5rem);
  --cm-pad-bottom: clamp(0.5rem, 0.35rem + 0.35vw, 0.5625rem);
  --cm-gap-text: clamp(0.35rem, 0.25rem + 0.25vw, 0.5rem);

  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 11px;
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 0;
  height: auto;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cm-catalog-card--home .cm-catalog-card-photo {
  position: relative;
  isolation: isolate;
  aspect-ratio: 0.92;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
}

.cm-catalog-card--home .cm-catalog-card-photo img,
.cm-catalog-card--home .cm-catalog-image-empty {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
}

.cm-catalog-card--home .cm-catalog-image-empty {
  background: #ececec;
}

.cm-catalog-card--home .cm-catalog-card-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--cm-gap-text);
  width: 100%;
  min-height: 0;
  padding: 0 var(--cm-pad-x) var(--cm-pad-bottom);
  background: #fff;
  text-align: center;
  box-sizing: border-box;
}

.cm-catalog-card--home .cm-catalog-card-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
}

.cm-catalog-card--home .cm-catalog-card-title {
  margin: 0;
  font-size: var(--cm-fs-title);
  font-weight: 600;
  text-transform: lowercase;
  line-height: 1.25;
  color: #414141;
  text-align: center;
}

.cm-catalog-card--home .cm-catalog-card-category {
  font-size: var(--cm-fs-category);
  font-weight: 500;
  color: #929292;
  text-transform: lowercase;
  text-align: center;
}

.cm-catalog-card--home .cm-catalog-card-price {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
  font-size: var(--cm-fs-price);
  font-weight: 600;
  color: #414141;
  text-align: center;
}

.cm-catalog-card--home .cm-catalog-price-from {
  margin-right: 6px;
  font-size: var(--cm-fs-from);
  font-weight: 500;
  color: #8d8d8d;
}

/* Full-card overlay: covers photo AND text on hover */
.cm-catalog-card--home .cm-catalog-card-hover-stage {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 11px;
  background: #f5f5f5;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.cm-catalog-card--home .cm-catalog-card-hover-stage > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1.018);
  transition: transform 0.55s ease;
}

.cm-catalog-card--home .cm-catalog-card-hover-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(75, 75, 75, 0.24);
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

/* Match homepage CTA: white default, dark fill on button hover.
   width+inset (не только left/right) — Тильда иногда ломает растягивание span. */
.cm-catalog-card--home .cm-catalog-card-hover-btn {
  position: absolute !important;
  z-index: 3;
  left: 13px !important;
  right: 13px !important;
  bottom: 13px !important;
  top: auto !important;
  width: calc(100% - 26px) !important;
  max-width: none !important;
  margin: 0 !important;
  min-height: 42px;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  align-self: auto !important;
  background: #fff;
  color: #2f2f2f;
  text-align: center;
  border: 0;
  border-radius: 100px;
  padding: 11px 16px;
  font-size: var(--cm-fs-cta);
  line-height: 1.2;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
  box-shadow: none;
  outline: 0;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    color 0.35s cubic-bezier(0.22, 0.75, 0.2, 1),
    background-color 0.35s cubic-bezier(0.22, 0.75, 0.2, 1);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.cm-catalog-card--home .cm-catalog-card-hover-btn::before {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  z-index: 0;
  background: #2f2f2f;
  border-radius: inherit;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.22, 0.75, 0.2, 1);
  transform: translate3d(0, -101%, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.cm-catalog-card--home .cm-catalog-card-hover-btn[data-enter="top"]::before {
  transform: translate3d(0, -101%, 0);
}
.cm-catalog-card--home .cm-catalog-card-hover-btn[data-enter="bottom"]::before {
  transform: translate3d(0, 101%, 0);
}
.cm-catalog-card--home .cm-catalog-card-hover-btn[data-enter="left"]::before {
  transform: translate3d(-101%, 0, 0);
}
.cm-catalog-card--home .cm-catalog-card-hover-btn[data-enter="right"]::before {
  transform: translate3d(101%, 0, 0);
}

.cm-catalog-card--home .cm-catalog-card-hover-btn.cm-cta-active {
  color: #fff;
  background: #2f2f2f;
}

.cm-catalog-card--home .cm-catalog-card-hover-btn.cm-cta-active::before {
  transform: translate3d(0, 0, 0);
}

.cm-catalog-card--home .cm-catalog-card-hover-btn .cm-catalog-hover-label {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

@media (hover: hover) {
  .cm-catalog-card--home:hover {
    border-color: rgba(85, 85, 85, 0.28);
  }

  .cm-catalog-card--home:hover .cm-catalog-card-hover-stage {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .cm-catalog-card--home:hover .cm-catalog-card-hover-stage > img {
    transform: scale(1);
  }

  .cm-catalog-card--home:hover .cm-catalog-card-hover-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.cm-catalog-card--home:focus-visible {
  outline: 2px solid #424242;
  outline-offset: 3px;
}

.cm-catalog-card--home:focus-visible .cm-catalog-card-hover-stage {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cm-catalog-card--home:focus-visible .cm-catalog-card-hover-btn {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.cm-catalog-card--home .cm-catalog-card-hover-btn:focus-visible {
  outline: 2px solid #2f2f2f;
  outline-offset: 2px;
}

.cm-catalog-card--home .cm-catalog-card-hover-btn.cm-cta-active:focus-visible {
  outline-color: #fff;
}

@media (hover: none) {
  .cm-catalog-card--home .cm-catalog-card-hover-stage {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm-catalog-card--home .cm-catalog-card-hover-stage,
  .cm-catalog-card--home .cm-catalog-card-hover-btn,
  .cm-catalog-card--home .cm-catalog-card-hover-btn::before,
  .cm-catalog-card--home .cm-catalog-card-hover-stage > img {
    transition: none;
  }
}

@media (max-width: 900px) {
  .cm-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 15px !important;
  }

  .cm-catalog-card--home .cm-catalog-card-hover-btn {
    padding: 10px 14px;
  }
}

@media (max-width: 650px) {
  .cm-catalog-grid {
    gap: 11px !important;
  }
}


/* home card text visibility (do not override overflow/radius — needed for full-card hover) */
.cm-catalog-card.cm-catalog-card--home .cm-catalog-card-text {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.cm-catalog-card.cm-catalog-card--home .cm-catalog-card-title { color: #414141 !important; }
.cm-catalog-card.cm-catalog-card--home .cm-catalog-card-category { color: #929292 !important; }
.cm-catalog-card.cm-catalog-card--home .cm-catalog-card-price { color: #414141 !important; }
.cm-catalog-card.cm-catalog-card--home .cm-catalog-price-from { color: #8d8d8d !important; font-weight: 500 !important; }
.cm-catalog-grid.is-ready .cm-catalog-card--home .cm-catalog-card-title,
.cm-catalog-grid.is-ready .cm-catalog-card--home .cm-catalog-card-price,
.cm-catalog-grid.is-ready .cm-catalog-card--home .cm-catalog-card-category {
  background: none !important;
  animation: none !important;
}
