.map-label {
  text-transform: uppercase;
}

/* Location map icons: ẩn trước khi fade; sau khi animate giữ hiện (fill-mode forwards) */
@media (max-width: 1024.98px) {
  .section-top-location:not(.is-active) .dot-p {
    opacity: 0;
  }
}

.section-top-location .thumbnail-inner {
  position: relative;
}

.section-top-location .map-icon {
  z-index: 2;
}

/* .wpcf7-form p {
  margin: 0;
  padding: 0;
} */

.wpcf7-spinner {
  display: none;
}

.wpcf7 form.invalid .wpcf7-response-output {
  color: #800000;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.wpcf7 form.sent .wpcf7-response-output {
  color: green;
}

.wpcf7-not-valid-tip {
  color: #800000;
}

.pagination-common .pagination-arrow-wrapper.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.pagination-common .pagination-arrow-wrapper.is-disabled:hover {
  background-color: transparent;
}

/* Hide YouTube title bar (top) and share/branding bar (bottom) */
.yt-iframe-wrap {
  overflow: hidden;
}
.yt-iframe-wrap iframe {
  top: -66px !important;
  height: calc(100% + 125px) !important;
}

/* Floor utilities — SVG labels (slice = khớp object-fit:cover của ảnh) */
.list-utilities-premises .floor-utilities-map {
  position: relative;
  width: 100%;
  height: 100%;
}

.list-utilities-premises .floor-utilities-map picture {
  display: block;
  width: 100%;
  height: 100%;
}

.list-utilities-premises .floor-utilities-labels-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: block;
  opacity: 0;
}

/* Fade + scale số tiện ích khi tab/inner-tab active (giống .js-inline-svg trong HTML) */
.list-utilities-premises
  .tab-panel.active
  .tab-wrapper
  .floor-utilities-labels-svg,
.list-utilities-premises
  .tab-panel.active
  .inner-tab-panel.active
  .floor-utilities-labels-svg {
  animation-name: scaleLarge;
  animation-duration: 0.55s;
  animation-delay: 0.08s;
  animation-fill-mode: forwards;
}

/* List tầng: GSAP fade opacity; tắt transition CSS để không trượt padding */
.list-utilities-premises .inner-block-list {
  transition: none;
}

.list-utilities-premises .floor-utilities-labels-svg g[data-pair] {
  pointer-events: auto;
  cursor: pointer;
}

.list-utilities-premises .floor-utilities-labels-svg text {
  pointer-events: none;
  user-select: none;
}

/* Mobile: giống HTML — ẩn SVG số, chỉ hiện ảnh SP (scroll ngang qua image-wrapper) */
@media only screen and (max-width: 767.98px) {
  .list-utilities-premises .floor-utilities-map {
    width: 5rem;
    height: auto;
  }

  .list-utilities-premises .floor-utilities-map picture {
    width: 100% !important;
    height: auto;
  }

  .list-utilities-premises .floor-utilities-map .object-common {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .list-utilities-premises .floor-utilities-labels-svg {
    display: none !important;
  }
}

/* Homepage promo popup */
.homepage-promo-popup {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
}

html.homepage-popup-open,
body.homepage-popup-open {
  overflow: hidden !important;
  height: 100%;
}

/* Prevent fixed header/nav from stealing clicks while popup is open */
html.homepage-popup-open .header-common,
html.homepage-popup-open .header-common-navigation,
html.homepage-popup-open #nav {
  pointer-events: none !important;
}

.homepage-popup-open main {
  position: relative;
  z-index: 9999;
}

.homepage-promo-popup.is-visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.homepage-promo-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1;
}

.homepage-promo-popup__dialog {
  position: relative;
  width: auto;
  height: auto;
  max-width: 92vw;
  max-height: 84vh;
  overflow: visible;
  z-index: 2;
}

