/* ==========================================================================
   Home Theme CSS — Fase 6
   ========================================================================== */

/* Seção 0 — Tokens locais da home (usados apenas nesta página) */
body.ref-page-home {
  --home-primary:          #231F5C;
  --home-secondary:        #008797;
  --home-accent:           #FFB800;
  --home-bg:               #fcf8ff;
  --home-text:             #1a1a2e;
  --home-text-muted:       #474650;
  --home-surface-alt:      #f5f2ff;
  --home-badge-novo:       #2EB872;
  --home-editorial-shadow: 0 10px 30px -5px rgba(13, 5, 72, 0.1);
  --home-hero-overlay:     linear-gradient(to right, rgba(13, 5, 72, 0.85) 0%, rgba(13, 5, 72, 0.3) 100%);
}

/* Base Home */
body.ref-page-home {
  background-color: var(--home-bg, #fcf8ff);
  color: var(--home-text, #1a1a2e);
}

/* Seção 1 — H01: Hero */
.ref-home-hero {
  position: relative;
  height: 85vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ref-home-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-image: none; /* imagem real a definir após upload */
  background-color: var(--home-primary, #231F5C);
}

.ref-home-hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--home-hero-overlay, linear-gradient(to right, rgba(13,5,72,0.85) 0%, rgba(13,5,72,0.3) 100%));
}

.ref-home-hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-8, 32px);
}

