/* =====================================================
   🎨 PIXTERRA MAP STYLES — карта, тултипы, сайдбар, попап
   ===================================================== */

/* === Общий стиль карты === */
#pixel-map {
  width: 100%;
  height: calc(100vh - 100px);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.25);
  overflow: hidden;
}

/* === Сайдбар информации === */
#pixel-sidebar {
  position: fixed;
  top: 70px;
  right: -340px;
  width: 320px;
  height: calc(100vh - 90px);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
  padding: 20px;
  transition: right 0.4s ease;
  z-index: 999;
  overflow-y: auto;
}

#pixel-sidebar.open {
  right: 0;
}

#pixel-details h6 {
  font-weight: 700;
  color: #444;
}

#pixel-details p {
  margin-bottom: 8px;
  font-size: 14px;
}

/* === Кнопки сайдбара === */
#pixel-sidebar .btn {
  border-radius: 8px;
  font-weight: 600;
}

#open-sidebar {
  position: fixed;
  right: 20px;
  bottom: 30px;
  z-index: 998;
  border-radius: 30px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 10px 16px;
  box-shadow: 0 5px 15px rgba(118, 75, 162, 0.3);
  transition: all 0.3s ease;
}

#open-sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(118, 75, 162, 0.45);
}

/* === Тултип координат === */
.coordinates-tooltip {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

/* === Попап покупки === */
.purchase-popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.purchase-popup {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
}

.purchase-popup h4 {
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.purchase-popup p {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
}

.purchase-popup .btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 10px 14px;
}

.purchase-popup .btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
}

.purchase-popup .btn-secondary {
  background: #e0e0e0;
  color: #333;
  border: none;
}

/* === Анимации === */
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === Пользовательский маркер === */
.user-location-marker div {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220,53,69,0.4); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(220,53,69,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220,53,69,0); }
}
/* === Map UX tweaks (mobile) === */
.map-container {
  min-height: 420px;
}

#pixel-sidebar .btn { height: 44px; }

.search-center-results {
  max-height: 40vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* === 📱 FIX: адаптация сайдбара на мобильных (Pixterra 2025-11-07) === */
@media (max-width: 768px) {
  #pixel-sidebar {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 60vh !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -4px 25px rgba(0,0,0,0.35) !important;
    overflow-y: auto !important;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 1050;
  }

  #pixel-sidebar.open {
    transform: translateY(0);
  }

  #open-sidebar {
    position: fixed !important;
    bottom: 80px !important;
    right: 20px !important;
    z-index: 1100 !important;
  }

  #pixel-map {
    height: calc(100dvh - 100px) !important;
  }
}