/*
 * /properties/{slug} (WP template "Single property", post-1743.css): docs/design/components/spec-table.md,
 * badge-terms.md, agent-box.md §3. Sections top to bottom: hero, price bar, main (content + agent box), similar.
 */

/* Font Awesome 5 glyphs of the agent social icons (WP prints them as font icons). */
@font-face {
  font-family: 'Font Awesome 5 Free';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/fontawesome/fa-regular-400-hr-w39-.woff2") format('woff2');
}
@font-face {
  font-family: 'Font Awesome 5 Brands';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/fontawesome/fa-brands-400-agtjcXH.woff2") format('woff2');
}

/* ---------- 1. Hero: the featured image, 13 % padding top and bottom = 26 % of the width tall ---------- */
.property-hero {
  position: relative;
  width: 100%;
  padding: 13% 0;
  overflow: hidden;
}
/* painted as a background by the `hero` controller (the <img> stays for the text alternative and no-JS) */
.property-hero.is-background {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}
.property-hero.is-background img {
  visibility: hidden;
}
/* the empty 1 px column WP keeps inside the hero section */
.property-hero::after {
  content: '';
  display: block;
  height: 1px;
}
.property-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* ---------- 2. Price bar ---------- */
.property-summary {
  padding: 5px 0;
  border-bottom: 1px solid var(--gray-300);
}
.property-summary .container {
  align-items: center;
}
.property-summary .col {
  align-content: center;
}
.property-summary__price { width: 16%; }
.property-summary__specs { width: 50.67%; }
.property-summary__action { width: 32.994%; }
.property-price {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}
.property-summary__visit {
  display: block;
  width: 100%;
}
/* WP: the widget has 31px padding + border and its icon list a -30px inline margin, so the first item sits at border + 1px + 30px */
.property-summary__specs .property-specs {
  margin: 0;
  padding-left: 1px;
  border-left: 1px solid var(--gray-300);
}
.property-summary__specs .property-specs__item {
  margin-inline: 30px;
}
.property-summary__specs .property-specs__item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 0;
  right: -30px;
  bottom: 0;
  border-right: 1px solid var(--gray-300);
}
.property-summary__specs .property-specs__icon {
  padding-inline-end: 10px;
}
.property-summary__specs .property-specs__icon svg {
  width: 24px;
  height: 24px;
  margin: 0 6px 4.06px 0;
}
.property-summary__specs .property-specs__text {
  padding-left: 5px;
  color: var(--gray-700);
  line-height: 60px;
}

/* ---------- 3. Main: content 66.67 % + agent box 33.33 % ---------- */
.property-main {
  padding: 35px 0 85px;
  border-bottom: 1px solid var(--gray-300);
}
.property-main__content {
  display: block;
  padding: 22px 15px 15px;
  width: 66.667%;
  min-width: 0;
}
.property-main__aside {
  width: 33.333%;
  align-items: flex-start;
}

.property-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--gray-300);
}
.property-title {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}
.property-address {
  margin-top: 6px;
  font-size: var(--fs-h5);
  line-height: 21.98px;
}
.property-heading__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
}
.property-badge {
  margin-bottom: 32px;
}
.property-id {
  display: flex;
}
.property-id__label {
  color: var(--color-text);
  line-height: 1.93em;
}
.property-id__value {
  padding-left: 4.4px;
  color: var(--gray-700);
  font-size: var(--fs-large);
  line-height: 27.36px;
}

/* Sections: label column 24 % + content, separated by 1px lines */
.property-section {
  border-bottom: 1px solid var(--gray-300);
}
.property-section__row {
  display: flex;
  flex-wrap: wrap;
}
.property-section__title {
  width: 24%;
  padding: 15px 15px 15px 0;
}
.property-section--specs .property-section__title,
.property-section--costs .property-section__title {
  padding-top: 18px;
}
.property-section__spacer {
  width: 24%;
}
.property-section__col {
  padding: 15px;
}
.property-section__col--a { width: 39%; }
.property-section__col--b { width: 36.664%; padding-right: 0; }
.property-section__divider {
  width: 75%;
  margin: 0 0 20px auto;
  padding-block: 12px;
  border-top: 1px solid var(--gray-300);
  box-sizing: content-box;
  height: 0;
}
/* WP: two inner sections, the first one padded 23px 0 5px, the second one 0 0 26px with the border */
.property-section--specs { padding: 23px 0 26px; border-bottom: 1px solid var(--gray-300); }
.property-section--specs .property-section__row:first-child { padding-bottom: 5px; }
.property-section--costs { padding: 24px 0 26px; }
/* the column WP pads with 15px on the left, top and bottom (the right edge is the container's) */
.property-section__wide {
  width: 75.998%;
  min-width: 0;
  padding: 15px 0 15px 15px;
}

