/* ============================================
   SHARED SAUNA — 2026 REDESIGN
   Variable Fonts · Dark Mode · Frosted Glass
   Bento Grid · Soft Shadows · Pill Style
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Light theme */
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: rgba(15, 30, 60, 0.03);
  --text-primary: #0f1e3c;
  --text-secondary: #4a5568;
  --text-muted: #8896a8;
  --border: rgba(15, 30, 60, 0.06);
  --border-strong: rgba(15, 30, 60, 0.12);

  /* Brand */
  --accent: #1a3a6b;
  --accent-soft: rgba(26, 58, 107, 0.08);
  --accent-hover: #245294;
  --gold: #c9a870;
  --warm: #3b6cb5;

  /* Medals */
  --medal-gold: #FFD700;
  --medal-silver: #C0C0C0;
  --medal-bronze: #CD7F32;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(15,30,60,0.05), 0 0 0 1px var(--border);
  --shadow-md: 0 4px 16px rgba(15,30,60,0.07), 0 0 0 1px var(--border);
  --shadow-lg: 0 8px 32px rgba(15,30,60,0.09), 0 0 0 1px var(--border);
  --shadow-xl: 0 16px 48px rgba(15,30,60,0.12);

  /* Radii — pill style */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 32px;
  --radius-pill: 100px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;
  --duration-slow: 0.5s;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: 20px;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg: #0c0f14;
  --bg-card: #181c24;
  --bg-elevated: #22272f;
  --bg-subtle: rgba(255, 255, 255, 0.05);
  --text-primary: #eaecf0;
  --text-secondary: #9ba3b0;
  --text-muted: #5c6370;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --accent-soft: rgba(59, 108, 181, 0.18);
  --glass-bg: rgba(24, 28, 36, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35), 0 0 0 1px var(--border);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px var(--border);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.5);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  transition: background var(--duration-normal) ease,
              color var(--duration-normal) ease;
}

main { flex: 1; min-height: 80vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============================================
   FROSTED GLASS HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 2rem;
  transition: background var(--duration-normal) ease,
              border-color var(--duration-normal) ease;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  cursor: pointer;
  transition: opacity var(--duration-fast) ease;
  text-decoration: none;
  display: block;
}
.logo-section:hover { opacity: 0.8; color: inherit; }

.logo-section h1,
.logo-section .site-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.logo-section .tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Nav */
.nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  transition: all var(--duration-fast) ease;
  font-family: var(--font-body);
  position: relative;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-btn:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--accent);
  color: white;
}

.nav-btn::after { display: none; }

/* Theme toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) ease;
  margin-left: 0.5rem;
  padding: 0;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: rotate(15deg);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ============================================
   RATING SIDEBAR (главная — ТОП-5)
   ============================================ */
.rating-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rating-sidebar-header {
  padding: 1rem 1rem 0.7rem;
  flex-shrink: 0;
}

.rating-sidebar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  text-align: center;
}

.rating-sidebar .main-filter-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.main-filter-row {
  display: flex;
  gap: 0.3rem;
}

.main-filter-row .cat-filter {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  padding: 0.4rem 0.25rem;
  white-space: nowrap;
}

.rating-sidebar .cat-filter {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  padding: 0.4rem 0.25rem;
}

.rating-sidebar-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem 0.5rem;
}

/* --- Карточки ТОП-5 --- */
.top-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.6rem;
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  flex: 1;
}

.top-item:hover {
  background: var(--bg-subtle);
  transform: translateX(3px);
}

.top-item.selected {
  background: var(--accent-soft);
}

.top-item-left {
  flex-shrink: 0;
  width: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-medal {
  font-size: 1.3rem;
  line-height: 1;
}

.top-rank-num {
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-pill);
}

.top-item-center {
  flex: 1;
  min-width: 0;
}

.top-item-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.top-item-addr {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}

.top-item-mini-ratings {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0.3rem;
}

.top-mini-rating {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--accent-soft);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.top-item-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.top-item-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

.top-item-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.top-item-score {
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
}

.top-item-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ============================================
   MAP PAGE
   ============================================ */
.map-container {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  min-height: 600px;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 600px;
}

.map-container, .map-container > *,
#map, #map > * {
  width: 100% !important;
  height: 100% !important;
}

