.map-wrapper {
  position: relative;
  width: 100%;
}
#mapSvg {
  width: 100%;
  height: auto;
  display: block;
}
.tooltip {
  position: fixed;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 10px 10px;
  min-width: fit-content;
  z-index: 1000;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  font-family: "SFU Franklin Gothic";
}
.tooltip.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.tooltip.hidden {
  display: none;
}
.tooltip-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
}
.info-icon {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.info-icon.icon-unit {
  background: #4a90e2;
}
.info-icon.icon-floor {
  background: #f5a623;
}
.info-icon.icon-area {
  background: #e74c3c;
}
.info-text {
  color: #333;
  font-weight: 400;
}
/* Floor Plan Popup Styles */
.floor-plan-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.floor-plan-popup * {
  box-sizing: border-box;
}
.floor-plan-popup.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}
.floor-plan-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}
.floor-plan-popup-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 1400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  z-index: 10000;
  padding: 20px;
  position: relative;
}
.floor-plan-popup-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(../images/pattern.png?v=0.0.1);
  background-repeat: repeat;
  background-position: 0 0;
  background-attachment: fixed;
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}
.floor-plan-popup-content .logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  border-radius: 20px 0 0 0;
}
.floor-plan-popup-content .logo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
}
.floor-plan-popup-content .btn-register {
  display: block;
  position: absolute;
  right: 10px;
  bottom: 10px;
}
.floor-plan-popup-content .btn-register img {
  display: inline-block;
  height: 60px;
  width: auto;
  vertical-align: middle;
}
.floor-plan-popup.active .floor-plan-popup-content {
  /* transform: scale(1); */
}
.floor-plan-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10001;
}
.floor-plan-popup-close:hover {
  background: rgba(0, 0, 0, 0.2);
}
.floor-plan-popup-close svg {
  width: 20px;
  height: 20px;
  stroke: #333;
  pointer-events: none;
  filter: none;
}
.floor-plan-popup-close svg line {
  stroke: currentColor;
  stroke-width: 2;
}
.floor-plan-popup-body {
  padding: 0;
  position: relative;
  width: 100%;
  padding-bottom: 10px;
}
.floor-plan-popup-image-container {
  width: 100%;
  position: relative;
}
.floor-plan-popup-image-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px 16px 0 0;
}

/* Popup Details List Styles */
.floor-plan-popup-details {
  padding: 24px 0px;
}

.popup-details-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

/* Desktop - 2 columns */
@media (min-width: 769px) {
  .popup-details-list {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 10px;
  }
}

.popup-detail-item {
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-start;
  align-items: center;
  border: 1px solid #ebe9cb;
  border-radius: 3px;
  font-family: "SFU Franklin Gothic";
  height: 40px;
  line-height: 40px;
}

.detail-label {
  font-size: 14px;
  font-weight: 700;
  background: #ebe9cb;
  color: #8f2a2a;
  border-radius: 3px;
  text-transform: uppercase;
  padding: 0 5px;
  width: 200px;
  height: 100%;
  line-height: 38px;
}
.detail-label .detail-special {
  font-weight: normal;
}
.detail-value {
  font-size: 16px;
  font-weight: normal;
  color: #434244;
  line-height: 1.2;
  padding: 0 5px;
}
.popup-detail-item.popup-detail-item-special {
  height: 50px;
  line-height: 50px;
}
.popup-detail-item.popup-detail-item-special .detail-label {
  line-height: 48px;
}
.popup-detail-item.popup-detail-item-special-2 {
  height: 87px;
}
.popup-detail-item.popup-detail-item-special-2 .detail-label {
  line-height: 1.5;
  align-items: flex-start;
  display: flex;
  justify-content: center;
  flex-flow: column nowrap;
}
/* Spacing grid for "KHOẢNG LÙI" */
.popup-detail-spacing {
  grid-column: 1 / -1;
}

.spacing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 0px;
}

.spacing-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.spacing-label {
  font-size: 13px;
  font-weight: 500;
  color: #8b6f47;
  text-transform: uppercase;
}

.spacing-value {
  font-size: 16px;
  color: #2c2c2c;
}

