/* I Kindred Spirit — избранное: кнопка-сердце и страница избранного */

/* ---------- Кнопка «сердце» на карточках активностей ---------- */
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.fav-btn:hover {
  transform: scale(1.08);
  color: #e60023;
}
.fav-btn:focus-visible {
  outline: 2px solid #e60023;
  outline-offset: 2px;
}
.fav-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill .18s ease, stroke .18s ease;
}
.fav-btn.active {
  color: #e60023;
}
.fav-btn.active svg {
  fill: #e60023;
  stroke: #e60023;
  animation: fav-pop .28s ease;
}
.fav-btn[disabled] {
  opacity: .6;
  cursor: default;
}
@keyframes fav-pop {
  0% { transform: scale(.7); }
  55% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

[data-theme="dark"] .fav-btn,
html[data-theme="dark"] .fav-btn {
  background: transparent;
  color: #cbd5e1;
}
[data-theme="dark"] .fav-btn:hover,
[data-theme="dark"] .fav-btn.active,
html[data-theme="dark"] .fav-btn:hover,
html[data-theme="dark"] .fav-btn.active {
  color: #ff3b5c;
}
[data-theme="dark"] .fav-btn.active svg,
html[data-theme="dark"] .fav-btn.active svg {
  fill: #ff3b5c;
  stroke: #ff3b5c;
}

/* Контейнеры карточек должны быть позиционированы для кнопки */
.home-activity-card,
.featured-activity-card,
.activity-card,
.card {
  position: relative;
}

/* На карточках активностей сердце занимает правый верхний угол,
   поэтому бейдж «Закрытая» переносим влево. */
.activity-card .private-badge {
  right: auto;
  left: 12px;
}
@media (max-width: 620px) {
  .activity-card .private-badge {
    right: auto;
    left: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fav-btn,
  .fav-btn svg { transition: none; }
  .fav-btn.active svg { animation: none; }
}

/* ---------- Страница избранного ---------- */
.fav-page {
  width: min(100% - 32px, 1180px);
  margin: 26px auto 120px;
}
.fav-page *,
.fav-page *::before,
.fav-page *::after { box-sizing: border-box; }

.fav-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--fav-border, #e5e7eb);
  background: color-mix(in srgb, var(--fav-bg, #fff) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.fav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 800;
  color: var(--fav-text, #0f172a);
  text-decoration: none;
  letter-spacing: -.02em;
}
.fav-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #e60023, #ff5a76);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 6px 18px rgba(230, 0, 35, .28);
}
.fav-brand span { white-space: nowrap; }
.fav-header-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--fav-border, #e5e7eb);
  border-radius: 999px;
  background: var(--fav-surface, #fff);
  color: var(--fav-muted, #475569);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.fav-header-link:hover {
  border-color: #e60023;
  color: #e60023;
}

.fav-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 26px 0 18px;
}
.fav-hero h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
  letter-spacing: -.035em;
  color: var(--fav-text, #0f172a);
}
.fav-hero p {
  margin: 8px 0 0;
  color: var(--fav-muted, #64748b);
  font-size: 14px;
}
.fav-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(230, 0, 35, .08);
  color: #e60023;
  font-size: 13px;
  font-weight: 700;
}
.fav-count svg { width: 16px; height: 16px; fill: currentColor; }

/* Полоса тегов — в духе поиска Ozon */
.fav-tags-wrap {
  position: sticky;
  top: 59px;
  z-index: 30;
  margin: 0 -4px 20px;
  padding: 10px 4px;
  background: color-mix(in srgb, var(--fav-bg, #fff) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.fav-tags {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}
.fav-tags::-webkit-scrollbar { display: none; }
.fav-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--fav-border, #e5e7eb);
  border-radius: 10px;
  background: var(--fav-surface, #f8fafc);
  color: var(--fav-text, #0f172a);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s, transform .18s;
}
.fav-chip:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}
.fav-chip.active {
  border-color: #005bff;
  background: #005bff;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 91, 255, .22);
}
.fav-chip-icon {
  font-size: 15px;
  line-height: 1;
}
.fav-chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .07);
  color: var(--fav-muted, #475569);
  font-size: 11px;
  font-weight: 700;
}
.fav-chip.active .fav-chip-count {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.fav-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--fav-border, #e5e7eb);
  border-radius: 18px;
  background: var(--fav-surface, #fff);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .05);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  animation: fav-card-in .28s ease both;
}
.fav-card:hover {
  transform: translateY(-3px);
  border-color: rgba(230, 0, 35, .35);
  box-shadow: 0 16px 32px rgba(15, 23, 42, .1);
}
@keyframes fav-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.fav-card-img,
.fav-card-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 168px;
  object-fit: cover;
  background: linear-gradient(135deg, #eef2ff, #fce7f3);
  font-size: 46px;
}
.fav-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 14px 15px 16px;
}
.fav-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 91, 255, .08);
  color: #005bff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-card-body h2 {
  margin: 0;
  color: var(--fav-text, #0f172a);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fav-card-desc {
  margin: 0;
  color: var(--fav-muted, #64748b);
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fav-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--fav-border, #eef2f7);
  color: var(--fav-muted, #64748b);
  font-size: 11.5px;
  font-weight: 600;
}
.fav-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fav-card-price {
  color: #059669;
}
.fav-card-price.paid { color: #d97706; }

.fav-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 20px 72px;
  border: 1px dashed var(--fav-border, #cbd5e1);
  border-radius: 22px;
  background: var(--fav-surface, #fff);
  text-align: center;
}
.fav-empty[hidden] { display: none; }
.fav-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(230, 0, 35, .09);
  color: #e60023;
  font-size: 28px;
}
.fav-empty h2 {
  margin: 0;
  color: var(--fav-text, #0f172a);
  font-size: 19px;
}
.fav-empty p {
  max-width: 360px;
  margin: 0;
  color: var(--fav-muted, #64748b);
  font-size: 13.5px;
  line-height: 1.5;
}
.fav-empty-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 11px 20px;
  border-radius: 999px;
  background: #e60023;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
}
.fav-empty-link:hover { background: #ad081b; }

@media (max-width: 700px) {
  .fav-page { width: min(100% - 24px, 1180px); margin-top: 18px; }
  .fav-header { padding: 10px 14px; }
  .fav-header-link { padding: 8px 12px; font-size: 12px; }
  .fav-hero { align-items: flex-start; margin-top: 20px; }
  .fav-hero p { font-size: 13px; }
  .fav-count { display: none; }
  .fav-tags-wrap { top: 55px; margin-bottom: 16px; }
  .fav-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .fav-card-img, .fav-card-ph { height: 132px; font-size: 38px; }
  .fav-card-body { padding: 12px; gap: 6px; }
  .fav-card-body h2 { font-size: 14px; }
  .fav-card-desc { display: none; }
  .fav-card-meta { font-size: 11px; }
  .fav-btn { top: 8px; right: 8px; width: 34px; height: 34px; }
  .fav-btn svg { width: 18px; height: 18px; }
}