/* ============================================
   LIST PAGE — BENTO GRID
   ============================================ */

/* --- Card --- */
.bathhouse-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
  position: relative;
}

.bathhouse-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Image area */
.card-image {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.card-image-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.7s var(--ease-out);
}

.bathhouse-card:hover .card-image-bg {
  transform: scale(1.05);
}

.card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 18, 16, 0.6) 0%, transparent 50%);
  pointer-events: none;
}

/* Glassmorphism badge */
.card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 2;
}

.card-badge-star { color: var(--medal-gold); font-size: 0.8rem; }

/* Знак "Рекомендуем" на карточке */
.card-recommended-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #b8860b, #f0c040, #c9a227);
  color: #1a0e00;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px 4px 8px;
  border-radius: 100px;
  box-shadow: 0 2px 10px rgba(201,162,39,0.55), inset 0 1px 0 rgba(255,255,255,0.3);
  z-index: 3;
}

/* Знак "Рекомендуем" в детальной карточке */
.detail-hero-recommended {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #b8860b, #f0c040, #c9a227);
  color: #1a0e00;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 14px 5px 10px;
  border-radius: 100px;
  margin-bottom: 0.6rem;
  box-shadow: 0 3px 14px rgba(201,162,39,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* Tags */
.card-tags {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  z-index: 2;
}

.card-tag {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.2px;
}

/* Card body */
.card-body {
  padding: 1.2rem 1.3rem 0.5rem;
  overflow: hidden;
}

.bathhouse-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.25;
}

.bathhouse-card .card-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-review-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.bathhouse-card .card-description {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mini-ratings */
.card-mini-ratings {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.mini-rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-primary);
  background: var(--accent-soft);
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.mini-rating-icon { font-size: 0.75rem; }
.mini-rating-val { font-weight: 700; color: var(--accent); }

/* Card footer */
.card-footer {
  padding: 0.5rem 1.3rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warm);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap var(--duration-fast) ease;
}

.bathhouse-card:hover .card-cta { gap: 0.5rem; }

.card-cta svg {
  width: 14px; height: 14px;
  transition: transform var(--duration-fast) ease;
}
.bathhouse-card:hover .card-cta svg { transform: translateX(3px); }

/* Fav button */
.card-fav {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) ease;
  color: var(--text-muted);
  padding: 0;
}

.card-fav:hover {
  background: var(--accent-soft);
  border-color: var(--warm);
  color: var(--warm);
}

.card-fav.active {
  background: var(--warm);
  border-color: var(--warm);
  color: white;
}

/* Hero card — bento leader */
.bathhouse-card.card-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: 1fr auto;
  border-radius: var(--radius-xl);
}

.bathhouse-card.card-hero .card-image {
  height: 100%;
  min-height: 320px;
  grid-row: 1 / -1;
}

.bathhouse-card.card-hero .card-body {
  padding: 2rem 2rem 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
}

.bathhouse-card.card-hero h3 {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
}

.bathhouse-card.card-hero .card-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.bathhouse-card.card-hero .card-footer {
  padding: 0.5rem 2rem 1.5rem;
  margin-top: 0;
  grid-column: 2;
  grid-row: 2;
}

/* Old styles hidden */
.card-rating, .card-rating-score, .card-rating-label { display: none; }

/* ============================================
   SEARCH TOOLBAR (unified block)
   ============================================ */
.search-toolbar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  transition: background var(--duration-normal) ease;
}

.search-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-toolbar-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-subtle);
  transition: all var(--duration-fast) ease;
  outline: none;
}

.search-toolbar-input::placeholder {
  color: var(--text-muted);
}

.search-toolbar-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-card);
}

.search-toolbar-cats {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.search-toolbar-desc {
  margin-top: 0.7rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  transition: opacity 0.15s ease;
}

/* ============================================
   CATEGORY FILTER PILLS
   ============================================ */
.cat-filter {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  white-space: nowrap;
}

.cat-filter:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-soft);
}

.cat-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============================================
   LIST HEADER (counter + sort label)
   ============================================ */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.list-header-sort {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.78rem;
  transition: all var(--duration-fast) ease;
}

/* ============================================
   LIST REORDER ANIMATION
   ============================================ */
.list-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  transition: opacity 0.15s ease;
}

