/*
 * Home page (WP page 7): hero + search bar, "¿Cómo funciona?" tabs, property types, recent properties.
 * docs/design/components/{search-bar,select,range-slider,tabs,buttons,property-card-grid}.md,
 * docs/design/elementor-css/post-7.css. Tabs (.tabs) and the range slider (.range) are also used elsewhere.
 */
[hidden] {
  display: none !important;
}

/* ---- Hero #b478a2e ---- */
.hero {
  padding: 74px 0 125px;
  background-color: var(--color-secondary);
  background-image: url("../images/bg-hero-city-3F5xG0b.png");
  background-position: bottom center;
  background-repeat: repeat-x;
}
.hero__container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  /* Elementor column padding around the heading and the search box */
  padding: var(--gutter);
}
.hero__title {
  margin-bottom: 30px;
  color: var(--color-white);
  text-align: center;
}

/* ---- Search bar: white box, 3 columns ---- */
.search-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--color-white);
}
.search-bar__label {
  margin: 0;
  padding: 17px 0 0 20px;
  border-left: 1px solid var(--gray-300);
  color: var(--gray-700);
  font-size: var(--fs-large);
  font-weight: 400;
  line-height: var(--lh-large);
}
.search-bar__label--group {
  grid-column: 1 / -1;
  border-left: 0;
}
.search-bar__cell {
  display: flex;
  flex-direction: column;
}
.search-bar__cell:not(.search-bar__cell--row2) {
  /* Elementor widget spacing below the hierarchy widget */
  padding-bottom: var(--widget-spacing);
}
.search-bar__cell--row2 {
  border-top: 1px solid var(--gray-300);
}
.search-bar__cell--row2 .search-bar__label {
  padding-top: 16px;
}
.search-bar__select {
  width: 100%;
  height: 35.98px;
  margin: 0;
  padding: 2px 20px 12px 16px;
  border: 0;
  border-left: 1px solid var(--gray-300);
  border-radius: 0;
  background-color: transparent;
  /* Bricks' two 4px triangles */
  background-image: linear-gradient(45deg, transparent 50%, var(--color-select-arrow) 0), linear-gradient(135deg, var(--color-select-arrow) 50%, transparent 0);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 16px) calc(50% + 2px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  white-space: pre;
  appearance: none;
  transition: all 0.2s;
}
/* row 1 cells: the bedrooms select is the only one of row 2 that shares the look (its label has the top border) */
.search-bar__cell--range {
  padding: 8px 20px 6px;
  border-left: 1px solid var(--gray-300);
  background-color: var(--color-white);
}
.search-bar__cell--range .search-bar__label {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
}
.search-bar__values {
  margin-top: -14px;
  color: var(--color-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-align: left;
}
.search-bar__apply {
  display: flex;
  /* the WP widget box starts 1px earlier: its left border sits on the last pixel of the range cell */
  margin-left: -1px;
  border-top: 1px solid var(--gray-300);
  border-left: 1px solid var(--gray-300);
}
.search-bar__button {
  flex: 1;
  padding: 30px 40px 30px 41px;
  border: 0;
  border-radius: 0;
  background-color: var(--color-accent);
  color: var(--color-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-button);
  font-weight: 700;
  line-height: var(--lh-button);
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
}
.search-bar__button:hover,
.search-bar__button:focus {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ---- Range slider (JetSmartFilters range 374) ---- */
.range {
  position: relative;
  /* the slider box is as tall as the 2px track: the thumbs (12px inputs) overflow it, like JetSmartFilters */
  height: 2px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}
.range__track {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  background-color: var(--gray-300);
  transform: translateY(-50%);
}
.range__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent var(--low, 0%), var(--color-secondary) 0, var(--color-secondary) var(--high, 100%), transparent 0) no-repeat 0 100% / 100% 100%;
}
.range__input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 12px;
  margin: 0;
  padding: 0;
  background: transparent;
  outline-offset: 2px;
  pointer-events: none;
  transform: translateY(-50%);
  appearance: none;
  transition: all 0.2s;
}
.range__input:first-of-type {
  z-index: 21;
}
.range__input:last-of-type {
  z-index: 20;
}
.range__input::-webkit-slider-runnable-track {
  height: 12px;
  background: transparent;
  border: 0;
}
.range__input::-moz-range-track {
  height: 12px;
  background: transparent;
  border: 0;
}
.range__input::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-secondary);
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
}
.range__input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-secondary);
  cursor: pointer;
  pointer-events: auto;
}

/* ---- "¿Cómo funciona?" #e4b3977 ---- */
.how {
  padding: 80px 0;
}
.how__container,
.types__container,
.recent__container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.how__title {
  margin-bottom: var(--widget-spacing);
}

