/* ============================================================
   «Кабинет редкостей» — единое бумажное паспарту для книг
   Одна и та же тёплая бумага и тонкая золотая рамка у всех
   карточек каталога и в «Смотровом зале» (окне товара).
   ============================================================ */

:root {
  --pnv-paper: #c9b99e;
  --pnv-paper2: #dbceb8;
  --pnv-ink: #1b1a17;
  --pnv-brass: #c9a95c;
  --pnv-brass-light: #e8d7a1;
}

/* ---------- карточка каталога ---------- */

.catalogCard {
  position: relative;
  background: #111419;
  border: 1px solid rgba(201, 169, 92, .2);
  padding: 10px 10px 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}

.catalogCard:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 92, .62);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .4);
}

.catalogCard:before {
  display: none;
}

.catalogCard .catalogMedia {
  display: block;
  position: relative;
  height: auto;
  aspect-ratio: 1 / 1.18;
  overflow: visible;
  background: transparent;
}

.catalogCard .catalogMedia:after {
  display: none;
}

.paperPlate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 24px 28px;
  overflow: hidden;
  isolation: isolate;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E") 0 0 / 160px 160px,
    linear-gradient(145deg, var(--pnv-paper2), var(--pnv-paper));
  background-blend-mode: multiply;
  box-shadow: inset 0 0 62px rgba(91, 70, 38, .11);
}

.paperPlate:before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(27, 26, 23, .2);
  pointer-events: none;
  z-index: 2;
}

.paperPlate:after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201, 169, 92, .5);
  pointer-events: none;
  z-index: 2;
  transition: border-color .3s;
}

.catalogCard:hover .paperPlate:after {
  border-color: rgba(201, 169, 92, .82);
}

.catalogCard .catalogMedia .plateImg {
  position: relative;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(27, 26, 23, .08);
  box-shadow: 0 12px 26px rgba(27, 26, 23, .16);
  mix-blend-mode: multiply;
  filter: brightness(.93) contrast(1.06) saturate(.96);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-composite: intersect;
  transition: transform .55s ease;
}

.catalogCard:hover .catalogMedia .plateImg {
  transform: scale(1.018);
}

.plateTop {
  position: absolute;
  z-index: 3;
  left: 24px;
  right: 24px;
  top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(27, 26, 23, .6);
  font-size: 8px;
  letter-spacing: .16em;
  text-transform: uppercase;
  pointer-events: none;
}

