/* =========================================
   🎨 БАЗОВЫЕ СТИЛИ И СБРОС
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: #f8f9fa;
}

.hidden {
  display: none !important;
}

/* =========================================
   📱 ШАПКА И НАВИГАЦИЯ
   ========================================= */
header {
  background: linear-gradient(135deg, #007a3d, #ce1126);
  color: white;
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 1rem;
}

.header-left {
  flex: 1;
  min-width: 200px;
}

header h1 {
  font-size: 1.6rem;
  margin: 0;
  line-height: 1.2;
}

header p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 2px 0 0;
}

.header-controls {
  position: relative;
  z-index: 1;
  overflow: visible !important;
}

.control-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
  position: relative;
}

.control-pill:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* 🔍 Поиск */
.search-pill {
  position: relative;
  z-index: 10;
  transition: z-index 0.2s ease;
}
.search-pill:focus-within {
  z-index: 9999;
}
.search-pill .search-input {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  height: 40px;
  padding: 0 16px;
  color: white;
  font-size: 14px;
  outline: none;
  width: 180px;
  transition: all 0.3s;
}
.search-pill .search-input::placeholder { color: rgba(255,255,255,0.7); }
.search-pill .search-input:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: white;
  width: 220px;
}

/* 🌐 Языки */
.lang-pill {
  padding: 4px;
  gap: 4px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-family: system-ui, -apple-system, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}
.lang-btn:hover { background: rgba(255,255,255,0.2); }
.lang-btn.active { background: white; color: #007a3d; }

/* 👤 Пользователь */
.user-pill {
  cursor: pointer;
  padding: 0 10px;
  min-width: 130px;
  justify-content: flex-start;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid white;
}
.user-name { 
  color: white; font-weight: 600; font-size: 14px;
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toggle-icon { 
  background: none; border: none; color: white; cursor: pointer; font-size: 10px; opacity: 0.8; margin-left: 4px;
}

/* Выпадающее меню */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 140px;
  overflow: hidden;
  z-index: 1001;
  animation: fadeIn 0.2s ease;
}
.dropdown-item {
  width: 100%; padding: 10px 16px; background: none; border: none;
  text-align: left; cursor: pointer; font-size: 14px; color: #333;
}
.dropdown-item:hover { background: #f5f5f5; }

/* ===== 🔍 РЕЗУЛЬТАТЫ ПОИСКА — ИСПРАВЛЕНО ===== */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 10000 !important;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  font-size: 14px;
  transition: background 0.2s;
  min-height: 70px;
}

.search-result-item:hover {
  background: #f8f9fa;
}

/* Контейнер миниатюры — строго фиксированный */
.search-result-thumb-wrapper {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  min-height: 60px !important;
  max-width: 60px !important;
  max-height: 60px !important;
  flex: 0 0 60px !important;
  overflow: hidden !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #667eea, #764ba2);
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.search-result-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border-radius: 8px !important;
}

/* Текст результата */
.search-result-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.search-result-name {
  font-weight: 600;
  color: #007a3d;
  font-size: 14px;
  line-height: 1.3;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
  max-width: 100%;
}

.search-result-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 100%;
}

.search-result-coords {
  font-size: 11px;
  color: #999;
  font-family: monospace;
  white-space: nowrap;
}

.search-count {
  position: absolute;
  top: -24px;
  right: 0;
  background: #007a3d;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.search-result-item:only-child {
  justify-content: center;
  padding: 20px;
  color: #888;
}

/* ===== 📱 МОБИЛЬНАЯ ВЕРСИЯ ПОИСКА ===== */
@media (max-width: 768px) {
  .search-results {
    max-height: 45vh;
    left: 8px;
    right: 8px;
    width: calc(100% - 16px);
    font-size: 13px;
  }
  
  .search-result-item {
    padding: 8px 10px !important;
    gap: 8px !important;
    min-height: 60px;
  }
  
  .search-result-thumb-wrapper {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    min-height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    flex: 0 0 50px !important;
  }
  
  .search-result-text {
    gap: 2px;
  }
  
  .search-result-name {
    font-size: 13px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .search-result-desc {
    font-size: 11px;
    -webkit-line-clamp: 2;
    line-height: 1.25;
  }
  
  .search-result-coords {
    display: none;
  }
}

@media (max-width: 360px) {
  .search-result-thumb-wrapper {
    width: 45px !important;
    height: 45px !important;
    flex: 0 0 45px !important;
  }
  .search-result-name { font-size: 12px; }
  .search-result-desc { font-size: 10px; }
}

/* =========================================
   🗺️ КАРТА И ПОПАПЫ
   ========================================= */
#map {
  height: 70vh;
  width: 100%;
  z-index: 1;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px !important;
  padding: 0 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
  max-width: 220px !important;
  min-width: 190px !important;
  overflow: hidden !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 220px !important;
  line-height: 1.3 !important;
  font-size: 12px !important;
  overflow: hidden !important;
}