/* label 44 % + value 56 %: the two widgets do not fit on one line, so the label sits above the value, as on WP */
.spec-pair {
  display: flex;
  flex-wrap: wrap;
}
.spec-pair__label {
  width: 44%;
  margin: 0 20px var(--widget-spacing) 0;
  padding: 4px 0;
  color: var(--color-text);
  font-size: var(--fs-small);
  line-height: 20px;
}
.spec-pair__value {
  width: 56%;
  padding: 4px 0;
  color: var(--gray-700);
  font-size: var(--fs-body);
  line-height: 20px;
}

/* Características: check list, 3 columns */
.property-section--features {
  padding: 27px 0 30px;
  border-bottom: 0;
}
.property-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 75.998%;
  margin: 0;
  padding: 15px;
  list-style: none;
}
.property-features__item {
  display: flex;
  align-items: flex-start;
  padding-block: 5px;
  color: var(--gray-700);
  font-size: var(--fs-body);
  line-height: 21.98px;
}
/*
 * WP's check marker is an icon-font glyph that the reference capture does not render: the marker has no width and only
 * its 10px margin is left before the text. The icon is kept in the markup but takes no space, so the text sits where
 * it does on WP (remove `display: none` and the item padding to show the check again).
 */
.property-features__item {
  padding-inline: 10px;
}
.property-features__icon {
  display: none;
  margin-right: 10px;
  color: var(--gray-700);
}
.property-features__icon svg {
  width: 16px;
  height: 16px;
}

/* Gallery: 3 columns, no gap, square tiles, green veil + white plus on hover */
.gallery {
  margin-bottom: var(--widget-spacing);
}
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.gallery__item {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
}
.gallery__item img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}
.gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 201, 128, 0);
  transition: background 0.3s linear;
}
.gallery__item:hover::after,
.gallery__item:focus-visible::after {
  background: rgba(0, 201, 128, 0.12);
}
.gallery__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 36px;
  height: 36px;
  color: var(--color-white);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s linear;
}
.gallery__icon svg {
  display: block;
  width: 36px;
  height: 36px;
}
.gallery__item:hover .gallery__icon,
.gallery__item:focus-visible .gallery__icon {
  opacity: 1;
}

/*
 * Lightbox (native <dialog>), measured on the Elementor slideshow: image centred in the viewport with 70px top and bottom
 * and 70px at the sides (none on mobile), "1 / 6" at the top left, close button top right, previous/next zones 15 % of
 * the width (20 % on mobile) with a 25px chevron. WP also shows the attachment title under the image and a
 * fullscreen / zoom / share toolbar; the clone has neither the titles nor those features, so it prints neither.
 */
.lightbox {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.lightbox::backdrop {
  background: var(--color-overlay-lightbox);
}
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__image {
  max-width: calc(100vw - 140px);
  max-height: calc(100vh - 140px);
  object-fit: contain;
}
.lightbox__counter {
  position: absolute;
  top: 18.8px;
  left: 20px;
  color: rgba(237, 237, 237, 0.9);
  font-size: 15px;
  line-height: 1.5;
}
.lightbox__button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(237, 237, 237, 0.9);
  cursor: pointer;
}
.lightbox__button:hover {
  color: var(--color-white);
}
.lightbox__button:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
  color: var(--color-white);
}
.lightbox__close {
  top: 13px;
  right: 15px;
  width: 30px;
  height: 30px;
}
.lightbox__close svg {
  width: 20px;
  height: 20px;
}
.lightbox__nav {
  top: 0;
  bottom: 0;
  width: 15%;
}
.lightbox__nav svg {
  width: 25px;
  height: 25px;
}
.lightbox__nav--prev { left: 0; }
.lightbox__nav--next { right: 0; }

/* Descripción */
.property-section--description {
  padding: 28px 0 16px;
}
.property-description {
  width: 75.998%;
  padding: 15px 0 15px 15px;
  font-size: var(--fs-body);
  line-height: 21.98px;
}
.property-description p + p {
  margin-top: var(--widget-spacing);
}

/* Ubicación */
.property-section--location {
  padding: 37px 0 43px;
}
.location-address {
  display: flex;
  align-items: baseline;
  gap: 3px;
  height: 40px;
  margin-bottom: 20px;
}
.location-address__label {
  color: #54595f;
  font-size: var(--fs-small);
}
.location-address__value {
  color: var(--gray-700);
}
.location-map {
  height: 300px;
}
.location-map .map-canvas {
  height: 100%;
}
.location-map--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--gray-100);
  color: var(--color-text);
  text-align: center;
}

