/*
 * КнигДекор · единая товарная карточка v3
 * Подключается после style.css/theme-v2.css на витринах комплектов и арт-объектов.
 */

.product-card {
  --product-card-font: "Nunito Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: var(--c-text);
  background: transparent;
  box-shadow: none;
}

/* Специфичность намеренно выше старых .theme-v2/.catalog-card правил. */
.product-card.catalog-card .catalog-card__media {
  border-radius: 20px;
}

.product-card.catalog-card .catalog-card__body {
  padding: 0.9rem 0.15rem 0;
}

.product-card.catalog-card .card__kicker,
.product-card.catalog-card .card__title,
.product-card.catalog-card .card__price,
.product-card.catalog-card .card__add-btn {
  font-family: var(--product-card-font);
}

.product-card.catalog-card .card__kicker {
  font-size: var(--type-meta, 0.875rem);
  line-height: var(--leading-meta, 1.45);
}

.product-card.catalog-card .card__title {
  font-size: 1.18rem;
}

.product-card.catalog-card .card__price {
  font-size: 1rem;
}

.product-card.catalog-card .card__add-btn {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: var(--c-accent);
  color: #fff;
  background: var(--c-accent);
}

.product-card.catalog-card .card__add-btn:hover {
  border-color: var(--c-accent-hover);
  color: #fff;
  background: var(--c-accent-hover);
}

.product-card.catalog-card .card__add-btn.is-added {
  border-color: var(--c-accent-2);
  color: #fff;
  background: var(--c-accent-2);
}

.product-card:hover {
  transform: none;
  box-shadow: none;
}

.product-card .catalog-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 20px;
  background: var(--surface-placeholder, #e9e9e4);
}

.product-card .catalog-card__media::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(32, 35, 31, 0.07);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.product-card .catalog-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s var(--ease), filter 0.32s var(--ease);
}

.product-card:hover .catalog-card__media img {
  transform: scale(1.025);
}

.product-card .catalog-card__body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto 46px;
  align-content: start;
  align-items: end;
  gap: 0.4rem 0.6rem;
  padding: 0.9rem 0.15rem 0;
}

.product-card--set .catalog-card__body {
  grid-template-rows: auto auto 46px;
}

.product-card.product-card--set .card__price,
.product-card.product-card--set .card__add-btn {
  grid-row: 3;
}

.product-card .card__kicker,
.product-card .catalog-card__title-link,
.product-card .card__palette {
  grid-column: 1 / -1;
}

.product-card .card__kicker {
  overflow: hidden;
  margin: 0;
  color: var(--c-text-muted);
  font-family: var(--f-sans);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.product-card .catalog-card__title-link {
  width: fit-content;
  max-width: 100%;
  align-self: start;
  color: var(--c-text);
}

.product-card .catalog-card__title-link::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

.product-card .catalog-card__title-link:focus-visible {
  outline: none;
}

.product-card .catalog-card__title-link:focus-visible::after {
  border-radius: 20px;
  outline: 3px solid #afc3e3;
  outline-offset: 4px;
}

.product-card .card__title {
  min-height: 2.12em;
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card:hover .card__title {
  color: var(--c-accent);
}

.product-card .card__palette {
  min-height: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.product-card .card__palette span {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 1px solid rgba(32, 35, 31, 0.09);
  border-radius: 50%;
}

.product-card .card__price {
  grid-column: 1;
  grid-row: 4;
  align-self: center;
  margin: 0;
  padding: 0;
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.product-card .card__price s {
  display: block;
  margin-bottom: 2px;
  color: var(--c-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.product-card .card__add-btn {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 4;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  align-self: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--c-accent);
  border-radius: 14px;
  color: #fff;
  background: var(--c-accent);
  font-family: var(--f-sans);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.product-card .card__add-btn:hover {
  transform: translateY(-1px);
  border-color: var(--c-accent-hover);
  color: #fff;
  background: var(--c-accent-hover);
}

.product-card .card__add-btn.is-added {
  border-color: var(--c-accent-2);
  color: #fff;
  background: var(--c-accent-2);
}

.product-card .card__add-btn svg {
  width: 17px !important;
  height: 17px !important;
}

.product-card .card__add-label {
  display: none;
}

.product-card[data-oos="1"] .catalog-card__media img {
  filter: saturate(0.62);
}

.product-card .card__oos {
  top: 12px;
  right: 12px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  font-size: 0.68rem;
  font-weight: 800;
}

@media (min-width: 1024px) {
  .product-card .catalog-card__body {
    grid-template-rows: auto auto auto 48px;
    padding-top: 1rem;
  }

  .product-card--set .catalog-card__body {
    grid-template-rows: auto auto 48px;
  }

  .product-card .card__title {
    font-size: clamp(1.2rem, 1.55vw, 1.42rem);
  }

  .product-card.catalog-card .card__title {
    font-size: clamp(1.2rem, 1.55vw, 1.42rem);
  }

  .product-card .card__add-btn {
    width: auto;
    min-width: 116px;
    min-height: 46px;
    padding: 0 14px;
  }

  .product-card.catalog-card .card__add-btn {
    width: auto;
    min-width: 116px;
    min-height: 46px;
    padding: 0 14px;
  }

  .product-card .card__add-label {
    display: inline;
  }
}

@media (max-width: 599px) {
  .product-card .catalog-card__body {
    grid-template-rows: auto auto auto 44px;
    gap: 0.34rem 0.45rem;
    padding-top: 0.75rem;
  }

  .product-card--set .catalog-card__body {
    grid-template-rows: auto auto 44px;
  }

  .product-card .card__kicker {
    font-size: 0.63rem;
  }

  .product-card.catalog-card .catalog-card__body {
    padding-top: 0.75rem;
  }

  .product-card.catalog-card .card__kicker {
    font-size: var(--type-meta, 0.8125rem);
  }

  .product-card .card__title {
    font-size: 1rem;
    line-height: 1.08;
  }

  .product-card.catalog-card .card__title {
    font-size: 1rem;
  }

  .product-card .card__palette {
    gap: 4px;
  }

  .product-card .card__palette span {
    width: 10px;
    height: 10px;
  }

  .product-card .card__price {
    font-size: 0.94rem;
  }

  .product-card.catalog-card .card__price {
    font-size: 0.94rem;
  }
}
