.lgi-listing-head:has(.lg-listing-summary, .lg-listing-offer, .lg-listing-whatsapp) {
  align-items: center;
  flex-wrap: wrap;
  column-gap: 22px;
  row-gap: 12px;
}

.lgi-listing-head:has(.lg-listing-offer, .lg-listing-whatsapp) > span {
  margin-inline-end: auto;
}

.lg-listing-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  flex-basis: 100%;
  order: 1;
  padding: 8px 0 0;
  margin: 0;
  list-style: none;
}

.lg-listing-summary li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.lgi-listing-head .lg-listing-summary strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.lg-listing-offer,
.lg-listing-whatsapp {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--lgi-ink);
  text-decoration: none;
}

.lgi-document .lg-listing-offer:hover {
  background: var(--lgi-ink);
  color: var(--lgi-paper);
}

.lg-listing-whatsapp { gap: 8px; }
.lg-listing-whatsapp svg { width: 17px; height: 17px; flex: none; fill: currentColor; }
.lgi-document .lg-listing-whatsapp:hover {
  background: var(--lgi-ink);
  color: var(--lgi-paper);
}

.lg-listing-extras {
  container: lg-listing-details / inline-size;
}

.lg-listing-extras > section {
  padding-top: 24px;
  margin-top: 30px;
  border-top: 1px solid var(--lgi-rule);
}

.lgi-listing-body:has(> .lg-listing-amenities-block) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.lgi-listing-body:has(> .lg-listing-amenities-block) > section:has(+ section > .lgi-specs) {
  grid-column: 1 / -1;
  max-width: 76ch;
}

.lg-listing-amenities-block {
  min-width: 0;
}

.lg-listing-amenities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(8px, 2vw, 24px);
  padding: 0;
  margin: 0;
  list-style: none;
}

.lg-listing-amenities li {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  border-top: 1px solid var(--lgi-rule);
  padding-block: 8px;
  font-size: .875rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lg-listing-amenities li::before {
  content: "";
  width: 9px;
  height: 5px;
  margin: 4px 0 0 1px;
  border: solid #39634a;
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(-45deg);
}

@media (max-width: 740px) {
  .lgi-listing-body:has(> .lg-listing-amenities-block) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.lg-energy {
  overflow-x: auto;
}

.lg-energy table {
  min-width: 100%;
  border-collapse: collapse;
}

.lg-energy :is(th,td) {
  padding: 6px 8px;
  border-bottom: 1px solid var(--lgi-rule);
  text-align: start;
  font-size: .875rem;
  font-weight: 550;
}

.lg-energy-grade {
  display: inline-block;
  padding: 2px 22px 2px 8px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.lg-energy-grade[data-grade="A"] { width: 39%; background: #23834e; color: #faf9f7; }
.lg-energy-grade[data-grade="B"] { width: 49%; background: #68a858; }
.lg-energy-grade[data-grade="C"] { width: 59%; background: #a2bd51; }
.lg-energy-grade[data-grade="D"] { width: 69%; background: #e9ce62; }
.lg-energy-grade[data-grade="E"] { width: 79%; background: #e5b353; }
.lg-energy-grade[data-grade="F"] { width: 89%; background: #d58e4a; }
.lg-energy-grade[data-grade="G"] { width: 99%; background: #af483e; color: #faf9f7; }

.lg-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.lgi-main .lg-map-header h2 {
  margin: 0;
}

.lg-map-header p {
  margin-top: 4px;
  color: var(--lgi-muted);
  font-size: .875rem;
}

.lg-map-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--lgi-rule);
  text-decoration: none;
  font-size: .875rem;
}

.lg-map-open:hover {
  background: var(--lgi-ink);
  color: var(--lgi-paper);
}

.lg-map-canvas, .lg-map-frame {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: clamp(290px, 49vh, 440px);
  box-sizing: border-box;
  border: 1px solid var(--lgi-rule);
  background: #eeece7;
}

.lg-map-unavailable {
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--lgi-muted);
}

.lg-map-canvas .leaflet-tile-pane {
  filter: saturate(.66);
}

.lg-map-canvas .leaflet-top .leaflet-bar {
  border: 1px solid var(--lgi-rule);
  border-radius: 3px;
  box-shadow: 0 2px 12px #12121212;
}

.lg-map-canvas .leaflet-control-zoom a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--lgi-ink);
  background: var(--lgi-paper);
  font: 500 22px/1 "Lisanov Manrope", sans-serif;
}

.lg-map-canvas .leaflet-control-zoom a:hover {
  background: #eae7e1;
}

.lg-map-canvas .leaflet-control-zoom a.leaflet-disabled {
  color: #69665f;
}

.lg-map-canvas .leaflet-control-attribution {
  color: var(--lgi-ink);
  background: rgb(250 249 247 / 92%);
  font-size: 11px;
}

.lg-map-canvas .leaflet-control-attribution a {
  color: inherit;
  text-decoration: underline;
}

.lg-mortgage {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.lg-mortgage label {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 4px;
  min-width: 0;
  line-height: 1.35;
}

.lg-mortgage input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--lgi-rule);
  color: inherit;
  background: var(--lgi-paper);
  font: inherit;
}

.lg-mortgage-results,.lg-mortgage p { grid-column: 1 / -1; }
.lg-mortgage-results {
  display: grid;
  gap: 3px;
  padding: 16px;
  background: #eeece7;
}
.lg-mortgage [data-payment] { font-size: clamp(24px, 3vw, 37px); font-weight: 650; }
.lg-mortgage p { color: var(--lgi-muted); font-size: .875rem; }

@container lg-listing-details (width < 860px) {
  .lg-mortgage { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lg-mortgage label { grid-column: span 2; }
  .lg-mortgage label:nth-of-type(n + 4) { grid-column: span 3; }
}

@container lg-listing-details (width < 560px) {
  .lg-mortgage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-mortgage label:nth-of-type(n) { grid-column: auto; }
  .lg-mortgage label:last-of-type { grid-column: 1 / -1; }
}

@container lg-listing-details (width < 280px) {
  .lg-mortgage { grid-template-columns: minmax(0, 1fr); }
}

.lg-listing-similar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 18px;
}
.lg-listing-similar a { display: grid; gap: 4px; text-decoration: none; }
.lg-listing-similar a:hover span { text-decoration: underline; }
.lg-listing-similar img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.lg-listing-offer-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 650;
}
