/* Product / house detail – bridge over redesign pages.css */

html,
body.body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

.house-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.house-page .shell,
.house-page .house-layout,
.house-page .house-content,
.house-page .house-sidebar,
.house-page .property-gallery,
.house-page .property-heading,
.house-page .content-panel,
.house-page .lead-card {
  max-width: 100%;
  min-width: 0;
}

/* Leaflet .leaflet-proxy transform must not expand document width */
.house-map-wrap {
  margin-top: 16px;
  border-radius: 18px;
  overflow: hidden !important;
  max-width: 100%;
  border: 1px solid #dce8df;
  background: #e8efe6;
  contain: paint layout;
  isolation: isolate;
  position: relative;
  z-index: 0;
}

.house-map-wrap .leaflet-container,
#product-detail-map {
  overflow: hidden !important;
  max-width: 100%;
  contain: paint layout;
  position: relative;
}

.house-map-wrap .leaflet-pane,
.house-map-wrap .leaflet-map-pane,
.house-map-wrap .leaflet-tile-pane {
  max-width: none;
}

.house-map-wrap .product-detail-map,
#product-detail-map {
  width: 100%;
  height: min(420px, 55vh);
  min-height: 280px;
}

.house-page .icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.house-about-html {
  color: #4d6057;
  font-size: 17px;
  line-height: 1.7;
}

.house-about-html p {
  margin: 0 0 14px;
}

.amenity-custom-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  color: var(--gold-deep, #b98e52);
}

.amenity-custom-icon svg {
  width: 22px;
  height: 22px;
}

.house-lead-form label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #174f43;
}

.house-lead-form .optional {
  font-weight: 500;
  color: #7a8b82;
}

.house-lead-form input,
.house-lead-form select,
.house-lead-form textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d5e0d8;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font: inherit;
  color: #1d2e28;
}

.house-lead-form input.is-invalid,
.house-lead-form select.is-invalid,
.house-lead-form textarea.is-invalid {
  border-color: #c45b5b;
}

.house-lead-form .consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0;
  font-size: 13px;
  font-weight: 500;
  color: #55685e;
}

.house-lead-form .consent input {
  width: auto;
  margin-top: 3px;
}

.house-lead-form .consent.is-invalid,
.house-lead-form .consent input.is-invalid + span {
  color: #a33;
}

.house-lead-form .g-recaptcha {
  margin: 12px 0;
  max-width: 100%;
  overflow: hidden;
  transform-origin: right top;
}

.house-lead-form .lead-submit {
  width: 100%;
  margin-top: 8px;
}

.lead-status {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 14px;
  color: #55685e;
}

.lead-status.is-ok {
  color: #176b4d;
}

.lead-status.is-err {
  color: #a33;
}

.gallery-modal[open],
.gallery-modal:not([hidden]) {
  border: none;
  border-radius: 18px;
  padding: 18px;
  max-width: min(920px, 94vw);
  width: min(920px, 94vw);
  background: #0f241f;
  color: #fff;
  box-sizing: border-box;
}

.gallery-modal::backdrop {
  background: rgba(10, 28, 24, 0.72);
}

/* Soften legacy product.css collisions when both load */
.house-page .product-page-wrapper,
.house-page .product-container {
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

/* —— Mobile / tablet —— */
@media (max-width: 940px) {
  .house-page .house-layout {
    display: flex !important;
    flex-direction: column;
    gap: 22px;
  }

  .house-page .house-content,
  .house-page .house-sidebar {
    width: 100%;
    max-width: 100%;
    position: static;
  }

  .house-page .lead-card {
    max-width: 100%;
    margin: 0;
  }

  .house-page .anchor-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 14px;
    flex-wrap: nowrap;
  }

  .house-page .anchor-nav a {
    flex: none;
    white-space: nowrap;
  }
}

@media (max-width: 700px) {
  .house-page .property-heading {
    display: block;
  }

  .house-page .property-heading h1 {
    font-size: clamp(28px, 8vw, 38px);
    letter-spacing: -1.2px;
    word-break: break-word;
  }

  .house-page .property-subtitle {
    font-size: 15px;
  }

  .house-page .property-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .house-page .property-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }

  .house-page .property-gallery {
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    height: min(280px, 52vw);
    gap: 6px;
    border-radius: 12px;
  }

  .house-page .property-gallery .gallery-photo:nth-of-type(4),
  .house-page .property-gallery .gallery-photo:nth-of-type(5) {
    display: none;
  }

  .house-page .gallery-photo.gallery-primary {
    grid-row: span 2;
  }

  .house-page .amenity-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .house-map-wrap .product-detail-map,
  #product-detail-map {
    height: min(320px, 50vh);
    min-height: 220px;
  }

  .house-lead-form .g-recaptcha {
    transform: scale(0.92);
  }

  .house-page .content-panel h2 {
    font-size: 22px;
    letter-spacing: -0.6px;
  }
}

@media (max-width: 420px) {
  .house-page .amenity-grid {
    grid-template-columns: 1fr;
  }

  .house-page .property-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: 180px 110px;
    height: auto;
  }

  .house-page .gallery-photo.gallery-primary {
    grid-row: auto;
  }

  .house-page .property-gallery .gallery-photo:nth-of-type(3) {
    display: none;
  }

  .house-page .property-actions .btn span:not(.icon) {
    font-size: 12px;
  }

  .house-lead-form .g-recaptcha {
    transform: scale(0.84);
  }
}

.house-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 22px 0 18px;
  padding: 0;
}
.house-facts > div {
  background: #f6f8f4;
  border-radius: 12px;
  padding: 12px 14px;
}
.house-facts dt {
  font-size: 12px;
  font-weight: 700;
  color: #7a8b82;
  margin: 0 0 4px;
}
.house-facts dd {
  margin: 0;
  color: #153f38;
  font-size: 15px;
  font-weight: 600;
}
@media (max-width: 700px) {
  .house-facts {
    grid-template-columns: 1fr;
  }
}