/* Planos de planta: a slick-like slider (the slides sit side by side and the track slides) + dots. WP: the slider is the
   column's width plus 10px on each side, every slide has 10px side padding around its 571px card, dots 10px below. */
.property-section--floor-plans {
  padding: 27px 0 35px;
}
/* the slider and the video widget sit 9px lower than the other widgets in their column */
.property-section--floor-plans .property-section__wide,
.property-section--virtual-tour .property-section__wide {
  padding-top: 24px;
}
.floor-plans {
  margin: 0 -10px;
}
.floor-plans__slide {
  padding: 0 10px;
}
.floor-plans__slide + .floor-plans__slide {
  margin-top: var(--widget-spacing);
}
.floor-plan {
  border: 1px solid var(--gray-300);
  background-color: var(--color-white);
}
.floor-plan__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 61px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-300);
}
.floor-plan__name {
  width: 33%;
  font-size: var(--fs-small);
  line-height: 18px;
  letter-spacing: 0;
}
.floor-plan__stats {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}
.floor-plan__stat {
  display: flex;
  align-items: center;
  color: var(--gray-700);
  line-height: 40px;
}
.floor-plan__stat:not(:last-child) {
  margin-right: 20px;
}
.floor-plan__icon {
  display: flex;
  margin-right: 10px;
}
.floor-plan__icon svg {
  width: 14px;
  height: 14px;
  fill: var(--color-primary);
}
.floor-plan__body {
  padding: 30px 40px 40px;
}
.floor-plan__description {
  margin-bottom: 35px;
  color: var(--color-text);
  line-height: 21.98px;
}
.floor-plan__image {
  display: block;
  max-width: 100%;
  height: auto;
}
.floor-plans.is-enhanced .floor-plans__viewport {
  overflow: hidden;
}
.floor-plans.is-enhanced .floor-plans__track {
  display: flex;
}
.floor-plans.is-enhanced .floor-plans__slide {
  flex: none;
  width: 100%;
  width: round(up, 100%, 1px);
  margin-top: 0;
}
.floor-plans__dots {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}
.floor-plans__dot {
  width: 12px;
  height: 12px;
  margin: 3px 5px;
  padding: 0;
  border: 0;
  border-radius: 100%;
  background-color: var(--gray-300);
  cursor: pointer;
  transition: background 0.3s;
}
/* the numbers WP prints inside its dots: in the text, not on screen */
.floor-plans__dot-number {
  font-size: 0;
}
.floor-plans__dot:hover,
.floor-plans__dot.is-active {
  background-color: var(--color-checkbox-checked);
}

/* Visita virtual: 16:9 */
.property-section--virtual-tour {
  padding: 27px 0 0;
  border-bottom: 0;
}
.virtual-tour {
  aspect-ratio: 16 / 9;
}
.virtual-tour iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Agent box (right column, sticky) ---------- */
/* WP marks the column `jet-sticky-column`, but the box does not stick on the WP site (checked while scrolling): it scrolls away */
.agent-box {
  width: 100%;
  padding: 50px 30px;
  background-color: var(--color-secondary);
}
.agent-box__photo {
  display: block;
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
  object-fit: cover;
}
.agent-box__name {
  font-size: var(--fs-h5);
  line-height: 1.25em;
  text-align: center;
}
.agent-box__name a {
  color: var(--color-white);
}
.agent-box__name a:hover {
  color: var(--color-accent);
}
.agent-box__position {
  margin-bottom: 36px;
  color: var(--gray-400);
  line-height: 1.25em;
  text-align: center;
}
/*
 * Phone row. WP prints two rows (phone, e-mail; ruling P9: the clone never prints the e-mail), each a label widget and a
 * 44px tall value widget, so the row keeps the space of the omitted e-mail row below it (93.9px = its separator, label
 * row and value row): the box and everything after it (the page height on tablet and mobile) match WP.
 * `.agent-box__contact` is the phone number only: the visual gate masks it like WP's value widget.
 */