.list-page.list-reorder {
  opacity: 0;
  transform: translateY(6px);
}

/* ============================================
   CAROUSEL — другие бани
   ============================================ */
.carousel-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.carousel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.carousel-btn:hover:not(.disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.carousel-btn.disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-dots {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 2.5rem;
  text-align: center;
}

/* Grid карточек в карусели — стандартные bathhouse-card */
.carousel-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.carousel-cards-grid .bathhouse-card {
  animation: fadeInUp 0.35s ease-out both;
}

/* Бейдж с номером позиции */
.card-rank-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  z-index: 2;
}

/* Responsive carousel */
@media (max-width: 1024px) {
  .carousel-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .carousel-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   DETAIL PAGE
   ============================================ */
.detail-page {
  max-width: 960px;
  margin: 0 auto;
}

.detail-hero {
  position: relative;
  height: 340px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.detail-hero-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,18,16,0.8) 0%, rgba(20,18,16,0.15) 50%, transparent 100%);
}

.detail-hero-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 2.5rem;
  z-index: 2;
}

.detail-hero-back {
  position: absolute;
  top: 1rem; left: 1rem;
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) ease;
  z-index: 3;
}

.detail-hero-back:hover {
  background: rgba(255,255,255,0.22);
  transform: translateX(-2px);
}

.detail-hero-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 3;
}

.detail-hero-badge-score {
  color: white;
  font-weight: 800;
  font-size: 1.4rem;
  font-family: var(--font-display);
}

.detail-hero-badge-label {
  color: rgba(255,255,255,0.7);
  font-size: 0.7rem;
  font-weight: 500;
}

.detail-hero-badge-star { color: var(--medal-gold); font-size: 0.95rem; }

.detail-hero-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.35rem;
  line-height: 1.15;
}

.detail-hero-address {
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Detail sections */
.detail-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: background var(--duration-normal) ease;
}

.detail-section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.detail-section-title-icon { font-size: 1.1rem; }

.detail-description {
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: 0.95rem;
}

/* Radar chart & ratings */
.detail-radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.detail-ratings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.detail-rating-item {
  padding: 1rem 1.1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  transition: transform var(--duration-fast) ease;
}

.detail-rating-item:hover { transform: translateY(-2px); }

.detail-rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.detail-rating-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.detail-rating-name-icon { font-size: 0.95rem; }

.detail-rating-value {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
  font-family: var(--font-display);
}

.detail-rating-bar {
  height: 5px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.detail-rating-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.8s var(--ease-out);
}