/* JetTabs, home variant */
.tabs {
  display: flex;
  flex-direction: column;
}
.tabs__controls {
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  overflow: hidden;
}
.tabs__control {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-family: var(--font-sans);
  cursor: pointer;
}
.tabs__content {
  background-color: var(--color-white);
}
.tabs--how {
  /* the WP tabs widget spans the full 1200px container, its heading keeps the column padding */
  margin: 0 calc(var(--gutter) * -1);
}
.tabs--how .tabs__controls {
  align-self: flex-start;
  background-color: var(--color-white);
}
.tabs--how .tabs__control {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: #242b57;
  font-size: 20px;
  line-height: 21.98px;
}
.tabs--how .tabs__control.is-active {
  border-bottom: 2px solid var(--color-field-border);
}
.tabs--how .tabs__icon {
  display: flex;
  margin-right: 5px;
}
.tabs--how .tabs__icon svg {
  width: 14px;
  height: 14px;
  fill: #242b57;
}
.tabs--how .tabs__content {
  padding: 10px;
}

.how__boxes {
  display: flex;
  flex-wrap: wrap;
}
.how-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  text-align: center;
}
.how__boxes--5 .how-box {
  width: 20%;
}
.how__boxes--3 .how-box {
  width: 33.333%;
}
.how-box__icon svg {
  display: block;
  width: 40px;
  height: 40px;
}
.how-box__title {
  margin-bottom: 10px;
  font-size: var(--fs-h5);
  font-weight: 500;
  line-height: 1.25em;
}

/* ---- Property types "Encuentra tu propiedad" (listing 414) ---- */
.types {
  padding: 85px 0 12px;
}
.types__container {
  padding-bottom: var(--gutter);
}
.recent__container {
  padding-top: var(--gutter);
}
.types__title {
  margin-bottom: 0;
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--grid-gap);
  /* the WP listing grid (1200px wide, list margin -15px) carries 15px of padding around its items */
  margin: var(--widget-spacing) calc(var(--gutter) * -1) 0;
  padding: var(--gutter);
  list-style: none;
}
.type-card__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  max-width: 210px;
  /* WP keeps the 210px card centred in its (tablet/mobile wider) column */
  margin-inline: auto;
  padding: 35px 30px 30px;
  background-color: var(--gray-100);
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0);
  text-align: center;
  transition: background 0.3s, border 0.3s, border-radius 0.3s, box-shadow 0.3s;
}
.type-card__link:hover {
  background-color: transparent;
  box-shadow: var(--shadow-type-card-hover);
}
.type-card__icon {
  display: block;
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
}
.type-card__icon img {
  display: block;
  width: 60px;
  height: 60px;
}
.type-card__name {
  color: var(--gray-700);
  font-size: var(--fs-h5);
  font-weight: 400;
  line-height: 1.5em;
}
.type-card__link:hover .type-card__name {
  color: var(--color-primary);
}
.type-card__count {
  color: var(--color-text);
}

/* ---- Recent properties (listing 252, 3 columns) ---- */
.recent {
  padding: 30px 0 40px;
}
.recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
}
.recent__more {
  /* WP sits the link 1px above the heading's centre line */
  margin-bottom: 2px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  /* same 15px listing padding as .type-grid */
  margin: var(--widget-spacing) calc(var(--gutter) * -1) var(--gutter);
  padding: var(--gutter);
}
/* WP paints these photos from the srcset candidate its `sizes` picks (1440x1060 on desktop, 1024x754 on tablet,
   600x442 on mobile), whose rounded ratios differ by up to 0.07 %; the clone serves one file, which would drift by
   0.2px per card row: keep WP's box per viewport */
.card-grid__item .property-card__image img {
  aspect-ratio: 1440 / 1060;
  object-fit: cover;
}
/* the WP listing item is wider than the 370px card (tablet: 2 columns of 482px): the card sits centred in it */
.card-grid__item .property-card--grid {
  margin-inline: auto;
}

@media (max-width: 1024px) {
  .card-grid__item .property-card__image img {
    aspect-ratio: 1024 / 754;
  }
  .hero {
    padding: 65px 0 100px;
  }
  .how__boxes--5 .how-box,
  .how__boxes--3 .how-box {
    width: 33.34%;
  }
  .type-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .recent {
    padding-bottom: 25px;
  }
}

@media (max-width: 767px) {
  .card-grid__item .property-card__image img {
    aspect-ratio: 600 / 442;
  }
  .hero {
    padding: 40px 0 100px;
  }
  /* the group keeps WP's quirk: the three selects stay 33.33% wide, stacked */
  .search-bar {
    grid-template-columns: 1fr;
  }
  .search-bar__cell:not(.search-bar__cell--row2) {
    width: 33.333%;
    padding-bottom: 0;
  }
  /* only the last of the three keeps the Elementor widget spacing below it */
  .search-bar__cell:not(.search-bar__cell--row2):has(+ .search-bar__cell--row2) {
    padding-bottom: calc(var(--widget-spacing) - 0.9px);
  }
  .search-bar__label {
    border-left: 0;
    border-top: 1px solid var(--gray-300);
  }
  .search-bar__label--group {
    /* WP keeps the (invisible) 1px top border on the group label too */
    border-top: 1px solid transparent;
  }
  .search-bar__select {
    border-left: 0;
  }
  .search-bar__cell--range {
    border-left: 0;
  }
  .search-bar__apply {
    margin-left: 0;
    border-left: 0;
  }
  .search-bar__button {
    padding: 20px;
  }
  .how__boxes--5 .how-box,
  .how__boxes--3 .how-box {
    width: 100%;
  }
  .type-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }
  .recent {
    padding-bottom: 10px;
  }
  .recent__head {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
}