.agent-box__row {
  display: flex;
  padding-bottom: 93.15px;
}
.agent-box__label {
  margin-right: 5px;
  color: var(--gray-400);
  line-height: 1.72em;
}
.agent-box__phone {
  color: var(--color-accent);
  font-size: var(--fs-h5);
  font-weight: 700;
  line-height: 1.33em;
}
.agent-box__phone:hover {
  color: var(--color-white);
}
.agent-box__contact {
  display: block;
  height: 44.1px;
}
.agent-box__connect {
  margin: 26px 0 37px;
  color: var(--color-white);
  font-size: var(--fs-large);
  font-weight: 500;
  line-height: 1.25em;
}
.agent-box__social {
  display: flex;
  flex-wrap: wrap;
}
.agent-box__social-link {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 19px;
  color: var(--gray-400);
  font-size: 14px;
  line-height: 1em;
}
.agent-box__social-link:hover {
  color: var(--color-accent);
}
.agent-box__social-link::before {
  display: block;
  font-family: 'Font Awesome 5 Free';
  font-style: normal;
  font-weight: 400;
  content: '\2197';
}
.agent-box__social-link--envelope::before { content: '\f0e0'; }
.agent-box__social-link--whatsapp::before { font-family: 'Font Awesome 5 Brands'; content: '\f232'; }
.agent-box__social-link--facebook::before { font-family: 'Font Awesome 5 Brands'; content: '\f09a'; }
.agent-box__social-link--twitter::before { font-family: 'Font Awesome 5 Brands'; content: '\f099'; }
.agent-box__social-link--instagram::before { font-family: 'Font Awesome 5 Brands'; content: '\f16d'; }
.agent-box__social-link--linkedin::before { font-family: 'Font Awesome 5 Brands'; content: '\f08c'; }
.agent-box__social-link--youtube::before { font-family: 'Font Awesome 5 Brands'; content: '\f167'; }
/* WP renders the phone icon with the regular weight, which FA5 Free lacks: an empty 14x14 box. Same here. */
.agent-box__social-link--phone::before { content: ''; }

/* ---------- 4. Propiedades similares ---------- */
.similar-properties {
  padding: 70px 0;
}
.similar-properties__heading .button--link {
  line-height: 21.98px;
}
.similar-properties__heading {
  padding-bottom: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
}
.similar-properties__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: calc(100% + 30px);
  margin: 20px -15px 0;
}
.similar-properties__item {
  padding: 15px;
}
/* WP: the card is 370px wide and centred in its grid cell when the cells are wider (tablet) */
.similar-properties__item .property-card {
  max-width: 370px;
  margin-inline: auto;
}
.similar-properties .container:last-child {
  padding: 0 15px 15px;
}

@media (max-width: 1024px) {
  .property-summary__price { width: 26%; }
  .property-summary__specs { width: 74%; }
  .property-summary__action { width: 100%; }
  .property-main { padding-bottom: 65px; }
  .property-main__content,
  .property-main__aside { width: 100%; }
  /* WP: the 370px box is centred below the content */
  .agent-box {
    max-width: 370px;
    margin-inline: auto;
  }
  .similar-properties { padding: 55px 0; }
  .similar-properties__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .lightbox__image { max-width: 100vw; }
  .lightbox__nav { width: 20%; }
  .lightbox__nav--prev { justify-content: flex-start; }
  .lightbox__nav--next { justify-content: flex-end; }
  .property-summary__price,
  .property-summary__specs { width: 100%; }
  .property-summary__specs .property-specs {
    margin-inline: -20px;
    padding-left: 0;
    border-left: 0;
  }
  .property-summary__specs .property-specs__item { margin-inline: 20px; }
  .property-summary__specs .property-specs__item:not(:last-child)::after { right: -20px; }
  .property-summary__specs .property-specs__text { line-height: 46px; }
  .property-main { padding-bottom: 45px; }
  .property-main__content { padding-top: 15px; }
  .property-heading { flex-direction: column; gap: 0; }
  .property-heading__main { padding-bottom: 20px; }
  .property-heading__side { align-items: flex-start; }
  .property-section__title,
  .property-section__spacer,
  .property-section__col--a,
  .property-section__col--b,
  .property-section__wide,
  .property-features,
  .property-description { width: 100%; }
  .property-section__col { padding: 0; }
  .property-section__spacer { height: 1px; }
  .property-section__divider {
    width: 100%;
    margin-left: 0;
  }
  /* the content columns lose their side padding; the widgets keep 10px above and below */
  .property-section__wide,
  .property-section--floor-plans .property-section__wide,
  .property-section--virtual-tour .property-section__wide { padding: 10px 0; }
  .property-description { padding: 10px 0; }
  .property-features { padding: 0; }
  .floor-plan__header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 15px;
  }
  .floor-plan__name {
    width: 100%;
    margin-bottom: 10px;
  }
  .floor-plan__body { padding: 20px; }
  .agent-box { text-align: center; }
  .agent-box__row,
  .agent-box__social { justify-content: center; }
  .similar-properties { padding: 40px 0; }
  .similar-properties__heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .similar-properties__grid { grid-template-columns: 1fr; }
  /* WP's srcset picks the 300x221 candidate for the 320px wide card image here, whose ratio (0.7367) differs from the
     original's (0.7361) by 0.17px of height per card; the clone only has the original, so the ratio is stated */
  .similar-properties__item .property-card__image img {
    aspect-ratio: 300 / 221;
    object-fit: cover;
  }
}
