/* ═══════════════════════════════════════════════════════
   Vivale Hero Search Bar v3 — Premium Two-Row
   ═══════════════════════════════════════════════════════ */

.vivale-hero-search {
  position: relative;
  width: 100%;
  padding: 48px 24px 56px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  z-index: 50;
}

.vivale-hero-search__content {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.vivale-hero-search__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 28px 0;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* ── Form ── */
.vivale-hero-search__form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Rows ── */
.vivale-hero-search__row {
  display: flex;
  align-items: stretch;
  background: #fff;
  position: relative;
}

.vivale-hero-search__row--main {
  border-radius: 18px 18px 0 0;
  padding: 6px;
  box-shadow:
    0 -1px 3px rgba(0,0,0,0.04),
    0 4px 20px rgba(0,0,0,0.08),
    0 0 0 1px rgba(0,0,0,0.04);
  z-index: 2;
}

.vivale-hero-search__row--filters {
  border-radius: 0 0 18px 18px;
  padding: 2px 6px;
  background: #f8fafc;
  border: 1px solid #e8edf2;
  border-top: 1px solid #eef2f6;
  z-index: 1;
  gap: 0;
}

/* ── Toggle (Comprar / Alquilar) ── */
.vivale-hero-search__toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 3px;
  flex-shrink: 0;
}

.vivale-hero-search__toggle-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.vivale-hero-search__toggle-btn:hover {
  color: #1e293b;
}

.vivale-hero-search__toggle-btn.active {
  background: #0075A9;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,117,169,0.35);
}

/* ── Generic Field ── */
.vivale-hero-search__field {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.vivale-hero-search__field::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  height: 56%;
  width: 1px;
  background: #e2e8f0;
}

.vivale-hero-search__field--search {
  flex: 1;
  min-width: 0;
}

/* ── Field Button ── */
.vivale-hero-search__field-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.vivale-hero-search__field-btn:hover {
  background: #f1f5f9;
}

.vivale-hero-search__field-chevron {
  width: 12px;
  height: 12px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

/* ── Input (City) ── */
.vivale-hero-search__field-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}

.vivale-hero-search__field-search-icon {
  position: absolute;
  left: 16px;
  width: 15px;
  height: 15px;
  color: #94a3b8;
  pointer-events: none;
}

.vivale-hero-search__input {
  width: 100% !important;
  border: none !important;
  padding: 12px 16px 12px 42px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  background: transparent !important;
  outline: none !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  height: auto !important;
  line-height: 1.5 !important;
}

.vivale-hero-search__input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}

.vivale-hero-search__input::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}

/* ── Filter Row Buttons ── */
.vivale-hero-search__filter-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.vivale-hero-search__filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  border-radius: 10px;
  transition: all 0.15s ease;
  width: 100%;
  justify-content: center;
}

.vivale-hero-search__filter-btn:hover {
  background: #fff;
  color: #0075A9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.vivale-hero-search__filter-btn svg:first-child {
  color: #0075A9;
  opacity: 0.5;
  width: 13px;
  height: 13px;
}

.vivale-hero-search__filter-btn:hover svg:first-child {
  opacity: 1;
}

.vivale-hero-search__filter-btn .vivale-hero-search__field-chevron {
  width: 11px;
  height: 11px;
  opacity: 0.5;
}

/* Separator between filter buttons */
.vivale-hero-search__filter-field + .vivale-hero-search__filter-field::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: #dde3ea;
}

/* ── Unified Dropdown ── */
.vivale-hero-search__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 25px 60px rgba(0,0,0,0.14),
    0 6px 20px rgba(0,0,0,0.06);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  z-index: 99999;
  padding: 6px;
  border: 1px solid rgba(0,0,0,0.05);
}

.vivale-hero-search__dropdown--cities {
  min-width: 260px;
}

.vivale-hero-search__dropdown.open {
  display: block;
  animation: vivaleDropIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vivaleDropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.vivale-hero-search__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.12s ease;
  font-family: 'Inter', sans-serif;
}

.vivale-hero-search__dropdown-item:hover {
  background: #f0f9ff;
  color: #0075A9;
}

.vivale-hero-search__dropdown-item.selected {
  background: #eff6ff;
  color: #0075A9;
  font-weight: 600;
}

.vivale-hero-search__dropdown-item svg {
  color: #0075A9;
  opacity: 0.35;
  flex-shrink: 0;
}

.vivale-hero-search__dropdown-item:hover svg,
.vivale-hero-search__dropdown-item.selected svg {
  opacity: 1;
}

/* Scrollbar */
.vivale-hero-search__dropdown::-webkit-scrollbar { width: 5px; }
.vivale-hero-search__dropdown::-webkit-scrollbar-track { background: transparent; }
.vivale-hero-search__dropdown::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Submit Button ── */
.vivale-hero-search__submit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  background: linear-gradient(135deg, #0075A9 0%, #005d87 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  flex-shrink: 0;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.vivale-hero-search__submit:hover {
  background: linear-gradient(135deg, #005d87 0%, #004a6c 100%);
  box-shadow: 0 6px 20px rgba(0,117,169,0.35);
  transform: translateY(-1px);
}

.vivale-hero-search__submit:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(0,117,169,0.25);
}

.vivale-hero-search__submit svg {
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .vivale-hero-search {
    padding: 28px 16px 36px;
  }

  .vivale-hero-search__title {
    font-size: 1.35rem;
    margin-bottom: 20px;
  }

  .vivale-hero-search__row--main {
    flex-direction: column;
    border-radius: 18px 18px 0 0;
    padding: 8px;
    gap: 4px;
  }

  .vivale-hero-search__row--filters {
    flex-wrap: wrap;
    border-radius: 0 0 18px 18px;
    padding: 6px;
    gap: 4px;
  }

  .vivale-hero-search__row--filters .vivale-hero-search__filter-field {
    flex: 1 1 46%;
    min-width: 0;
  }

  .vivale-hero-search__toggle {
    width: 100%;
  }

  .vivale-hero-search__toggle-btn {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
  }

  .vivale-hero-search__field {
    width: 100%;
  }

  .vivale-hero-search__field::before {
    left: 10%;
    width: 80%;
    height: 1px;
    top: 0;
  }

  .vivale-hero-search__field-btn {
    width: 100%;
    justify-content: space-between;
    background: #f8fafc;
    border-radius: 10px;
  }

  .vivale-hero-search__field-input-wrap {
    background: #f8fafc;
    border-radius: 10px;
    width: 100%;
  }

  .vivale-hero-search__dropdown {
    left: 0;
    right: 0;
    min-width: unset;
    width: auto;
    max-width: none;
  }

  .vivale-hero-search__submit {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
  }

  .vivale-hero-search__filter-field + .vivale-hero-search__filter-field::before {
    display: none;
  }

  .vivale-hero-search__filter-btn {
    font-size: 12px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 8px;
  }
}

/* ── Divi Override ── */
.et_pb_section .vivale-hero-search,
.et_pb_row .vivale-hero-search,
.et_pb_column .vivale-hero-search {
  overflow: visible !important;
}
.et_pb_section,
.et_pb_row,
.et_pb_column {
  overflow: visible !important;
}
