/* Homepage hero finder and carousel controls anchored to it. */

.option-three .o3-hero {
  --o3-finder-bottom: 20px;
  --o3-finder-gutter: 24px;
  --o3-finder-height: 88px;
  --o3-finder-width: min(1280px, calc(100% - (var(--o3-finder-gutter) * 2)));
  --o3-finder-side: calc((100% - var(--o3-finder-width)) / 2);
  --o3-finder-gap: 14px;
  /* Stack above finder: Counter > dots > Buscar/finder. */
  --o3-hero-controls-height: 22px;
  --o3-hero-progress-height: 14px;
  --o3-hero-progress-to-dots: 8px;
  --o3-hero-carousel-chrome: calc(
    var(--o3-finder-gap)
    + var(--o3-hero-controls-height)
    + var(--o3-hero-progress-to-dots)
    + var(--o3-hero-progress-height)
  );
  --o3-hero-stack-height: calc(
    var(--o3-finder-bottom) + var(--o3-finder-height)
  );
  box-sizing: border-box;
  padding-bottom: calc(var(--o3-hero-stack-height) + var(--o3-hero-carousel-chrome) + 12px);
}

.option-three .o3-hero-content {
  position: relative;
  z-index: 3;
  top: auto;
  bottom: auto;
  left: max(6vw, 48px);
  width: min(650px, calc(100% - max(6vw, 48px) * 2));
  max-width: 650px;
  /* Prototype sits the copy at 20% of the hero, below the overlay header. */
  margin-top: clamp(140px, 20svh, 180px);
}

@media (min-width: 921px) {
  .option-three .o3-hero-actions {
    margin-top: 28px;
  }
}

.option-three .o3-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--o3-finder-bottom);
  width: var(--o3-finder-width);
  min-height: var(--o3-finder-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 210px;
  align-items: stretch;
  background: rgba(27, 28, 29, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

.option-three .o3-hero-progress,
.option-three .o3-hero-controls {
  right: var(--o3-finder-side);
}

/* Closest to finder: dots, then counter above them. */
.option-three .o3-hero-controls {
  bottom: calc(var(--o3-finder-bottom) + var(--o3-finder-height) + var(--o3-finder-gap));
}

.option-three .o3-hero-progress {
  bottom: calc(
    var(--o3-finder-bottom)
    + var(--o3-finder-height)
    + var(--o3-finder-gap)
    + var(--o3-hero-controls-height)
    + var(--o3-hero-progress-to-dots)
  );
}

.option-three .o3-search label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  column-gap: 11px;
  row-gap: 2px;
  padding: 0 22px;
  color: #fff;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, .18);
}

.option-three .o3-search label > svg {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  justify-self: center;
  width: 17px;
  height: 17px;
  color: #aeb0ae;
  display: block;
  flex-shrink: 0;
}

.option-three .o3-search label > span {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #c8c9c7;
}

.option-three .o3-search label > select,
.option-three .o3-search label > .mv-select {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  width: 100%;
  min-width: 0;
}

.option-three .o3-search select.mv-select__native {
  border: 0;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: none;
}

.option-three .o3-search > .o3-button {
  font-size: 12px; /* experiment -3px: 9px */
  min-height: 52px;
  height: 52px;
  margin: 18px;
  padding: 0 24px;
  align-self: center;
  white-space: nowrap;
}

/* Wide but short viewports: tighten hero copy so it fits above the finder. */
@media (min-width: 761px) and (max-height: 860px) {
  .option-three .o3-hero-content {
    margin-top: clamp(140px, 20svh, 170px);
  }

  .option-three .o3-hero h1 {
    font-size: var(--mv-text-h1, clamp(44px, 4.6vw, 64px));
    margin-bottom: 14px;
  }

  .option-three .o3-hero-content > p:not(.o3-kicker) {
    font-size: 16px; /* experiment -3px: 13px */
    margin-bottom: 16px;
  }

  .option-three .o3-hero-actions {
    gap: 16px;
  }
}

@media (max-width: 1100px) {
  .option-three .o3-search {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 170px;
  }

  .option-three .o3-search label {
    padding: 0 16px;
  }

  .option-three .o3-search > .o3-button {
    margin: 18px 12px;
  }
}

@media (max-width: 760px) {
  .option-three .o3-hero {
    --o3-finder-bottom: 20px;
    --o3-finder-gutter: 18px;
    --o3-finder-height: 268px;
  }

  .option-three .o3-hero-content {
    left: 24px;
    width: auto;
    max-width: none;
    margin-top: 78px;
    /* Keep Ver proyectos above Counter > dots > finder. */
    padding-right: 96px;
    padding-bottom: calc(var(--o3-hero-carousel-chrome) + 8px);
  }

  .option-three .o3-search {
    left: var(--o3-finder-gutter);
    right: var(--o3-finder-gutter);
    width: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    transform: none;
  }

  .option-three .o3-search label {
    padding: 13px 15px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
  }

  .option-three .o3-search label:last-of-type {
    border-bottom: 0;
  }

  .option-three .o3-search > .o3-button {
    width: auto;
    min-height: 52px;
    height: 52px;
    margin: 0 15px 14px;
    font-size: 12px; /* experiment -3px: 9px */
  }

  .option-three .o3-hero-progress,
  .option-three .o3-hero-controls {
    right: var(--o3-finder-gutter);
  }

  .option-three .o3-hero-controls {
    bottom: calc(var(--o3-hero-stack-height) + var(--o3-finder-gap));
  }

  .option-three .o3-hero-progress {
    bottom: calc(
      var(--o3-hero-stack-height)
      + var(--o3-finder-gap)
      + var(--o3-hero-controls-height)
      + var(--o3-hero-progress-to-dots)
    );
  }
}

@media (max-width: 680px) {
  .option-three .o3-search > .o3-button {
    width: calc(100% - 30px);
    margin: 0 15px 14px;
  }
}
