* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: #F0F4F8;
  color: #1A202C;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
  background: linear-gradient(135deg, #1565C0 0%, #1E88E5 100%);
  color: white;
  padding: 14px 0;
  box-shadow: 0 2px 8px rgba(21,101,192,0.3);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-paw {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.logo-text { letter-spacing: -0.5px; }
.tagline {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
  margin-left: 42px;
  letter-spacing: 0.2px;
}

/* Banner TOP */
.banner-top { background: #fff; border-bottom: 1px solid #E2E8F0; padding: 10px 0; }
.ad-leaderboard {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  background: #F7FAFC;
  border: 1px dashed #CBD5E0;
  border-radius: 8px;
  gap: 12px;
  padding: 10px 20px;
}

/* Dashboard */
.dashboard {
  background: #F0F4F8;
  padding: 20px 0 24px;
  border-bottom: 1px solid #E2E8F0;
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .dash-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }

.dash-card {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.dash-num { font-size: 28px; font-weight: 800; line-height: 1; color: #fff; }
.dash-label { font-size: 11px; margin-top: 6px; font-weight: 600; color: rgba(255,255,255,0.85); }

.dash-blue   { background: linear-gradient(135deg, #1E88E5, #1565C0); border-color: #1565C0; }
.dash-teal   { background: linear-gradient(135deg, #00BCD4, #0097A7); border-color: #0097A7; }
.dash-indigo { background: linear-gradient(135deg, #7C4DFF, #512DA8); border-color: #512DA8; }
.dash-green  { background: linear-gradient(135deg, #43A047, #2E7D32); border-color: #2E7D32; }
.dash-amber  { background: linear-gradient(135deg, #FFB300, #F57F17); border-color: #F57F17; }
.dash-orange { background: linear-gradient(135deg, #F4511E, #BF360C); border-color: #BF360C; }

/* Search */
.search-section {
  background: white;
  border-bottom: 1px solid #E2E8F0;
  padding: 14px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.search-box input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
  color: #1A202C;
}
.search-box input:focus { border-color: #1E88E5; }
.search-box select {
  padding: 10px 14px;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  background: white;
  cursor: pointer;
  min-width: 160px;
  flex-shrink: 0;
  color: #1A202C;
}

.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #fff;
  border: 2px solid #CBD5E0;
  border-radius: 24px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #2D3748;
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chip:hover { border-color: #1E88E5; background: #EBF4FF; color: #1565C0; box-shadow: 0 2px 6px rgba(21,101,192,0.15); }
.chip input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; accent-color: #1565C0; }
.chip:has(input:checked) {
  border-color: #1565C0;
  background: #1565C0;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(21,101,192,0.35);
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-label { font-size: 13px; color: #718096; }
.sort-row select {
  padding: 5px 10px;
  border: 1px solid #CBD5E0;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: white;
  cursor: pointer;
  color: #1A202C;
}

/* Main layout */
.main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding-top: 20px;
  padding-bottom: 40px;
}
.main-content { flex: 1; min-width: 0; }

/* Sidebar */
.sidebar { width: 300px; flex-shrink: 0; }
.sticky-ad { position: sticky; top: 100px; }
.ad-sidebar {
  background: white;
  border: 1px dashed #CBD5E0;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.ad-sidebar-inner {
  min-height: 400px;
  background: #F7FAFC;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ad-placeholder-text { font-size: 24px; font-weight: 700; color: #CBD5E0; }
.ad-small-text { font-size: 12px; color: #A0AEC0; line-height: 1.6; }

/* Ad label */
.ad-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #A0AEC0;
  display: block;
  margin-bottom: 4px;
}
.ad-text { font-size: 13px; color: #718096; }

/* Mid banner */
.ad-mid {
  margin: 20px 0;
  background: white;
  border: 1px dashed #CBD5E0;
  border-radius: 10px;
  padding: 14px 20px;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Stats */
.stats {
  padding: 4px 0 12px;
  color: #718096;
  font-size: 13px;
}

/* Grid */
.clinics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* Card */
.clinic-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}
.clinic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(21,101,192,0.13);
  border-color: #90CDF4;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 7px;
  gap: 8px;
}
.clinic-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  color: #1A202C;
}
.rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: #D69E2E;
  white-space: nowrap;
  flex-shrink: 0;
}

.city-badge {
  display: inline-block;
  font-size: 11px;
  background: #EBF4FF;
  color: #1565C0;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-weight: 600;
}

.address {
  font-size: 12px;
  color: #718096;
  margin-bottom: 9px;
  line-height: 1.4;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}
.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.tag-24h { background: #C6F6D5; color: #22543D; }
.tag-home { background: #BEE3F8; color: #1A365D; }
.tag-animals { background: #E9D8FD; color: #44337A; }

/* Rating */
.card-rating {
  font-size: 12px;
  color: #D69E2E;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.card-rating-num { color: #1A202C; margin-left: 2px; }

/* Metro badge */
.metro-badge {
  font-size: 11px;
  background: #EBF8FF;
  color: #2C5282;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

/* Price */
.card-price {
  font-size: 12px;
  color: #2D3748;
  margin-bottom: 8px;
  font-weight: 500;
}

/* Book button */
.btn-book {
  background: #1976D2;
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.services {
  font-size: 11px;
  color: #4A5568;
  margin-bottom: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid #EDF2F7;
  padding-top: 11px;
  margin-top: auto;
}
.btn-action {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}
.btn-green {
  background: #38A169;
  color: #fff;
  border: none;
}
.btn-green:hover { background: #2F855A; color: #fff; }
.btn-outline {
  border: 1.5px solid #CBD5E0;
  background: #F7FAFC;
  color: #4A5568;
}
.btn-outline:hover { border-color: #1E88E5; color: #1565C0; background: #EBF4FF; }

/* Chip active fallback for old browsers */
.chip.chip-active {
  border-color: #1565C0;
  background: #1565C0;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(21,101,192,0.35);
}

/* ── Экстренная кнопка ───────────────────── */
.emergency-bar {
  background: linear-gradient(135deg, #C53030, #E53E3E);
  padding: 10px 0;
  box-shadow: 0 2px 8px rgba(197,48,48,0.4);
}
.emergency-btn {
  width: 100%;
  background: none;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 10px;
  color: white;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 20px;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: all 0.2s;
}
.emergency-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
}
@media (max-width: 600px) {
  .emergency-btn { font-size: 13px; padding: 10px 12px; }
}

/* ── Карта ────────────────────────────────── */
.map-section {
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  padding: 12px 0 0;
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.map-title {
  font-size: 14px;
  font-weight: 600;
  color: #2D3748;
}
.map-toggle {
  background: none;
  border: 1px solid #CBD5E0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #718096;
  cursor: pointer;
  transition: all 0.15s;
}
.map-toggle:hover { border-color: #1E88E5; color: #1565C0; }
#map {
  height: 380px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
}
@media (max-width: 700px) { #map { height: 280px; } }

/* ── Гео-кнопка ──────────────────────────── */
.geo-btn {
  padding: 6px 14px;
  background: #1565C0;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}
.geo-btn:hover { background: #1250A0; }

/* ── Карточка — обновлено ─────────────────── */
.card-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}
.dist-badge {
  font-size: 11px;
  color: #1565C0;
  font-weight: 700;
  background: #EBF4FF;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.btn-map {
  padding: 7px 10px;
  background: #EBF4FF;
  color: #1565C0;
  border: 1.5px solid #BEE3F8;
  font-size: 13px;
  margin-left: auto;
}
.btn-map:hover { background: #BEE3F8; }

/* Book button hover */
.btn-book:hover { background: #1250A0; color: #fff; }

/* Promo block */
.promo-block {
  background: linear-gradient(135deg, #fffbea, #fff3cd);
  border: 2px solid #F59E0B;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.promo-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #92400E;
  margin-bottom: 8px;
}

/* SEO block */
.seo-block {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: #A0AEC0; font-size: 15px; }

/* Footer */
footer {
  background: #1A202C;
  color: #718096;
  text-align: center;
  padding: 22px;
  font-size: 13px;
  margin-top: 20px;
}
.footer-sub { margin-top: 6px; font-size: 12px; opacity: 0.7; }

@media (max-width: 1024px) {
  .sidebar { display: none; }
}

/* ══ МОБИЛЬНЫЕ ФИКСЫ ══════════════════════════ */
@media (max-width: 480px) {
  /* Хедер */
  .logo { font-size: 22px; }
  .logo-paw { width: 28px; height: 28px; }
  .tagline { font-size: 11px; }
  .btn-about { font-size: 12px; padding: 6px 12px; }

  /* Строка поиска — стекаем вертикально */
  .search-box { flex-direction: column; gap: 8px; }
  .search-box select { min-width: unset; width: 100%; }

  /* Строка сортировки */
  .sort-row { flex-wrap: wrap; gap: 6px; }
  .sort-label { width: 100%; font-size: 12px; }
  .sort-row select { flex: 1; min-width: 140px; }
  .geo-btn { width: 100%; text-align: center; }

  /* Дашборд — 2 колонки на мобиле */
  .dash-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-num { font-size: 26px; }
  .dash-label { font-size: 10px; }
  .dash-card { padding: 12px; }

  /* Карточки клиник — 1 колонка */
  .clinics-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Кнопки карточки — поменьше */
  .btn-action { padding: 6px 9px; font-size: 11px; }

  /* Кнопка экстренного поиска */
  .emergency-btn { font-size: 12px; padding: 10px; }

  /* Карта */
  #map { height: 240px; }
}