.plateTop span:last-child {
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.plateNo {
  font: 500 13px var(--serif, Georgia, serif);
  letter-spacing: .05em;
  color: rgba(27, 26, 23, .78);
}

.plateTicks span {
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.plateTicks span:nth-child(1) {
  left: 15px;
  top: 15px;
  border-left: 1px solid rgba(27, 26, 23, .55);
  border-top: 1px solid rgba(27, 26, 23, .55);
}

.plateTicks span:nth-child(2) {
  right: 15px;
  top: 15px;
  border-right: 1px solid rgba(27, 26, 23, .55);
  border-top: 1px solid rgba(27, 26, 23, .55);
}

.plateTicks span:nth-child(3) {
  left: 15px;
  bottom: 15px;
  border-left: 1px solid rgba(27, 26, 23, .55);
  border-bottom: 1px solid rgba(27, 26, 23, .55);
}

.plateTicks span:nth-child(4) {
  right: 15px;
  bottom: 15px;
  border-right: 1px solid rgba(27, 26, 23, .55);
  border-bottom: 1px solid rgba(27, 26, 23, .55);
}

.plateHint {
  position: absolute;
  z-index: 3;
  right: 22px;
  bottom: 18px;
  font-size: 7px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(27, 26, 23, .5);
  opacity: 0;
  transform: translateY(3px);
  transition: .25s;
  pointer-events: none;
}

.catalogCard:hover .plateHint {
  opacity: 1;
  transform: none;
}

/* подпись на бумаге для товаров без фото */
.paperPlate .bookPlaceholder {
  position: absolute;
  inset: 0;
  height: 100%;
  background: transparent;
  color: #5b4a2e;
}

.paperPlate .bookPlaceholder span {
  color: #4f3f28;
}

.paperPlate .bookPlaceholder small {
  color: rgba(91, 74, 46, .7);
}

/* ---------- текстовая часть карточки ---------- */

.catalogCard .catalogBody {
  padding: 17px 6px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalogCard .catalogBody > .catalogBadge {
  position: static;
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 9px;
  padding: 4px 7px;
  background: rgba(201, 169, 92, .1);
  border: 1px solid rgba(201, 169, 92, .38);
  color: var(--pnv-brass);
  font-size: 7px;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.catalogCard .catalogMeta {
  color: #77746d;
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.catalogCard .catalogBody h3 {
  font-size: 25px;
  line-height: .98;
  margin: 9px 0 6px;
  min-height: 48px;
}

.catalogCard .catalogBody h3 a:hover {
  color: var(--pnv-brass-light);
}

.catalogCard .catalogAuthor {
  color: var(--pnv-brass);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
  min-height: 13px;
}

.catalogCard .catalogDescription {
  display: none;
}

.catalogCard .catalogPrice {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.catalogCard .catalogPrice strong {
  font: 500 22px var(--serif, Georgia, serif);
  color: var(--pnv-brass-light);
}

.catalogCard .cardActions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 10px;
}

.catalogCard .catalogBuy {
  margin-top: 10px;
}

.catalogCard .cardActions .catalogBuy {
  margin-top: 0;
}

.catalogCard .more {
  border-color: rgba(201, 169, 92, .25);
  color: var(--pnv-brass-light);
}

.catalogCard .more:hover {
  background: rgba(201, 169, 92, .1);
}

/* ---------- «Смотровой зал»: окно товара ---------- */

.detailsMedia {
  position: relative;
  min-height: 520px;
  background: #0f1216;
  padding: 12px;
  overflow: hidden;
}

.detailsPaper {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 26px 90px;
  overflow: hidden;
  isolation: isolate;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E") 0 0 / 160px 160px,
    linear-gradient(145deg, var(--pnv-paper2), var(--pnv-paper));
  background-blend-mode: multiply;
  box-shadow: inset 0 0 90px rgba(91, 70, 38, .12);
}

.detailsPaper:before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(27, 26, 23, .2);
  pointer-events: none;
  z-index: 2;
}

.detailsPaper:after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(201, 169, 92, .38);
  pointer-events: none;
  z-index: 2;
}

.detailsMedia #detailsMainImage {
  position: relative;
  left: auto;
  top: auto;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(27, 26, 23, .08);
  box-shadow: 0 18px 40px rgba(27, 26, 23, .18);
  mix-blend-mode: multiply;
  filter: brightness(.93) contrast(1.06) saturate(.96);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-composite: intersect;
  z-index: 1;
  transition: opacity .2s;
}

.detailsMedia--single .detailsPaper {
  padding-bottom: 26px;
}

.detailsMedia--single #detailsMainImage {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  height: auto;
}

.detailsMedia .catalogBadge {
  top: 24px;
  left: 24px;
  z-index: 5;
  background: rgba(27, 26, 23, .82);
  border: 1px solid rgba(201, 169, 92, .45);
  color: var(--pnv-brass-light);
}

.detailsMedia .detailsThumbs {
  left: 26px;
  right: 26px;
  bottom: 22px;
  z-index: 4;
}

.detailsMedia .detailsThumb {
  width: 58px;
  height: 58px;
  padding: 4px;
  border: 1px solid rgba(27, 26, 23, .3);
  background: rgba(246, 241, 231, .55);
}

.detailsMedia .detailsThumb img {
  position: static;
  width: 100%;
  height: 100%;
  padding: 2px;
  object-fit: contain;
}

.detailsMedia .detailsThumb:hover,
.detailsMedia .detailsThumb.active {
  border-color: rgba(27, 26, 23, .8);
  background: rgba(246, 241, 231, .85);
}

/* ---------- адаптив ---------- */

@media (max-width: 760px) {
  .catalogCard {
    padding: 8px 8px 0;
  }

  .catalogCard .catalogBody {
    padding: 13px 4px 12px;
  }

  .catalogCard .catalogBody h3 {
    font-size: 21px;
    min-height: 42px;
  }

  .catalogCard .catalogAuthor {
    font-size: 7px;
  }

  .catalogCard .catalogPrice strong {
    font-size: 19px;
  }

  .catalogCard .paperPlate {
    padding: 28px 16px 22px;
  }

  .catalogCard .catalogMedia .plateImg {
    padding: 0;
  }

  .plateTop {
    left: 18px;
    right: 18px;
    top: 16px;
    font-size: 7px;
  }

  .plateNo {
    font-size: 11px;
  }

  .plateTicks span {
    width: 11px;
    height: 11px;
  }

  .plateTicks span:nth-child(1) {
    left: 11px;
    top: 11px;
  }

  .plateTicks span:nth-child(2) {
    right: 11px;
    top: 11px;
  }

  .plateTicks span:nth-child(3) {
    left: 11px;
    bottom: 11px;
  }

  .plateTicks span:nth-child(4) {
    right: 11px;
    bottom: 11px;
  }

  .plateHint {
    right: 16px;
    bottom: 14px;
    font-size: 6px;
  }

  .detailsMedia {
    min-height: 360px;
    max-height: 360px;
    padding: 8px;
  }

  .detailsPaper {
    inset: 8px;
    padding: 34px 16px 72px;
  }

  .detailsMedia--single .detailsPaper {
    padding-bottom: 24px;
  }

  .detailsMedia #detailsMainImage {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
  }

  .detailsMedia--single #detailsMainImage {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
  }

  .detailsMedia .detailsThumbs {
    left: 16px;
    right: 16px;
    bottom: 14px;
  }

  .detailsMedia .detailsThumb {
    width: 46px;
    height: 46px;
  }

  .detailsMedia .catalogBadge {
    top: 14px;
    left: 14px;
  }
}