.detail-rating-fill.high { background: linear-gradient(90deg, #4caf50, #66bb6a); }
.detail-rating-fill.mid { background: linear-gradient(90deg, #ff9800, #ffb74d); }
.detail-rating-fill.low { background: linear-gradient(90deg, #ef5350, #e57373); }

/* Overall score */
.detail-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.detail-overall-circle {
  width: 110px; height: 110px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.detail-overall-score {
  font-size: 2.6rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: white;
  line-height: 1;
}

.detail-overall-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.detail-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding-top: 1.2rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.detail-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Old detail components compat */
.bathhouse-detail {
  width: 450px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}

.bathhouse-detail h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.bathhouse-detail .address { color: var(--accent); font-size: 0.9rem; margin-bottom: 1.2rem; }
.bathhouse-detail .description { line-height: 1.8; margin-bottom: 1.5rem; color: var(--text-secondary); }

.ratings-section h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
}

.rating-item { margin-bottom: 1rem; }

.rating-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.rating-score { color: var(--accent); font-weight: 600; }

.rating-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.rating-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

.overall-rating {
  background: linear-gradient(135deg, #0b1528, var(--accent));
  color: white;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 1.2rem;
}

.overall-rating .score {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.overall-rating .label { font-size: 0.85rem; opacity: 0.85; margin-top: 0.2rem; }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

/* ============================================
   ANIMATIONS & SKELETONS
   ============================================ */

/* Page transitions */
.page-enter {
  animation: pageIn 0.4s var(--ease-out) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Skeleton loading */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--border) 25%,
    rgba(255,255,255,0.4) 37%,
    var(--border) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  height: 360px;
  border-radius: var(--radius-lg);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-text.short { width: 50%; }

/* Stagger animation for cards */
.bathhouse-card {
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.bathhouse-card:nth-child(1) { animation-delay: 0s; }
.bathhouse-card:nth-child(2) { animation-delay: 0.06s; }
.bathhouse-card:nth-child(3) { animation-delay: 0.12s; }
.bathhouse-card:nth-child(4) { animation-delay: 0.18s; }
.bathhouse-card:nth-child(5) { animation-delay: 0.24s; }
.bathhouse-card:nth-child(6) { animation-delay: 0.3s; }
.bathhouse-card:nth-child(7) { animation-delay: 0.36s; }
.bathhouse-card:nth-child(8) { animation-delay: 0.42s; }
.bathhouse-card:nth-child(9) { animation-delay: 0.48s; }
.bathhouse-card:nth-child(10) { animation-delay: 0.54s; }

/* Medal animations — subtle */
.top-bathhouse-card { position: relative; }

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255,215,0,0.15); }
  50% { box-shadow: 0 6px 28px rgba(255,215,0,0.22); }
}

@keyframes silverPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(192,192,192,0.15); }
  50% { box-shadow: 0 6px 28px rgba(192,192,192,0.22); }
}

@keyframes bronzePulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(205,127,50,0.15); }
  50% { box-shadow: 0 6px 28px rgba(205,127,50,0.22); }
}

.top-bathhouse-card.top-1 { animation: goldPulse 4s ease-in-out infinite; }
.top-bathhouse-card.top-2 { animation: silverPulse 5s ease-in-out infinite; }
.top-bathhouse-card.top-3 { animation: bronzePulse 6s ease-in-out infinite; }

/* Map loading */
.map-container.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s infinite;
  z-index: 10;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  color: var(--text-primary);
  margin-top: 3rem;
  padding: 2.5rem 0 0.8rem;
  transition: background var(--duration-normal) ease;
  /* Предотвращаем CLS — футер не должен прыгать */
  contain: layout;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.footer-section p {
  line-height: 1.7;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: 0.6rem; }

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color var(--duration-fast) ease;
}

.footer-links a:hover { color: var(--accent); }

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  transition: all var(--duration-fast) ease;
}

