/* --- Wrapper chung cho bản đồ --- */
.hd-map-wrapper {
  position: relative;
  width: 100%;
  height: 800px;
}
.hd-map-iframe-container,
.hd-map-iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Khối marker (cha của cả bảng thông tin và icon) --- */
.hd-location-marker {
  position: absolute;
  z-index: 10;
  /* Đặt tâm của khối này ở đầu nhọn của icon */
  transform: translateX(-50%);
  cursor: pointer;
}

/* --- Bảng thông tin (Info Box) --- */
.hd-marker-content {
  width: 380px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: sans-serif;
  margin-bottom: -15px; /* Dịch chuyển lên trên một chút */
  position: relative;
  bottom: 100%; /* Đẩy bảng thông tin lên trên vị trí của icon */
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  visibility: visible;
}
.hd-marker-image {
  position: relative;
}
.hd-marker-image img {
  display: block;
  width: 100%;
  height: auto;
  padding: 15px;
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.hd-marker-info {
  padding: 15px 5px;
}
.hd-marker-category {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
}
.hd-marker-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin: 5px 0 8px 0;
  padding-left: 10px;
}
.hd-marker-address {
  font-size: 14px;
  color: #666;
  margin: 0;
}
/* Mũi tên tam giác chỉ xuống, nằm dưới bảng thông tin */
.hd-marker-content::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #fff;
}

/* --- Icon định vị --- */
.hd-marker-icon {
  width: 30px;
  height: 40px;
  color: #005498;
  filter: drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease, opacity 0.3s ease;
  position: absolute;
  bottom: -38px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0; /* Mặc định ẩn icon */
  visibility: hidden;
}

/* --- Logic TRẠNG THÁI ẩn/hiện --- */

/* Khi khối marker có class 'icon-is-active' */
.hd-location-marker.icon-is-active .hd-marker-content {
  opacity: 0; /* Bảng thông tin sẽ ẩn đi */
  visibility: hidden;
}

.hd-location-marker.icon-is-active .hd-marker-icon {
  opacity: 1; /* Icon sẽ hiện ra */
  visibility: visible;
}

.hd-location-marker.icon-is-active:hover .hd-marker-icon {
  transform: translateX(-50%) scale(1.1); /* Hiệu ứng hover cho icon */
}