.homepage-promo-popup__close.popup-close {
  top: 0;
  right: -0.56rem;
  margin: 0;
  width: 0.56rem;
  height: 0.56rem;
  z-index: 20;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.homepage-promo-popup__close.popup-close svg {
  width: 0.2rem;
  height: 0.2rem;
}

.homepage-promo-popup__link {
  display: block;
  position: relative;
  z-index: 1;
  text-decoration: none;
}

.homepage-promo-popup__image {
  display: block;
  max-width: 92vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

@media (max-width: 767.98px) {
  .homepage-promo-popup__close.popup-close {
    top: -0.15rem;
    right: 0;
    width: 0.25rem;
    height: 0.25rem;
  }

  .homepage-promo-popup__close.popup-close svg {
    width: 0.1rem;
    height: 0.1rem;
  }

  .homepage-promo-popup__dialog {
    max-width: 92vw;
    max-height: 82vh;
  }

  .homepage-promo-popup__image {
    max-width: 92vw;
    max-height: 82vh;
  }
}

/* Product page — floor plan từ plugin DevVN */
.block-product-detail .terp-product-floor-plan {
  width: 100%;
  height: 100%;
}

.block-product-detail .terp-product-floor-plan .list-premises-tabs,
.block-product-detail .terp-product-floor-plan .tabs-content,
.block-product-detail .terp-product-floor-plan .tab-panel.active {
  height: 100%;
}

/* SVG chữ THÁP + đường gạch: cùng box với map (.product-image svg trong products.css) */
.block-product-detail .terp-product-floor-plan .product-image .premises-name {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: block;
}

/* Map full panel như product-image trong HTML gốc */
.block-product-detail .terp-product-floor-plan .product-map-image {
  position: relative;
  width: 100%;
  height: 100%;
}

.block-product-detail .terp-product-floor-plan .product-image {
  position: relative;
  width: 100%;
  height: 100%;
}

.block-product-detail .terp-product-floor-plan .premises-bg,
.block-product-detail .terp-product-floor-plan .floor-utilities-map {
  position: relative;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.block-product-detail .terp-product-floor-plan .floor-utilities-map picture,
.block-product-detail
  .terp-product-floor-plan
  .floor-utilities-map
  .object-common {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.block-product-detail .terp-product-floor-plan .floor-utilities-labels-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  /* Không ép display:block — để desktop/mobile ẩn hiện theo breakpoint */
  opacity: 1;
  overflow: visible;
}

/* Viền polygon: cùng hệ toạ độ path (không non-scaling-stroke) */
.block-product-detail .terp-product-floor-plan .dfp-region-stroke {
  vector-effect: none;
  overflow: visible;
}

/* Desktop: chỉ hiện SVG desktop (tránh vòng tròn mobile to đè lên) */
@media print, (min-width: 768px) {
  .block-product-detail .terp-product-floor-plan .dfp-labels-desktop,
  .dfp-floor-plan .dfp-labels-desktop {
    display: block !important;
  }

  .block-product-detail .terp-product-floor-plan .dfp-labels-mobile,
  .dfp-floor-plan .dfp-labels-mobile {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media only screen and (max-width: 767.98px) {
  .block-product-detail .terp-product-floor-plan .dfp-labels-desktop,
  .dfp-floor-plan .dfp-labels-desktop,
  .block-product-detail .terp-product-floor-plan .list-premises-tabs.sm .dfp-labels-desktop,
  .block-product-detail .terp-product-floor-plan .product-image .dfp-labels-desktop {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }

  /* Đảm bảo marker desktop không lọt qua rule .product-image svg { display:block } */
  .block-product-detail .terp-product-floor-plan .dfp-labels-desktop g.dfp-marker,
  .block-product-detail .terp-product-floor-plan .list-premises-tabs.sm .dfp-labels-desktop g.dfp-marker {
    display: none !important;
  }

  .block-product-detail .terp-product-floor-plan .dfp-labels-mobile,
  .dfp-floor-plan .dfp-labels-mobile {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

.block-product-detail
  .terp-product-floor-plan
  .floor-utilities-labels-svg
  g[data-pair] {
  pointer-events: auto;
  cursor: pointer;
}

/* Số viết tắt căn hộ: căn giữa vòng tròn (tránh lệch do dominant-baseline) */
.block-product-detail
  .terp-product-floor-plan
  .floor-utilities-labels-svg
  g.dfp-marker
  text {
  text-anchor: middle;
  dominant-baseline: alphabetic;
  alignment-baseline: auto;
}

/* Title / tab / compass trên nền — khớp products.css */
.block-product-detail .terp-product-floor-plan .product-title,
.block-product-detail .terp-product-floor-plan .product-direction,
.block-product-detail .terp-product-floor-plan .product-list,
.block-product-detail .terp-product-floor-plan .block-list {
  z-index: 3;
}

/* Ghi đè style tab xám của plugin (.inner-block-list / .dfp-floor-plan) → dùng tab trắng theme */
.block-product-detail .terp-product-floor-plan .block-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem;
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  background: transparent;
  width: 100%;
  justify-content: center;
}

.block-product-detail .terp-product-floor-plan .block-list .list-item {
  position: relative;
  margin: 0;
  padding: 0 0.275rem 0.16rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.block-product-detail .terp-product-floor-plan .block-list .list-item.active,
.block-product-detail .terp-product-floor-plan .block-list .list-item:hover {
  background: transparent;
  border-color: transparent;
  color: #fff;
}

.block-product-detail .terp-product-floor-plan .block-list .item-text {
  margin: 0;
  font-size: 0.16rem;
  line-height: 1.2;
  font-weight: inherit;
}

/* Bỏ đường kẻ table trong nội dung hover (admin WYSIWYG) */
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .toggle-body
  table,
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .toggle-body
  th,
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .toggle-body
  td {
  border: 0 !important;
  border-collapse: collapse;
  outline: none;
  box-shadow: none;
}

/* Popup: premises-bg có line-height:0 — reset để title/mũi tên không lệch */
.block-product-detail .terp-product-floor-plan .utilities-map-toggle {
  line-height: normal;
  /* Đè lên SVG chữ tháp + đường gạch (.premises-name z-index:2) */
  z-index: 10;
}

.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .dfp-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .dfp-card__title {
  flex: 1 1 auto;
  min-width: 0;
}

.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .dfp-card__arrow,
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .dfp-card__link {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  line-height: 0;
  position: relative;
}

/* products.css: .product-image svg { position:absolute; top:0; left:0 } — đừng áp dụng cho mũi tên popup */
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .dfp-card__arrow
  svg,
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .dfp-card__link
  svg {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: block;
  width: 24px !important;
  height: 24px !important;
  margin: 0;
  flex-shrink: 0;
}

/* Bôi đậm từ admin — common.css reset strong/b về normal; theme dùng font Bold riêng */
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .toggle-body
  strong,
.block-product-detail
  .terp-product-floor-plan
  .utilities-map-toggle
  .toggle-body
  b {
  font-family: SVN-Gotham-Bold, sans-serif;
  font-weight: 700;
}

.block-product-detail .terp-product-floor-plan-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

@media only screen and (max-width: 767.98px) {
  .block-product-detail .terp-product-floor-plan .block-list {
    padding: 0 0.1rem 0.1rem;
    width: 100%;
    justify-content: flex-start;
    overflow: scroll hidden;
  }

  .block-product-detail .terp-product-floor-plan .block-list .list-item {
    padding: 0 0.08rem 0.12rem;
    flex: 0 0 auto;
  }

  .block-product-detail .terp-product-floor-plan .block-list .item-text {
    font-size: 0.08rem;
  }

  .block-product-detail .terp-product-floor-plan .floor-utilities-map picture,
  .block-product-detail
    .terp-product-floor-plan
    .floor-utilities-map
    .object-common {
    height: auto;
    object-fit: contain;
  }
}

/* Popup chi tiết căn hộ (premisesDetailPopup) — HTML section-product-detail */
#premisesDetailPopup .popup-body {
  width: 100%;
  height: 100%;
}

#premisesDetailPopup .section-product-detail {
  width: 100%;
  height: 100%;
}

/* Fallback nếu theme popup chưa sẵn: modal DFP dùng cùng layout */
.dfp-floor-plan .dfp-region-modal--apartment .dfp-region-modal__panel {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  border-radius: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.dfp-floor-plan .dfp-region-modal--apartment .dfp-region-modal__body {
  width: 100%;
  height: 100%;
}

.dfp-floor-plan .dfp-region-modal--apartment .dfp-region-modal__close {
  z-index: 10;
  color: #fff;
}

/* Mobile product: map DFP + list-area + legend (giống HTML gốc / products.css) */
@media only screen and (max-width: 767.98px) {
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .inner-tabs,
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .inner-tabs-content,
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .inner-tab-body {
    position: relative;
    height: 100%;
    min-height: 100%;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .body-title {
    z-index: 4;
  }

  /* Select tháp — đè lên ảnh Hướng & vị trí tháp */
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .list-heading {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 6;
    max-width: 1.2rem;
    padding: 0.84rem 0.1rem 0.2rem;
    pointer-events: auto;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .related-site-wrap {
    position: relative;
    z-index: 6;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .related-site-box {
    z-index: 7;
  }

  /* Hướng & vị trí tháp — góc phải trên (dưới select) */
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .list-area {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    color: #fff;
    font-size: 0.09rem;
    max-width: 1.4rem;
    text-align: center;
    text-transform: uppercase;
    padding: 0.9rem 0.1rem 0;
    pointer-events: none;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .list-area
    > p {
    margin: 0 0 0.05rem;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .list-area
    > img {
    display: block;
    max-width: 1rem;
    width: 100%;
    height: auto;
    margin: 0 auto;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .product-map-image,
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .product-image,
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .premises-bg,
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .floor-utilities-map {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .floor-utilities-map
    picture,
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .floor-utilities-map
    .object-common {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .floor-utilities-labels-svg,
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .number-apartment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .floor-utilities-labels-svg
    g[data-pair],
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .floor-utilities-labels-svg
    .dfp-region {
    pointer-events: auto;
  }

  /* Legend CH Studio… — hàng ngang đáy, giống products.css mobile */
  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .product-list {
    position: absolute;
    z-index: 4;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    margin: 0;
    padding: 0 0.05rem 0.45rem;
    list-style: none;
    pointer-events: none;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .product-list-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.02rem;
    margin: 0;
    font-size: 0.08rem;
    line-height: 1.2;
    text-transform: uppercase;
    color: #fff;
    pointer-events: auto;
    white-space: nowrap;
    width: auto;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .product-list-item
    span {
    display: block;
  }

  .block-product-detail
    .terp-product-floor-plan
    .list-premises-tabs.sm
    .product-list-item
    span:first-child {
    width: 0.12rem;
    height: 0.12rem;
    border-radius: 50%;
    border: 5px solid #021913;
    flex-shrink: 0;
    box-sizing: border-box;
  }
}

/* Utilities slider: title fade do GSAP điều khiển; class chỉ khóa tương tác khi ẩn */
.section-top-utilities .js-utilities-title {
  will-change: opacity, visibility;
}

.section-top-utilities .js-utilities-title.is-hidden {
  pointer-events: none;
}