.popup-image-wrapper {
  width: 100% !important;
  height: 90px !important;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

.popup-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.image-placeholder {
  font-size: 40px !important;
  color: white;
  line-height: 1;
}

.popup-text {
  padding: 8px 10px !important;
  overflow: hidden;
}

.popup-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  margin: 0 0 4px 0 !important;
  color: #007a3d;
  line-height: 1.2 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.popup-description {
  font-size: 10px !important;
  color: #555;
  margin: 0 0 6px 0 !important;
  line-height: 1.3 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popup-category {
  font-size: 8px !important;
  padding: 2px 6px !important;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 6px !important;
  font-weight: 500;
}

.popup-footer {
  padding: 6px 10px !important;
  border-top: 1px solid #eee;
}

.leaflet-popup-close-button {
  font-size: 18px !important;
  padding: 4px !important;
  top: 2px !important;
  right: 2px !important;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  z-index: 1001;
}

/* ===== 🟢 ЗЕЛЁНЫЕ МАРКЕРЫ ===== */
.marker-viewed .leaflet-marker-icon img,
.marker-viewed.leaflet-marker-icon img {
  filter: hue-rotate(90deg) saturate(1.2) brightness(0.95) !important;
  -webkit-filter: hue-rotate(90deg) saturate(1.2) brightness(0.95) !important;
  transition: filter 0.2s ease !important;
}

.marker-viewed .leaflet-marker-icon,
.marker-viewed.leaflet-marker-icon {
  filter: hue-rotate(90deg) saturate(1.2) brightness(0.95) !important;
  -webkit-filter: hue-rotate(90deg) saturate(1.2) brightness(0.95) !important;
}

@keyframes markerGreenPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.marker-viewed { animation: markerGreenPulse 0.4s ease-out; }

@media (max-width: 768px) {
  .marker-viewed .leaflet-marker-icon img,
  .marker-viewed.leaflet-marker-icon img {
    filter: hue-rotate(90deg) saturate(1.3) brightness(0.9) !important;
    -webkit-filter: hue-rotate(90deg) saturate(1.3) brightness(0.9) !important;
  }
}

/* Мобильные попапы */
@media (max-width: 768px) {
  .leaflet-popup-content-wrapper {
    max-width: 170px !important;
    min-width: 150px !important;
  }
  .leaflet-popup-content { width: 170px !important; }
  .popup-image-wrapper { height: 70px !important; }
  .image-placeholder { font-size: 32px !important; }
  .popup-text { padding: 6px 8px !important; }
  .popup-title { font-size: 12px !important; margin-bottom: 3px !important; }
  .popup-description { font-size: 9px !important; -webkit-line-clamp: 2 !important; margin-bottom: 4px !important; }
  .popup-category { font-size: 7px !important; padding: 2px 5px !important; margin-bottom: 4px !important; }
  .popup-footer { padding: 4px 8px !important; }
  .leaflet-popup-close-button { font-size: 16px !important; padding: 2px 3px !important; }
}

@media (max-width: 480px) {
  .leaflet-popup-content-wrapper { max-width: 160px !important; min-width: 140px !important; }
  .leaflet-popup-content { width: 160px !important; }
  .popup-image-wrapper { height: 60px !important; }
}

/* =========================================
   🔐 АВТОРИЗАЦИЯ
   ========================================= */
.auth-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #007a3d 0%, #ce1126 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-box {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.auth-box input {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

.btn-primary {
  width: 100%;
  padding: 0.8rem;
  background: #007a3d;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.3s;
}
.btn-primary:hover { background: #005a2d; }

.auth-toggle { margin-top: 1rem; font-size: 0.9rem; color: #555; }
.btn-link { background: none; border: none; color: #007a3d; cursor: pointer; font-weight: 600; }
.error-msg { color: #ce1126; font-size: 0.85rem; margin-top: 0.5rem; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-google:hover {
  background: #f8f9fa;
  border-color: #c6c6c6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  color: #888;
  font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #ddd;
}
.auth-divider span { padding: 0 10px; }

/* =========================================
   📝 ФОРМА ОБРАТНОЙ СВЯЗИ
   ========================================= */
.feedback-container {
  background: white;
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.feedback-container h2 { margin-bottom: 0.5rem; color: #333; }
.feedback-container > p { color: #666; margin-bottom: 1.5rem; font-size: 0.95rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #444;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007a3d;
  box-shadow: 0 0 0 2px rgba(0,122,61,0.2);
}

.btn-submit {
  width: 100%;
  padding: 0.9rem;
  background: #007a3d;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-submit:hover { background: #005a2d; }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.form-status {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-status.success { background: #e8f5e9; color: #2e7d32; }
.form-status.error { background: #ffebee; color: #c62828; }

/* =========================================
   📢 РЕКЛАМА
   ========================================= */
.ad-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.ad-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  transition: transform 0.3s ease;
}
.ad-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}
.ad-label {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ad-banner {
  display: block;
  text-decoration: none;
  color: white;
  cursor: pointer;
}
.ad-content { text-align: center; padding: 1rem; }
.ad-title { font-size: 1.8rem; margin: 0 0 0.5rem 0; font-weight: 700; }
.ad-text { font-size: 1.1rem; margin: 0 0 1.5rem 0; opacity: 0.95; }
.ad-button {
  display: inline-block;
  background: white;
  color: #667eea;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}
.ad-button:hover {
  background: #f8f9fa;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.ad-controls {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 9999;
}
.ad-controls.hidden { display: none; }
.ad-controls label { cursor: pointer; user-select: none; }
.ad-controls input { margin-right: 4px; }

/* =========================================
   🖼️ ГАЛЕРЕЯ МЕСТ
   ========================================= */
.places-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem auto;
  max-width: 1200px;
  padding: 0 1rem;
}
.place-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.place-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.place-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}
.place-card-content { padding: 1.2rem; }
.place-card-title { font-size: 1.2rem; font-weight: 700; color: #333; margin: 0 0 0.5rem 0; }
.place-card-desc { color: #666; font-size: 0.95rem; line-height: 1.5; }

/* =========================================
   📱 ОБЩАЯ МОБИЛЬНАЯ АДАПТАЦИЯ
   ========================================= */
@media (max-width: 768px) {
  header { padding: 0.8rem 0; }
  header h1 { font-size: 1.5rem; }
  #map { height: 60vh; }
  
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  .header-content > div:first-child { text-align: center; }
  
  .search-container { width: 100%; max-width: 400px; }
  .lang-switcher { padding: 3px; }
  .lang-btn { padding: 5px 8px; font-size: 0.8rem; }
  
  .user-name { display: none; }
  .user-info { padding: 4px 8px; }
  .user-pill { min-width: auto; justify-content: center; }
  
  .ad-title { font-size: 1.4rem; }
  .ad-text { font-size: 1rem; }
  .ad-container { padding: 1.5rem; }
  
  .places-gallery { grid-template-columns: 1fr; }
}

/* Гостевой режим */
.guest-pill { cursor: default; }
.guest-text {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
}

/* =========================================
   🖼️ ФЛАГИ
   ========================================= */
.flag {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
}
.flag-ru {
  background: linear-gradient(to bottom, #fff 33%, #0039A6 33%, #0039A6 66%, #D52B1E 66%);
}
.flag-en {
  background: #00247d;
  position: relative;
  overflow: hidden;
}
.flag-en::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    linear-gradient(45deg, #cf142b 25%, transparent 25%, transparent 75%, #cf142b 75%),
    linear-gradient(-45deg, #cf142b 25%, transparent 25%, transparent 75%, #cf142b 75%);
  background-size: 60% 60%;
  background-position: center;
}

/* =========================================
   📸 КНОПКА ПРЕДЛОЖИТЬ ФОТО
   ========================================= */
.btn-suggest-photo {
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-suggest-photo:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.btn-suggest-photo:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* =========================================
   📸 МОДАЛЬНОЕ ОКНО ЗАГРУЗКИ
   ========================================= */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 1rem;
}
.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  border-radius: 50%;
}
.modal-close:hover { background: #f0f0f0; }
.modal-title {
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  color: #333;
}
.modal-hint {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.upload-area {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 1rem;
}
.upload-area:hover, .upload-area.dragover {
  border-color: #667eea;
  background: #f8f9ff;
}
.upload-area input[type="file"] { display: none; }
.upload-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 1rem;
  display: none;
}
.btn-upload {
  width: 100%;
  padding: 12px;
  background: #007a3d;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}
.btn-upload:disabled { opacity: 0.6; cursor: not-allowed; }
.upload-status {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
}
.upload-status.success { background: #e8f5e9; color: #2e7d32; }
.upload-status.error { background: #ffebee; color: #c62828; }
.upload-status.hidden { display: none; }

/* =========================================
   ❤️ КНОПКА ИЗБРАННОГО
   ========================================= */
.fav-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.2s, color 0.2s;
  line-height: 1;
}
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.active { color: #e74c3c; }
.fav-btn:not(.active) { color: #ccc; filter: grayscale(100%); }

/* =========================================
   ❤️ МОДАЛЬНОЕ ОКНО ИЗБРАННОГО
   ========================================= */
.favorites-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.favorites-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
}
.favorites-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.favorites-header h3 { margin: 0; font-size: 1.2rem; color: #333; }
.close-fav-btn {
  background: none; border: none;
  font-size: 1.5rem; cursor: pointer; color: #666;
  padding: 0 4px;
}
.close-fav-btn:hover { color: #000; }
.favorites-list {
  overflow-y: auto;
  padding: 0.5rem;
  flex: 1;
}
.fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  transition: background 0.2s;
}
.fav-item:hover { background: #e8f5e9; }
.fav-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}
.fav-name {
  display: block;
  font-weight: 600;
  color: #007a3d;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-desc {
  font-size: 0.85rem;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.remove-fav-btn {
  background: #ffebee;
  border: none;
  color: #c62828;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
}
.remove-fav-btn:hover { background: #ffcdd2; }
.fav-empty, .fav-loading {
  text-align: center;
  padding: 2rem;
  color: #888;
  font-size: 0.95rem;
}

@media (max-width: 480px) {
  .favorites-modal { padding: 0; align-items: flex-end; }
  .favorites-content {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
  }
}

/* =========================================
   🗺️ ВСПЛЫВАЮЩАЯ СТРОКА (Floating Bar)
   ========================================= */
.place-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 9999;
  padding: 12px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 140px;
}
.place-bar.visible { transform: translateY(0); }
.place-bar.hidden { display: none; }

.place-bar-content {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  max-width: 1200px;
  margin: 0 auto;
}

/* Контейнер картинки */
.place-bar-image-wrapper {
  width: 80px !important;
  height: 80px !important;
  min-width: 80px !important;
  min-height: 80px !important;
  max-width: 80px !important;
  max-height: 80px !important;
  flex: 0 0 80px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  background: #e9ecef;
  position: relative;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.place-bar-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border-radius: 12px !important;
}

/* Заглушка */
.place-bar-placeholder {
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(135deg, #007a3d, #ce1126);
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  color: white;
  border-radius: 12px;
  font-size: 32px;
}
.placeholder-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.placeholder-text {
  font-size: 10px;
  opacity: 0.9;
  font-weight: 500;
}
.place-bar-placeholder.hidden { display: none !important; }

/* Текст */
.place-bar-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.place-bar-title {
  font-size: 14px;
  font-weight: 700;
  color: #007a3d;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-bar-desc {
  font-size: 12px;
  color: #555;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Кнопки */
.place-bar-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.place-bar-fav {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.2s;
}
.place-bar-fav:hover { transform: scale(1.2); }
.place-bar-fav.active { color: #e74c3c; }
.place-bar-fav:not(.active) { color: #ccc; filter: grayscale(100%); }
.place-bar-close {
  background: #f1f1f1;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.2s;
}
.place-bar-close:hover { background: #e0e0e0; }

/* Мобильная версия Floating Bar */
@media (max-width: 768px) {
  .place-bar {
    border-radius: 20px 20px 0 0;
    padding: 10px;
    max-height: 120px;
  }
  .place-bar-image-wrapper {
    width: 70px !important;
    height: 70px !important;
    min-width: 70px !important;
    min-height: 70px !important;
    max-width: 70px !important;
    max-height: 70px !important;
    flex: 0 0 70px !important;
  }
  .place-bar-placeholder {
    width: 70px !important;
    height: 70px !important;
    font-size: 24px;
  }
  .placeholder-icon { font-size: 24px; }
  .placeholder-text { font-size: 9px; }
  .place-bar-title { font-size: 13px; }
  .place-bar-desc { font-size: 11px; }
  .place-bar-fav { font-size: 18px; }
  .place-bar-close { width: 24px; height: 24px; font-size: 14px; }
}

@media (max-width: 360px) {
  .place-bar-content { gap: 8px; }
  .place-bar-image-wrapper { 
    width: 60px !important; 
    height: 60px !important;
    flex: 0 0 60px !important;
  }
  .place-bar-placeholder { 
    width: 60px !important; 
    height: 60px !important;
    font-size: 28px;
  }
  .place-bar-title { font-size: 12px; }
  .place-bar-desc { font-size: 10px; }
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes markerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.marker-pulse {
  animation: markerPulse 0.5s ease-in-out 3;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}
img[loading="lazy"].loaded {
  opacity: 1;
}