/* Mobile spacing adjustments */
@media (max-width: 768px) {
  .floor-plan-popup-content .logo {
    display: none;
  }
  .floor-plan-popup-details {
    padding: 20px 0px;
  }

  .popup-detail-item.popup-detail-item-special-2 {
    height: auto;
  }

  .detail-label {
    font-size: 11px;
    width: 150px;
    height: auto;
  }

  .detail-value {
    font-size: 12px;
  }

  .spacing-grid {
    gap: 12px;
  }
  .spacing-label {
    font-size: 10px;
  }

  .spacing-value {
    font-size: 14px;
  }
  .floor-plan-popup-content .btn-register {
    position: relative;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;
    margin-top: 0px;
    right: auto;
    bottom: auto;
  }
  .floor-plan-popup-body {
    padding-bottom: 0;
  }
}
.floor-plan-popup-title {
  font-size: 24px;
  font-weight: 600;
  color: #222;
  margin: 0 0 20px 0;
  font-family: "SFU Franklin Gothic";
}
.floor-plan-popup-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}
.popup-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.popup-info-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.popup-info-value {
  font-size: 16px;
  color: #222;
  font-weight: 600;
}
.floor-plan-popup-description {
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  line-height: 1.6;
  color: #444;
}
.floor-plan-popup-description h3 {
  font-size: 18px;
  margin: 0 0 12px 0;
  color: #222;
}
.floor-plan-popup-description p {
  margin: 0 0 12px 0;
  font-size: 14px;
}
.floor-plan-popup-description ul {
  margin: 0;
  padding-left: 20px;
}
.floor-plan-popup-description li {
  margin-bottom: 8px;
  font-size: 14px;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.2rem;
  }
  .tooltip {
    min-width: fit-content;
  }
  .info-row {
    font-size: 12px;
  }
  .floor-plan-popup-content {
    max-width: 95%;
    width: 95%;
    max-height: 90vh;
    border-radius: 12px;
  }
  .floor-plan-popup-image-container img {
    border-radius: 12px 12px 0 0;
  }
  .floor-plan-popup-details {
    padding: 20px 0px;
  }
  .popup-details-table td {
    padding: 12px 8px;
  }
  .label-cell {
    font-size: 11px;
    width: 42%;
  }
  .value-cell {
    font-size: 14px;
    width: 58%;
  }
  .spacing-info span {
    font-size: 13px;
  }
}

/* Register Popup Styles */
.register-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.register-popup img {
  max-width: 100%;
}
.register-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.register-popup-content {
  position: relative;
  background: #d5c9aa;
  border-radius: 12px;
  width: 90%;
  max-width: 1900px;
  height: auto;
  /* Changed from max-height: 90vh and overflow-y: auto to display button outside */
  overflow: visible;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.register-popup-content::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background-image: url("../images/bg-popup-form.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

/* Desktop styles (Default) */
.register-popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #8f2a2a;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  transition: transform 0.2s;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.register-popup-close::before {
  content: none;
}

.register-popup-close:hover {
  transform: rotate(90deg);
}

.register-popup-close svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  pointer-events: none;
}

.register-popup-close svg line {
  stroke: #fff;
  stroke-width: 2;
}

/* Mobile responsive - Overwrite for "seal" style */
@media (max-width: 768px) {
  .register-popup-close {
    top: -25px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    background: #d5c9aa;
    border: 1px solid #d5c9aa;
    width: 50px;
    height: 50px;
  }

  .register-popup-close::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border-radius: 50%;
    border: 1px solid #8f2a2a;
  }

  .register-popup-close:hover {
    transform: translateX(-50%) rotate(90deg);
  }

  .register-popup-close svg {
    width: 24px;
    height: 24px;
    stroke: #8f2a2a;
  }

  .register-popup-close svg line {
    stroke: #8f2a2a;
  }
}

.register-popup-body {
  padding: 40px 30px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 12px;
}

.register-popup-title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.form-description-wrapper {
  position: relative;
  z-index: 2;
  color: black;
  max-width: 500px;
  margin: 0 auto 10px auto;
}
.register-popup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.register-popup-form input {
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.register-popup-form input:focus {
  border-color: #007bff;
}

.register-popup-form input::placeholder {
  color: #999;
}

.register-submit-btn {
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.register-submit-btn:hover {
  transform: translateY(-2px);
}

.register-submit-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .register-popup-content {
    width: 95%;
    max-width: none;
  }

  .register-popup-body {
    padding: 30px 20px;
  }

  .register-popup-title {
    font-size: 24px;
    margin-bottom: 25px;
  }

  .register-popup-form input {
    padding: 12px 15px;
    font-size: 15px;
  }

  .register-submit-btn {
    padding: 12px 25px;
    font-size: 15px;
  }
}

/* Register Button Loading State */
.register-submit-btn.loading {
  position: relative;
  pointer-events: none;
}

.register-submit-btn .submit-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.register-submit-btn .submit-loading-spinner .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.register-submit-btn .submit-loading-spinner .loading-text {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
