/* =============================================
   components/hero/hero.css
============================================= */

/* ── Hero principal ── */
.hero {
  position: relative;
  background: linear-gradient(
    135deg,
    var(--azul-escuro) 0%,
    var(--azul-medio) 60%,
    var(--azul-claro) 100%
  );
  color: var(--branco);
  overflow: hidden;
  padding: 5rem 0 2.5rem;
}
#busca-hero {
  outline: none; /* Remove o quadro ao clicar */
}
#busca-hero:focus {
  border-color: var(--azul-claro); /* Adiciona uma borda ao focar */
}

/* ── Shapes decorativos de fundo ── */
.hero__bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
}
.shape--1 {
  width: 400px;
  height: 400px;
  background: var(--branco);
  top: -100px;
  right: -80px;
}
.shape--2 {
  width: 200px;
  height: 200px;
  background: var(--azul-claro);
  bottom: -60px;
  left: 10%;
  opacity: 0.25;
}
.shape--3 {
  width: 120px;
  height: 120px;
  background: var(--branco);
  top: 30%;
  right: 25%;
}

/* ── Conteúdo centralizado ── */
.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem; /* evita colar nas bordas em mobile */
}

/* ── Badge "Versão beta" ── */
.hero__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

/* ── Título principal ── */
.hero__title {
  font-family: var(--fonte-titulo);
  font-size: clamp(1.75rem, 5vw, 3.2rem); /* fluido — nunca quebra em mobile */
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.hero__title span {
  background: linear-gradient(90deg, #93c5fd, #bfdbfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Subtítulo ── */
.hero__subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  opacity: 0.9;
  margin-bottom: 2.5rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ── Barra de busca ── */
.hero__search {
  max-width: 600px;
  margin: 0 auto;
}

/* Customização específica para o Hero */
.search-bar--hero {
  display: flex;
  align-items: center;
  background: var(--branco);
  border-radius: 100px;
  border: none;
  /* Sombra ligeiramente mais imponente por estar em cima do gradiente */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  /* Padding ligeiramente maior para dar mais "respiro" no Hero */
  padding: 0.7rem 0.8rem 0.7rem 1.4rem;
  gap: 0.5rem;
  width: 100%;
  max-width: 540px; /* Evita que a barra estique demais em tablets */
  margin: 0 auto; /* Centraliza na tela */
  transition: box-shadow 0.2s, transform 0.2s;
}

/* Efeito de foco focado em profundidade */
.search-bar--hero:focus-within {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px); /* Leve elevação profissional ao focar */
}

/* Input interno do Hero */
.search-bar--hero .search-bar__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--texto);
  background: transparent;
  min-width: 0;
}

.search-bar--hero .search-bar__input::placeholder {
  color: var(--cinza);
  opacity: 0.85;
}

/* O novo botão de ícone para o Hero */
.search-bar__btn-hero {
  background: none;
  border: none;
  padding: 0.6rem;
  color: var(--azul-medio); /* Destaque na lupa para convidar ao clique */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.25rem; /* Ícone ligeiramente maior e imponente */
  transition: transform 0.1s ease, background-color 0.2s, color 0.2s;
}

/* Feedback tátil ao clicar no botão do Hero */
.search-bar__btn-hero:active {
  transform: scale(0.9);
  background-color: var(--azul-ultraclaro);
}

/* Ajuste rápido para o Modo Escuro, se necessário */
html.dark .search-bar__btn-hero {
  color: var(--azul-claro);
}
html.dark .search-bar__btn-hero:active {
  background-color: rgba(59, 130, 246, 0.15);
}

/* ── Tags de busca rápida ── */
.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.25rem;
  appearance: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--branco);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transicao);
  /* impede que a tag quebre o texto no meio */
  white-space: nowrap;
}
.tag:hover {
  background: rgba(255, 255, 255, 0.28);
}
/* Touch: área mínima de 44px para acessibilidade mobile */
@media (max-width: 768px) {
  .tag {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* ─────────────────────────────────────────────
   Bloco "Como funciona"
   Desktop → 3 colunas centradas
   Mobile  → coluna única
───────────────────────────────────────────── */
#como-funciona {
  text-align: center;
}

/* Os cards já usam cards-grid--3 do global,
   mas garantimos o comportamento aqui também */
#como-funciona .cards-grid--3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

#como-funciona .card--feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 0.75rem;
}

#como-funciona .card__icon {
  font-size: 2.5rem;
  line-height: 1;
}

#como-funciona .card--feature h3 {
  font-family: var(--fonte-titulo);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

#como-funciona .card--feature p {
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  #como-funciona .cards-grid--3 {
    grid-template-columns: 1fr; /* coluna única no mobile */
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── CTA Vendedor ── */
.cta-vendedor {
  background: linear-gradient(135deg, var(--azul-escuro), var(--azul-medio));
  color: var(--branco);
  padding: 3.5rem 0;
}
.cta-vendedor__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-vendedor h2 {
  font-family: var(--fonte-titulo);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.cta-vendedor p {
  opacity: 0.9;
  max-width: 500px;
}

/* ─────────────────────────────────────────────
   Responsividade geral do hero
───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero__title {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  .hero__subtitle {
    font-size: 0.97rem;
    margin-bottom: 1.75rem;
  }

  /* Search bar ocupa largura total no mobile */
  .hero__search {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .cta-vendedor__inner {
    text-align: center;
    justify-content: center;
  }
  .cta-vendedor {
    margin-bottom: -1rem;
  }

  /* Shapes menores para não pesar visualmente */
  .shape--1 {
    width: 250px;
    height: 250px;
    top: -60px;
    right: -60px;
  }
  .shape--2 {
    width: 140px;
    height: 140px;
  }
  .shape--3 {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero__badge {
    font-size: 0.78rem;
    padding: 0.28rem 0.8rem;
  }

  .hero__tags {
    gap: 0.45rem;
  }

  .cta-vendedor {
    padding: 2.5rem 0;
  }

  .cta-vendedor h2 {
    font-size: 1.35rem;
  }
}

.categorias-carrossel {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  justify-content: center;
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 0.5%,
    rgba(0, 0, 0, 1) 99.5%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 0.5%,
    rgba(0, 0, 0, 1) 99.5%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
@media (max-width: 768px) {
  .categorias-carrossel {
    /* Garante que se houver muitos chips, eles comecem da esquerda para scroll correto */
    justify-content: flex-start;
    /* Adiciona um preenchimento nas laterais para o chip não colar na borda do ecrã */
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
.categorias-carrossel::-webkit-scrollbar {
  display: none;
}
.categoria-chip {
  flex: 0 0 85px;
  scroll-snap-align: start;
  scrollbar-width: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: var(--branco, #fff);
  border: 1px solid var(--borda, #e5e7eb);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--texto);
  cursor: pointer;
  touch-action: pan-y;
}
.categoria-chip__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--azul-suave, #eff6ff);
  color: var(--azul-medio, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.categoria-chip:focus-visible {
  outline: 2px solid var(--azul-medio, #2563eb);
}
html.dark .categoria-chip__icon {
  color: #eff6ff;
  background: var(--azul-medio);
}
html.dark .categoria-chip {
  border: 1px solid var(--azul-medio);
  background: var(--azul-suave);
}
