/* =============================
   MAP.CSS
   Map container, buttons, popups
============================= */
.map-container {
  height: 400px;
  width: 100%;
  max-width: 100%;
  border: 2px solid #ccc;
  border-radius: 12px;
  margin: 1rem 0 2rem;
  box-sizing: border-box;
  overflow: hidden;
}

/* Fix Leaflet attribution z-index to prevent overlap with header */
.leaflet-control-attribution {
  z-index: 1 !important;
}

.leaflet-bottom.leaflet-right {
  z-index: 1 !important;
}

.map-detail-btn {
  background-color: transparent;
  color: #3e2c1c;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
  font-weight: bold;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 0;
  transition: all 0.2s ease;
  text-decoration: underline;
  border: none;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.map-detail-btn:hover {
  background-color: transparent;
  color: #3e2c1c;
  text-decoration: underline;
  transform: translateY(-1px);
}

/* Leaflet popup custom styling to match cafe cards */
.leaflet-popup-content-wrapper {
  background-color: #fdf7f1 !important;
  border-radius: 0.5rem !important;
  border: 1px solid #e0d8cf !important;
  box-shadow: 0 1px 6px rgba(62, 44, 28, 0.1) !important;
  padding: 0.4rem !important;
  max-width: 120px !important;
  min-width: 100px !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  background-color: transparent !important;
  text-align: center !important;
  color: #3e2c1c !important;
  font-family: inherit !important;
  line-height: 1.1 !important;
}

.leaflet-popup-content strong {
  display: block !important;
  margin-bottom: 0.1rem !important;
  color: #3e2c1c !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
}

.leaflet-popup-tip {
  background-color: #fdf7f1 !important;
  border: 1px solid #e0d8cf !important;
}

/* Additional class for Google Maps styling */
.google-maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  background-color: #4285f4;
  color: white;
  text-decoration: none;
  border-radius: 0.7rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.google-maps-btn:hover {
  background-color: #3367d6;
  transform: translateY(-1px);
}

.maps-icon {
  width: 18px;
  height: 18px;
}

/* Mobile responsive for map */
@media (max-width: 768px) {
  .map-container {
    height: 280px;
    margin: 0.8rem 0;
    border-radius: 0.8rem;
  }

  .google-maps-btn {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    width: 100%;
    justify-content: center;
  }

  .maps-icon {
    width: 16px;
    height: 16px;
  }

  .map-actions {
    text-align: center;
    margin-top: 1rem;
  }

  .location-fallback {
    padding: 2rem 1rem;
    text-align: center;
  }

  .location-fallback p {
    font-size: 0.9rem;
  }
}

/* Samsung Galaxy S Series optimizations */
@media (max-width: 360px) {
  .map-container {
    height: 260px;
    margin: 0.6rem 0;
    border-radius: 0.6rem;
  }

  .google-maps-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* iPhone Standard optimizations */
@media (min-width: 361px) and (max-width: 375px) {
  .map-container {
    height: 270px;
    margin: 0.7rem 0;
    border-radius: 0.7rem;
  }
}

/* iPhone Plus & Galaxy Note optimizations */
@media (min-width: 376px) and (max-width: 414px) {
  .map-container {
    height: 290px;
    margin: 0.8rem 0;
    border-radius: 0.8rem;
  }
}

/* Tablet responsive for map */
@media (max-width: 1024px) and (min-width: 769px) {
  .map-container {
    height: 300px;
  }

  .google-maps-btn {
    padding: 0.8rem 1.1rem;
  }
}

.location-fallback {
  padding: 20px;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin: 10px 0;
}

.location-fallback p {
  margin: 8px 0;
}

.location-fallback strong {
  font-size: 1.1rem;
  color: #495057;
}

.cafe-rating {
  font-size: 1.2rem;
  color: #8B4513;
  margin: 10px 0;
}