.social-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.2rem 2rem;
  text-align: center;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-bottom p {
  margin: 0.2rem 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-made { font-size: 0.8rem; }

/* ============================================
   RESPONSIVE — Mobile First
   ============================================ */
@media (max-width: 1024px) {
  .map-container {
    height: 500px !important;
    min-height: 500px !important;
  }
  .bathhouse-detail { width: 100%; }
}

@media (max-width: 768px) {
  .header { padding: 0.8rem 1rem; }

  .logo-section h1 { font-size: 1.25rem; }
  .logo-section .tagline { font-size: 0.6rem; letter-spacing: 1.5px; }

  .nav { gap: 0.25rem; }
  .nav-btn {
    font-size: 0.78rem;
    padding: 0.45rem 0.7rem;
  }
  .theme-toggle { width: 34px; height: 34px; }

  main { padding: 1rem !important; }

  /* Single column cards */
  .list-page {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Hero card stacks vertically */
  .bathhouse-card.card-hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .bathhouse-card.card-hero .card-image {
    min-height: 200px;
    height: 200px;
    grid-row: 1;
    grid-column: 1;
  }
  .bathhouse-card.card-hero .card-body {
    grid-row: 2;
    grid-column: 1;
  }
  .bathhouse-card.card-hero .card-footer {
    grid-row: 3;
    grid-column: 1;
    padding: 0.5rem 1.3rem 1.1rem;
  }

  /* Detail page */
  .detail-hero { height: 240px; }
  .detail-hero-title { font-size: 1.8rem; }
  .detail-ratings-grid { grid-template-columns: 1fr; }
  .detail-section { padding: 1.3rem; border-radius: var(--radius-md); }

  /* Main page grid */
  main > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: auto !important;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .footer-social { justify-content: center; }
}

@media (max-width: 480px) {
  .nav-btn { font-size: 0.72rem; padding: 0.4rem 0.55rem; }
  .card-image { height: 170px; }
  .bathhouse-card h3 { font-size: 1.15rem; }
  .detail-hero { height: 200px; }
  .detail-hero-title { font-size: 1.5rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================
   DETAIL PAGE — RATINGS BARS
   ============================================ */
.detail-ratings-visual {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.detail-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.detail-bar-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-bar-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.detail-bar-max {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.detail-bar-track {
  height: 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border);
}

.detail-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s var(--ease-out);
}

.detail-bar-fill.bar-high { background: #2e7d32; }
.detail-bar-fill.bar-mid  { background: #f57c00; }
.detail-bar-fill.bar-low  { background: #c62828; }

.detail-overall-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-overall-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

/* ============================================
   MOBILE UX IMPROVEMENTS
   ============================================ */

/* --- Навигация на мобильном --- */
@media (max-width: 600px) {
  .header-content {
    gap: 0.5rem;
  }

  /* Логотип компактнее */
  .site-title {
    font-size: 1.1rem !important;
  }
  .tagline {
    display: none; /* скрываем подзаголовок на маленьких экранах */
  }

  /* Навигация — иконки вместо текста на очень маленьких */
  .nav {
    gap: 0.2rem;
  }
  .nav-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
}

/* --- Главная страница на мобильном --- */
@media (max-width: 768px) {
  /* Скрываем карту — она грузит тяжёлый Яндекс.Карты скрипт */
  .map-container {
    display: none !important;
  }

  /* Рейтинг занимает всю ширину */
  .rating-sidebar {
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
  }

  /* Фильтры главной страницы — переносятся в 3 колонки */
  .main-filter-tabs {
    gap: 0.4rem;
  }
  .main-filter-row {
    gap: 0.4rem;
  }
  .main-filter-row .cat-filter {
    flex: 1;
    font-size: 0.78rem;
    padding: 0.4rem 0.5rem;
    text-align: center;
  }

  /* Hero-блок на мобильном */
  #ssr-hero h1,
  .detail-page h1 {
    font-size: 1.6rem !important;
  }
}

/* Фильтры категорий — всегда горизонтальный скролл без переноса */
.search-toolbar-cats {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.search-toolbar-cats::-webkit-scrollbar { display: none; }
.search-toolbar-cats .cat-filter {
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Карточки бань на мобильном --- */
@media (max-width: 600px) {
  /* Hero-карточка */
  .bathhouse-card.card-hero {
    grid-template-columns: 1fr !important;
  }
  .bathhouse-card.card-hero .card-image {
    height: 220px;
  }

  /* Мини-рейтинги компактнее */
  .card-mini-ratings {
    gap: 0.3rem;
  }
  .mini-rating {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }

  /* Адрес карточки — обрезаем длинные */
  .card-address {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* --- Страница бани на мобильном --- */
@media (max-width: 768px) {
  /* Radar + оценки → вертикально */
  .detail-section > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Плюсы и минусы → вертикально */
  .detail-section > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .detail-radar-wrap {
    display: flex;
    justify-content: center;
  }

  /* Кнопка назад — крупнее */
  .detail-hero-back {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }

  /* Мета блок */
  .detail-meta {
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
  }
}

/* --- SSR-страница бани --- */
@media (max-width: 768px) {
  #ssr-content {
    font-size: 0.95rem;
    line-height: 1.7;
  }
  #ssr-content h1 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
  }
  #ssr-content h2 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
  }
  #ssr-content ul {
    flex-direction: column !important;
    gap: 0.3rem !important;
  }
}

/* --- Карусель на мобильном --- */
@media (max-width: 600px) {
  .carousel-header {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }
  .carousel-cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- Футер на мобильном --- */
@media (max-width: 600px) {
  .footer {
    padding: 1.5rem 1rem 1rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
  }
}

/* --- Топ-5 на мобильном --- */
@media (max-width: 600px) {
  .top-item {
    padding: 0.8rem 0.6rem;
    gap: 0.6rem;
  }
  .top-item-name {
    font-size: 0.9rem;
  }
  .top-item-score {
    min-width: 44px;
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
  }
  .top-mini-rating {
    font-size: 0.72rem;
    padding: 0.15rem 0.35rem;
  }
}

/* ── Неоценённые бани ─────────────────────────────────────────────────────── */
.bathhouse-card--unrated {
    opacity: 0.8;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.bathhouse-card--unrated:hover {
    opacity: 1;
    transform: translateY(-3px);
}
.list-page--unrated {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 0;
}
