/* категория (чип под ником) */
.category-chip {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  padding: 2px 12px 2px 10px;
  border-radius: 999px;
  background: #e9f9f4;      /* как в каталоге */
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
  max-width: fit-content;
}

.category-chip::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 12px;
  border-radius: 999px;
  background: #9ca3af;
  margin-right: 6px;
}

/* бейджи "Канал" / "RU" как в каталоге */
.badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  background: #1DDD9D;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  line-height: 1;
}

/* общая обёртка страницы */
.resource-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 16px;
}

.resource-card {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 24px;
  align-items: start;
}

/* левая часть */

.left {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

/* сетка слева: колонка с аватаром и колонка с текстом */
.left-layout {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}

/* аватар + теги под ним */
.left-avatar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.left-avatar img {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
}

/* теги под аватаром (иконки тегов) */
.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 999px;
  background: #f3f4f6;
}

.resource-tag img {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
}

/* правая колонка внутри блока left */
.left-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* заголовок + бейджи "Канал / RU" */
.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.left-main h2 {
  margin: 0;
  font-size: 20px;
}

/* ник */
.tg-link {
  margin-top: 4px;
  color: #1DDD9D;
  font-size: 14px;
}

.tg-link a {
  color: #1DDD9D;
  text-decoration: none;
}

.tg-link a:hover {
  text-decoration: underline;
}


/* описание и ограничения */
.description {
  margin-top: 20px;
  background: #f9fafb;
  padding: 16px;
  border-radius: 12px;
  font-size: 14px;
  color: #374151;
}

.restrictions {
  margin-top: 16px;
  background: #fee2e2;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  font-size: 13px;
  color: #b91c1c;
}

/* правая часть */

.right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* статистика */

.stats-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .06);
  overflow: hidden;
}

/* общий стиль строк */
.stats-card .row {
  display: grid;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}

/* верхний ряд — 2 колонки (подписчики + пол на две ячейки) */
.stats-card .row.top {
  grid-template-columns: 1fr 2fr;
}

/* нижний ряд — 3 равные ячейки */
.stats-card .row.bottom {
  grid-template-columns: repeat(3, 1fr);
}

/* базовая отрисовка ячеек */
.stats-card .row.top .cell,
.stats-card .row.bottom .cell {
  padding: 16px 12px;
  border-bottom: 1px solid #f1f3f8;
}

/* вертикальные разделители */
.stats-card .row.top .cell:not(:last-child),
.stats-card .row.bottom .cell:not(:last-child) {
  border-right: 1px solid #f1f3f8;
}

/* граница над нижним рядом */
.stats-card .row.bottom {
  border-top: 1px solid #f1f3f8;
}

/* отдельное центрирование процентов */
.stats-card .cell.gender {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* подписи и значения */
.stats-card .label {
  font-size: 14px;																/* ------------------------- */
  color: #9ca3af;
}

.stats-card .value {
  margin-top: 4px;
  font-size: 14px;																/* ------------------------- */
  font-weight: 600;
  color: #6b7280;
}

.stats-card .value.dual {
  font-size: 14px;																/* ------------------------- */
  font-weight: 700;
}

.stats-card .blue {
  color: #0ea5e9;
}

.stats-card .pink {
  color: #ec4899;
}

.stats-card .gray {
  color: #9ca3af;
}

/* размещение рекламы */

.action-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

/* верхний ряд: подписи + селекты */
.action-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.action-card .field-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.action-card .field-control select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  font-size: 16px;
  background-color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
  outline: none;
}

/* нижний ряд: цена + сердце + кнопка */
.action-bottom {
  display: grid;
  /* фиксированная третья колонка под кнопку */
  grid-template-columns: auto 52px 160px;
  align-items: center;
  gap: 12px;
}

.price {
  display: flex;
  align-items: baseline;
}

.price-main {
  font-size: 26px;
  font-weight: 700;
}

.price-currency {
  margin-left: 2px;
  font-size: 20px;
  font-weight: 700;
}

/* избранное (сердце) */

.fav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  position: relative;
  padding: 0;
}

/* две иконки – одна поверх другой */
.heart-icon {
  width: 18px;
  height: 18px;

  background-color: #E11D48; /* цвет сердца */

  -webkit-mask-size: contain;
  mask-size: contain;

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  position: absolute;
  inset: 0;
  margin: auto;
  display: block;

  transition: opacity .2s ease;
}

/* контур */
.heart-outline {
  -webkit-mask-image: url("/static/img/heart.svg");
  mask-image: url("/static/img/heart.svg");
  opacity: 1;
}

/* закрашенное */
.heart-filled {
  -webkit-mask-image: url("/static/img/heart-filled.svg");
  mask-image: url("/static/img/heart-filled.svg");
  opacity: 0;
}

/* когда отмечено — показываем заполненное сердце */
.fav-btn.active .heart-outline { opacity: 0; }
.fav-btn.active .heart-filled  { opacity: 1; }

/* обёртка под кнопку (3-я колонка) */
.btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* кнопка — общие стили */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;

  /* занимает всю ширину своей колонки (260px), ширина не прыгает */
  width: 100%;
}