.ref-home-hero__tag {
  display: block;
  color: var(--home-accent, #FFB800);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.ref-home-hero__headline {
  color: #fff;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 32px 0;
}

.ref-home-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.ref-home-hero__badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 100px;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.ref-home-hero__badge:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ref-home-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--home-accent, #FFB800);
  color: #000;
  padding: 16px 32px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.ref-home-hero__cta:hover {
  transform: translateY(-2px);
}

/* Seção 2 — H02: Busca Rápida — usa chips da archive via shortcodes do plugin
   archive.css provê os estilos dos chips (.ref-filter-bar .ref-filter-chips-scroll)
   archive.js inicializa painéis, toggle, labels
   home.css apenas posiciona o wrapper e sobrescreve o layout estrutural do .ref-filter-bar */

/* Wrapper externo — posicionado para sobrepor o bottom do hero */
.ref-hs-outer {
  position: relative;
  z-index: 20;
  max-width: 1280px;
  margin: -32px auto 48px;
  padding: 0 var(--space-8, 32px);
}

/* .ref-filter-bar dentro do card da home — remove sticky, add card visual
   Especificidade .ref-hs-outer .ref-filter-bar (0-2-0) > .ref-filter-bar (0-1-0) */
.ref-hs-outer .ref-filter-bar {
  position: static;
  top: unset;
  height: auto;
  min-height: unset;
  border-bottom: none;
  border-radius: var(--ref-radius-lg, 12px);
  box-shadow: var(--home-editorial-shadow, 0 10px 30px -5px rgba(13,5,72,0.1));
  padding: 16px;
}

.ref-hs-outer .ref-filter-bar__inner {
  overflow: visible; /* permite painéis portalizar via body sem clip */
  gap: 8px;
  flex-wrap: wrap;
}

.ref-hs-outer .ref-filter-chips-wrapper {
  overflow: visible;
  height: auto;
}

.ref-hs-outer .ref-filter-chips-scroll {
  overflow: visible; /* painéis são portalados para body — não precisam de overflow */
  flex-wrap: wrap;
  gap: 8px;
}

/* Lado direito: botão Buscar */
.ref-hs-outer .ref-filter-actions {
  border-left: none;
  padding-left: 8px;
  height: auto;
}

/* Sobrescreve height:40px que archive.css aplica a .ref-filter-actions button */
.ref-hs-outer .ref-filter-actions button,
.ref-hs-outer .ref-filter-actions .ref-btn-apply-inline {
  height: auto;
  min-height: unset;
}

/* Botão Buscar */
.ref-hs__buscar {
  background: var(--home-primary, #231F5C);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 28px;
  height: 48px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

.ref-hs__buscar:hover {
  opacity: 0.9;
}

/* Utilities */
.material-symbols-outlined {
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

/* Tablet (640px–1023px) */
@media (max-width: 1023px) {
  .ref-hs-outer {
    margin-top: -24px;
  }
}

/* Mobile (< 640px) */
@media (max-width: 639px) {
  .ref-home-hero {
    height: auto;
    min-height: 70vh;
    align-items: flex-start;
    padding-bottom: 0;
  }
  .ref-home-hero__content {
    margin-top: 100px;
    padding-bottom: 24px;
  }
  .ref-hs-outer {
    margin: 0;
    padding: 12px;
  }
  .ref-hs-outer .ref-filter-bar__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .ref-hs-outer .ref-filter-actions {
    padding-left: 0;
    padding-top: 8px;
  }
  .ref-hs__buscar {
    width: 100%;
    justify-content: center;
  }
}


/* ==========================================================================
   Seção 3/4/5 — H03/H04/H05: Intent Grids (Estágios · Tipos · Bairros)
   Cards idênticos ao [ref_results_grid] — reusa vars --ref-* do plugin
   ========================================================================== */

.ref-home-intent-section {
  padding: 56px 0;
}

.ref-home-intent-section__header {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 var(--space-8, 32px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-home-intent-section__title {
  color: var(--home-primary, #231F5C);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.ref-home-intent-section__bar {
  width: 48px;
  height: 4px;
  background: var(--home-secondary, #008797);
  border-radius: 2px;
}

.ref-home-intent-section__grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-8, 32px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--ref-card-gap-wide, 24px);
  align-items: start;
}

/* --- Card base (espelha .ref-imovel-card) --- */
.ref-home-intent-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--ref-card-bg, #ffffff);
  border: 1px solid var(--ref-border, #e0e0e0);
  border-radius: var(--ref-radius, 8px);
  overflow: hidden;
  position: relative;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--ref-card-shadow, 0 10px 20px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.ref-home-intent-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(35, 31, 92, 0.15);
}

/* --- Thumb (espelha .ref-card-thumb) --- */
.ref-home-intent-card__thumb {
  position: relative;
  width: 100%;
  padding-top: 60%;
  background-color: #f0f0f0;
  overflow: hidden;
  flex-shrink: 0;
}

.ref-home-intent-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ref-home-intent-card:hover .ref-home-intent-card__img {
  transform: scale(1.08);
}

/* Overlay: escurece levemente a imagem para o CTA se destacar */
.ref-home-intent-card__overlay {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
  z-index: 2;
}

/* CTA: pill branco centralizado sobre a imagem */
.ref-home-intent-card__cta {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  color: var(--home-primary, #231F5C);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 100px;
  white-space: nowrap;
  backdrop-filter: blur(2px);
  pointer-events: none; /* clique passa para o <a> pai */
  z-index: 4;
}

/* --- Badges (espelha .ref-card-badges + .ref-badge) --- */
.ref-home-intent-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 5px;
}

.ref-home-intent-card__badge--novo,
.ref-home-intent-card__badge--estagio {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1;
}

.ref-home-intent-card__badge--novo {
  background: rgba(39, 174, 96, 0.9);
  color: #fff;
}

.ref-home-intent-card__badge--estagio {
  background: rgba(255, 255, 255, 0.95);
  color: var(--home-primary, #231F5C);
}

/* --- Wishlist (herda .ref-wishlist-icon do plugin) --- */
/* .ref-wishlist-icon já tem position:absolute top:12 right:12 z-index:11 no ref-grid-card.css */
/* Reset button default — navegador aplica fundo e borda em <button> */
.ref-home-intent-card__wishlist {
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}

/* --- Body (espelha .ref-card-body) --- */
.ref-home-intent-card__body {
  padding: var(--ref-card-padding, 20px);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background: var(--ref-card-bg, #ffffff);
}

/* Tipo (espelha .ref-meta-context) */
.ref-home-intent-card__tipo {
  color: var(--ref-tipo-color, #008797);
  font-size: var(--ref-tipo-size, 13px);
  font-weight: var(--ref-tipo-weight, 400);
  line-height: 1.4;
  margin: 0 0 6px 0;
  text-transform: capitalize;
}

/* Título (espelha .ref-card-title) */
.ref-home-intent-card__title {
  color: var(--ref-card-title-color, #231F5C);
  font-size: var(--ref-card-title-size, 18px);
  font-weight: var(--ref-title-weight, 800);
  line-height: var(--ref-card-line-height, 1.25);
  margin: 0 0 12px 0;
}

/* Bairro (espelha .ref-meta-address) */
.ref-home-intent-card__bairro {
  color: var(--ref-bairro-color, #666666);
  font-size: var(--ref-bairro-size, 13px);
  font-weight: var(--ref-bairro-weight, 400);
  line-height: 1.4;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ref-home-intent-card__bairro .material-symbols-outlined {
  font-size: 14px;
  color: #999;
  flex-shrink: 0;
}

/* Specs (espelha .ref-specs-list) */
.ref-home-intent-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 15px 0;
  color: var(--ref-spec-color, #008797);
  font-size: var(--ref-card-spec-size, 13px);
  font-weight: var(--ref-spec-weight, 400);
}

/* Separador entre specs via pseudo-elemento */
.ref-home-intent-card__specs span + span::before {
  content: " · ";
  color: #ccc;
  margin: 0 2px;
}

/* Preço (espelha .ref-card-price) */
.ref-home-intent-card__price {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-home-intent-card__price-label {
  color: var(--ref-accent, #FFAF00);
  font-size: var(--ref-price-prefix-size, 12px);
  font-weight: 500;
  opacity: 0.9;
  margin: 0;
}

.ref-home-intent-card__price-value {
  color: var(--ref-accent, #FFAF00);
  font-size: var(--ref-card-price-size, 18px);
  font-weight: var(--ref-price-weight, 800);
  margin: 0;
}

/* ==========================================================================
   Seção 6 — H06: CTA Strip
   ========================================================================== */

.ref-home-cta {
  background: var(--home-secondary, #008797);
  padding: 64px 0;
  margin-top: 16px;
}

.ref-home-cta__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-8, 32px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.ref-home-cta__text {
  flex: 1;
}

.ref-home-cta__headline {
  color: #fff;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  margin: 0 0 10px 0;
  line-height: 1.2;
}

.ref-home-cta__sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

.ref-home-cta__actions {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.ref-home-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.ref-home-cta__btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.ref-home-cta__btn--outline {
  border: 2px solid #fff;
  color: #fff;
  background: transparent;
}

.ref-home-cta__btn--primary {
  background: #fff;
  color: var(--home-primary, #231F5C);
  border: 2px solid #fff;
}

/* ==========================================================================
   Responsivo — H03/H04/H05 + H06
   ========================================================================== */

/* Tablet (640px–1023px): 2 colunas */
@media (max-width: 1023px) {
  .ref-home-intent-section__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--ref-card-gap-tablet, 16px);
  }
  .ref-home-cta__inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

/* Mobile (< 640px): 1 coluna */
@media (max-width: 639px) {
  .ref-home-intent-section {
    padding: 40px 0;
  }
  .ref-home-intent-section__header,
  .ref-home-intent-section__grid {
    padding: 0 var(--space-4, 16px);
  }
  .ref-home-intent-section__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .ref-home-cta {
    padding: 48px 0;
  }
  .ref-home-cta__inner {
    padding: 0 var(--space-4, 16px);
  }
  .ref-home-cta__actions {
    flex-direction: column;
    width: 100%;
  }
  .ref-home-cta__btn {
    width: 100%;
  }
}