/* ============================================================
   HUMACITIA — Home Search
   Fichier : assets/css/huma-home-search.css
   ============================================================ */

.huma-home-search {
  width: 100%;
}

/* Row layout */
.huma-home-search__row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

/* Field wrappers */
.huma-home-search__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Labels */
.huma-home-search__label {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  opacity: 0.9;
}

/* Sizes (desktop) */
.huma-home-search__field--quarter {
  flex: 1 1 calc(25% - 14px);
  min-width: 190px;
}

.huma-home-search__field--half {
  flex: 2 1 calc(50% - 14px);
  min-width: 260px;
}

/* Inputs */
.huma-home-search select,
.huma-home-search input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;

  border: 1px solid rgba(0,0,0,.18);
  border-radius: 12px;

  background: #fff;
  color: inherit;

  font-size: 14px;
  line-height: 1.2;

  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

/* Select arrow spacing (best effort) */
.huma-home-search select {
  padding-right: 38px;
}

/* Hover */
.huma-home-search select:hover,
.huma-home-search input[type="text"]:hover {
  border-color: rgba(0,0,0,.28);
}

/* Focus (accessible) */
.huma-home-search select:focus,
.huma-home-search input[type="text"]:focus {
  outline: none;
  border-color: rgba(181, 18, 17, .65); /* rouge Humacitia */
  box-shadow: 0 0 0 3px rgba(181, 18, 17, .18);
}

/* Button */
.huma-home-search__submit {
  min-height: 46px;
  padding: 10px 18px;

  border: 0;
  border-radius: 12px;

  background: #b51211;
  color: #fff;

  font-weight: 700;
  font-size: 14px;
  line-height: 1;

  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  white-space: nowrap;
}

.huma-home-search__submit:hover {
  filter: brightness(1.03);
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
  transform: translateY(-1px);
}

.huma-home-search__submit:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0,0,0,.10);
}

.huma-home-search__submit:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(181, 18, 17, .22), 0 10px 22px rgba(0,0,0,.12);
}

/* Optional: subtle container look (si tu veux l'encadrer via Divi, ignore) */
.huma-home-search.is-boxed {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.08);
  backdrop-filter: blur(6px);
}

/* Responsive */
@media (max-width: 980px) {
  .huma-home-search__field--quarter,
  .huma-home-search__field--half {
    flex: 1 1 100%;
    min-width: 0;
  }

  .huma-home-search__submit {
    width: 100%;
  }
}

/* Dark sections (si ton fond est sombre) */
.et_pb_section.dark .huma-home-search__label,
.et_pb_section.et_pb_with_background .huma-home-search__label {
  color: inherit;
}

/* ============================================================
   DESKTOP: 1 ligne + champs de même largeur
   ============================================================ */
@media (min-width: 981px) {

  .huma-home-search__row{
    flex-wrap: nowrap;          /* ✅ 1 ligne */
    align-items: flex-end;
  }

  /* ✅ On force les 3 champs à la même largeur */
  .huma-home-search__field--quarter,
  .huma-home-search__field--half{
    flex: 1 1 0;                /* mêmes proportions */
    min-width: 0;               /* important pour éviter les débordements */
  }

  /* ✅ Bouton à la largeur de son contenu */
  .huma-home-search__submit{
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* (Optionnel) si tu veux des contrôles strictement même hauteur */
.huma-home-search select,
.huma-home-search input[type="text"],
.huma-home-search__submit{
  min-height: 46px;
}

/* ============================================================
   Uniformiser la hauteur INPUT / SELECT / BUTTON
   ============================================================ */

:root{
  --huma-field-h: 54px; /* ajuste si tu veux plus/moins haut */
}

.huma-home-search select,
.huma-home-search input[type="text"],
.huma-home-search__submit{
  height: var(--huma-field-h);
  min-height: var(--huma-field-h);
  line-height: calc(var(--huma-field-h) - 2px);
  box-sizing: border-box;
}

/* Select : padding spécifique + rendu plus homogène */
.huma-home-search select{
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 12px;
  padding-right: 42px; /* place pour la flèche */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* On remet une flèche propre (optionnel mais conseillé si on enlève l'apparence) */
.huma-home-search__field--quarter,
.huma-home-search__field--half{
  position: relative;
}

.huma-home-search__field select{
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(0,0,0,.55) 50%),
    linear-gradient(135deg, rgba(0,0,0,.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Input */
.huma-home-search input[type="text"]{
  padding: 0 14px;
}

/* Bouton */
.huma-home-search__submit{
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}