/* ============================================================ 
   HERO — centralização e largura
   ============================================================ */

.wp-block-cover,
.wp-block-cover.is-style-hero,
.hero, .home-hero, .site-hero {
  background-position: center center !important;
  background-size: cover !important;
  display: flex;
  align-items: center;       /* centro vertical */
  justify-content: center;   /* centro horizontal */
  min-height: var(--hero-height-desktop, 520px);
}

@media (max-width: 768px){
  .wp-block-cover,
  .wp-block-cover.is-style-hero,
  .hero, .home-hero, .site-hero {
    min-height: var(--hero-height-mobile, 340px);
  }
}

.wp-block-cover__inner-container,
.hero .hero-inner, .home-hero .hero-inner, .site-hero .hero-inner {
  width: 100%;
  max-width: 1400px;         /* ↑ permite a barra crescer */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding-left: var(--hero-inner-px, 0px);
  padding-right: var(--hero-inner-px, 0px);
}

.wp-block-cover__inner-container > *,
.hero .hero-inner > *, .home-hero .hero-inner > *, .site-hero .hero-inner > * {
  margin-left: auto;
  margin-right: auto;
}

.wp-block-cover__inner-container h1,
.wp-block-cover__inner-container h2,
.wp-block-cover__inner-container h3,
.hero .hero-inner h1, .hero .hero-inner h2, .hero .hero-inner h3,
.home-hero .hero-inner h1, .home-hero .hero-inner h2, .home-hero .hero-inner h3,
.site-hero .hero-inner h1, .site-hero .hero-inner h2, .site-hero .hero-inner h3 {
  text-align: center;
  line-height: 1.1;
  margin: 0 auto 6px;
  color: var(--hero-title-color, var(--page-text, #111827));
}

/* Caso o hero use <img> em vez de background */
.wp-block-cover img,
.hero img, .home-hero img, .site-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* ============================================================
   RESET de wrappers no HERO (evita “painel branco” atrás)
   ============================================================ */
.hero .wp-block-group,
.home-hero .wp-block-group,
.site-hero .wp-block-group,
.hero .wp-block-cover__inner-container > div.has-background,
.home-hero .wp-block-cover__inner-container > div.has-background,
.site-hero .wp-block-cover__inner-container > div.has-background {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* Se existirem estilos genéricos para .search no tema, neutralize-os no HERO */
.hero .search:not(.corretor-search),
.home-hero .search:not(.corretor-search),
.site-hero .search:not(.corretor-search) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ============================================================
   BARRA DE BUSCA (form .corretor-search)
   ============================================================ */
.corretor-search {
  --search-bg: var(--surface, #ffffff);
  --search-bd: var(--border, #e5e7eb);
  --search-text: var(--page-text, #111827);
  --search-radius: var(--radius-lg, 12px);
  --search-shadow: var(--shadow-2, 0 6px 18px rgba(0,0,0,.08));
  --search-icon-img: var(--search-icon, none);

  background: var(--search-bg);
  border: 1px solid var(--search-bd);
  border-radius: var(--search-radius);
  color: var(--search-text);
  font-size: 15px;
  box-shadow: var(--search-shadow);
  padding: 5px;

  /* largura e centro no hero */
  width: min(1280px, 98%);
  margin: 0 auto;

  /* grade base (desktop) */
  display: grid;
  grid-template-columns: 1fr 1fr 56px;
  gap: 0;
  align-items: stretch;

  position: relative;
  z-index: 2;
}

/* Campos nativos (desktop) */
.corretor-search select,
.corretor-search input {
  border: none;
  background: transparent;
  height: 100%;
  border-right: 1px solid var(--search-bd);
  font-size: 15px;
  color: var(--search-text);
     padding-right: 300px;
    padding-left: 30px;
}
.corretor-search select:last-of-type,
.corretor-search input:last-of-type {
  border-right: none;
}

/* Botão (desktop) */
.corretor-search button[type="submit"],
.corretor-search .btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: transparent;              /* esconde texto, mostra apenas o ícone */
  border-radius: 10px;
  width: 56px;
  height: 44px;
  margin: 6px;
  cursor: pointer;
  background-image: var(--search-icon-img);
  background-repeat: no-repeat;
  background-position: center;
  background-size: var(--search-icon-size, 20px 20px);
  box-shadow: none;
}

/* ============================================================
   MOBILE (até 640px) — pílulas + sheet overlay full-width
   ============================================================ */
@media (max-width: 640px){

  /* Garante que nada “recorte” a sheet no mobile */
  #home-hero,
  .home-hero,
  [data-el="home.hero"],
  .wp-block-cover,
  .wp-block-cover.is-style-hero {
    overflow: visible !important;
    z-index: 5; /* hero acima do fluxo normal */
  }

  .corretor-search{
    padding: 10px;
    width: 94%;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) 44px;
    column-gap: 8px;
    row-gap: 0;
    align-items: center;
    grid-auto-flow: column; /* mantém na primeira linha */
  }

  /* Fallback nativo (sem UI pills) — mantém visual unificado */
  .corretor-search select{
    width: 100%;
    background: transparent;
    color: var(--search-text) !important;
    border: none;
    border-radius: 0;
    padding: 12px 14px;
    appearance: none; -webkit-appearance: none;
    font-size: 16px;
    min-height: 44px;
  }
  .corretor-search select:first-of-type{
    border-right: 1px solid var(--search-bd);
  }

  /* ===== Modo “pílulas” (is-enhanced) ===== */
  .corretor-search.is-enhanced select{
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    border: 0 !important;
    padding: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    pointer-events: none !important;
  }

  /* UI “pílulas” — ocupam o lugar dos selects */
  .corretor-search.is-enhanced .cs-pill{
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    width: 100%;
    padding: 12px 14px;

    background: transparent !important;   /* sem fundo próprio */
    color: var(--search-text) !important;
    border: none !important;              /* sem borda própria */
    border-radius: 0 !important;          /* sem raio próprio */
    box-shadow: none !important;          /* sem sombra própria */

    font-size: 16px;
    line-height: 1.3;
    min-height: 44px;
  }
  /* Traço divisor apenas no 1º campo (como no desktop) */
  .corretor-search.is-enhanced .cs-pill:first-of-type{
    border-right: 1px solid var(--search-bd) !important;
  }
  .corretor-search.is-enhanced .cs-pill .label{
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .corretor-search.is-enhanced .cs-pill::after{
    content: "";
    width: 7px; height: 7px;
    border-right: 2px solid var(--muted, #555);
    border-bottom: 2px solid var(--muted, #555);
    transform: rotate(45deg);
  }

  /* ===== Sheet como OVERLAY ancorado ao cartão ===== */
  .corretor-search .cs-sheet{
    display: none;
    position: absolute;          /* ancorada ao cartão */
    left: 0;
    right: 0;
    top: calc(100% + 8px);       /* abre logo abaixo da barra */
    z-index: 99999;              /* acima de qualquer seção seguinte */
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(0,0,0,.18);
    padding: 10px;
    max-height: 70vh;
    overflow: auto;
    color: var(--page-text, #111827);
  }

  .corretor-search .cs-sheet.is-open{ display: block; }

  .corretor-search .cs-option{
    padding: 16px 18px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--page-text, #111827) !important;
    background: var(--surface, #fff) !important;
    font-size: 18px;
    line-height: 1.35;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .corretor-search .cs-option:hover{
    background: var(--surface-2, #f7f9fc) !important;
  }
  .corretor-search .cs-option[aria-selected="true"]{
    background: var(--surface-2, #f7f9fc) !important;
    font-weight: 600;
  }

  /* Lupa obrigatoriamente na 1ª linha, 3ª coluna */
  .corretor-search > button[type="submit"],
  .corretor-search > .btn-submit{
    grid-column: 3 !important; 
    grid-row: 1 !important;
    width: 44px; height: 40px; 
    margin: 0;
    background-size: 18px 18px; /* garante que a lupa apareça */
    justify-self: center; 
    align-self: center;
  }
}

/* =========================================================
   LISTA / RESULTADOS (acabamento em arquivo dedicado)
   → tokens e layout ficam em stylekit/home-results.css
   ========================================================= */

/* =========================================================
   CTA “Ver todos” — aparência global de botão
   (tokens consumidos pelo StyleKit/presets)
   ========================================================= */
.results-cta .btn.ver-todos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--btn-radius, 8px);
  text-decoration: none;
  font-weight: 700;
  background: var(--btn-bg, var(--accent, #0a66ff));
  color: var(--btn-text, #ffffff);
  box-shadow: var(--btn-shadow, 0 6px 16px rgba(0,0,0,.08));
}
.results-cta .btn.ver-todos:hover {
  background: var(--btn-hover-bg, var(--accent, #0a66ff));
  color: var(--btn-hover-text, #ffffff);
}