/* акцентная кнопка */
.btn-accent {
  background: linear-gradient(90deg,#1DDD9D,#34d399);
  border-color: #1DDD9D;
  color: #fff;
}

/* контейнер для иконок cart/done */
.btn-ico-wrap {
  position: relative;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-block;
}

/* две иконки поверх друг друга */
.btn-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity .2s ease, filter .2s ease;
  filter: brightness(0) invert(1);
}

.cart-icon { opacity: 1; }
.done-icon { opacity: 0; }

.js-cart-btn.is-in-cart .cart-icon { opacity: 0; }
.js-cart-btn.is-in-cart .done-icon { opacity: 1; }

/* текст */
.btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* рейтинг под кнопкой */
.rating-row {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.rating-text {
  white-space: nowrap;
}

/* --- аналитика ресурса: графики + лента --- */

.resource-analytics {
  margin-top: 32px;
}

/* сетка 2×2 для четырёх графиков */
.ra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.ra-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .04);
  padding: 18px 20px;
}

.ra-title {
  margin: 0 0 12px;
  font-size: 14px; 														/* ------------------------- */
  font-weight: 600;
}

/* область под график */
.ra-chart {
  height: 200px;
  border-radius: 16px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* сами SVG-графики */
.ra-chart svg,
.ra-line {
  width: 100%;
  height: 100%;
}

/* жёлтый кружок W (если нужен плейсхолдер) */
.ra-chart-placeholder {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #f59e0b;
  font-size: 18px;
}

/* лента постов */

.ra-feed-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
}

.ra-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.ra-post-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .05);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* шапка поста */

.ra-post-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ra-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.ra-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ra-post-meta {
  display: flex;
  flex-direction: column;
}

.ra-post-name {
  font-size: 14px;
  font-weight: 600;
}

.ra-post-label {
  font-size: 11px;
  color: var(--muted);
}

/* текст поста */

.ra-post-body p {
  margin: 0;
  font-size: 13px;
  color: #374151;
}

/* футер поста */

.ra-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.ra-post-more {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #1DDD9D;
  color: #1DDD9D;
  text-decoration: none;
  white-space: nowrap;
}

.ra-post-more--disabled {
  opacity: 0.6;
  border-style: dashed;
}

.ra-post-submeta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.ra-feed-empty {
  font-size: 14px;
  color: var(--muted);
}

/* медиа-блок в карточке поста: фиксированная высота, чтобы сетка не прыгала */
.ra-post-media {
  margin-top: 10px;
  border-radius: 14px;
  background: #f3f4f6;
  height: 120px;
  position: relative;
  overflow: hidden;
}

/* есть медиа/ссылка на пост */
.ra-post-media--has {
  background: #eef2ff;
  cursor: pointer;
}

/* нет медиа – просто бледный плейсхолдер */
.ra-post-media--empty {
  opacity: 0.6;
}

/* кликабельная область внутри */
.ra-post-media a {
  position: absolute;
  inset: 0;
  display: block;
}

/* адаптив */

@media (max-width: 992px) {
  .ra-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .resource-card {
    grid-template-columns: 1fr;
  }

  .left-layout {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  /* в мобилке можно дать кнопке тянуться по ширине */
  .action-bottom {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .btns {
    justify-content: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* убрать подчёркивание у текста в кнопке */
.btn,
.btn:link,
.btn:visited,
.btn:hover,
.btn:active {
  text-decoration: none;
}

.btn .btn-text {
  text-decoration: none;
}







/* чтобы контент не перекрывался плашкой */
.layout {
  padding-bottom: 96px;
}

/* Плашка предпросмотра корзины */
.cart-preview-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;

  width: 100%;
  max-width: 1200px;
  padding: 14px 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  z-index: 50;
}

/* Левая часть */
.cart-preview-main {
  display: flex;
  align-items: center;
}

/* Блоки со статистикой */
.cart-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.cart-stat {
  font-size: 14px;
}

/* вертикальные разделители между блоками */
.cart-stat + .cart-stat {
  padding-left: 24px;
  border-left: 1px solid #eef1f5;
}

.cart-label {
  display: block;
  margin-bottom: 2px;
  color: #9ca3af;
}

.cart-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: #111827;
}

.cart-currency {
  opacity: 0.8;
}

/* Правая часть с кнопками */
.cart-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Универсальная кнопка для плашки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

/* PRIMARY (зелёная, как на сайте) */
.btn-primary {
  background: #23da9b;
  border-color: #23da9b;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1bc18a;
  border-color: #1bc18a;
}

/* GHOST (очистить, красный контур) */
.btn-ghost {
  background: #ffffff;
  border-color: #fecaca;
  color: #ef4444;
}

.btn-ghost:hover {
  background: #fef2f2;
}

/* Нехватка средств */
.cart-shortfall {
  color: #dc2626;
}

.cart-shortfall.is-hidden {
  display: none;
}

.cart-value-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Красный кружок с восклицательным знаком */
.cart-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;

  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid #dc2626;
}

/* Скрытие плашки целиком */
.cart-preview-bar.is-hidden {
  display: none;
}

/* Адаптив */
@media (max-width: 768px) {
  .cart-preview-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
    max-width: calc(100% - 24px);
  }

  .cart-preview-main {
    width: 100%;
  }

  .cart-actions {
    width: 100%;
    justify-content: space-between;
  }

  .cart-actions .btn {
    flex: 1 1 auto;
  }

  .cart-stat + .cart-stat {
    border-left: none;
    padding-left: 0;
  }
}

