:root {
  --vinho: #5e2b2b;
  --vinho-claro: #f9f4f1;
  --texto: #333;
  --destaque: #c9a24e;
  --branco: #fff;
}

body {
  margin: 0;
  font-family: 'Georgia', serif;
  background: var(--vinho-claro);
  color: var(--texto);
}

.container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  gap: 2rem;
}

/* ===== FILTRO ===== */
.filtro-paises {
  width: 220px;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.filtro-paises h2 {
  font-size: 1.2rem;
  color: var(--vinho);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--destaque);
  padding-bottom: 0.3rem;
}

.filtro-paises ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filtro-paises li {
  padding: 0.6rem 1rem;
  margin: 0.3rem 0;
  background: var(--vinho-claro);
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filtro-paises li:hover,
.filtro-paises .ativo {
  background: var(--vinho);
  color: var(--branco);
  transform: translateX(4px);
}

/* ===== TOPO ===== */
main {
  flex: 1;
}

.topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.topo h1 {
  color: var(--vinho);
  font-size: 2rem;
  border-left: 5px solid var(--destaque);
  padding-left: 0.8rem;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  color: #888;
}

.topo input {
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1px solid #ccc;
  border-radius: 25px;
  min-width: 250px;
  transition: all 0.3s ease;
}

.topo input:focus {
  border-color: var(--destaque);
  box-shadow: 0 0 5px var(--destaque);
  outline: none;
}

/* ===== LISTA DE VINHOS ===== */
.lista-vinhos {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.vinho {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 1rem 1.2rem;
  transition: all 0.3s ease;
}

.vinho:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.vinho img {
  width: 56px;
  height: 56px;
  margin-right: 1.2rem;
}

.vinho .info h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--vinho);
}

.vinho .descricao {
  font-style: italic;
  color: #555;
}

.vinho .preco {
  font-weight: bold;
  color: var(--destaque);
  font-size: 1.1rem;
  margin-left: 1rem;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 1rem;
  }

  .filtro-paises {
    width: 100%;
    overflow-x: auto;
    display: flex;
    padding: 0.5rem;
  }

  .filtro-paises h2 {
    display: none;
  }

  .filtro-paises ul {
    display: flex;
    gap: 0.5rem;
  }

  .filtro-paises li {
    white-space: nowrap;
    font-size: 0.9rem;
  }
}

/* ===== ANIMAÇÃO DE ENTRADA ===== */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vinho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 1rem 1.2rem;
  transition: all 0.3s ease;
  animation: fadeSlideIn 0.5s ease both;
}

/* ===== ANIMAÇÃO EM FILTROS ===== */
.vinho.oculto {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ===== ALINHAMENTO DE CONTEÚDO ===== */
.vinho img {
  width: 56px;
  height: 56px;
  margin-right: 1.2rem;
  flex-shrink: 0;
}

.vinho .info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.vinho .preco {
  font-weight: bold;
  color: var(--destaque);
  font-size: 1.1rem;
  text-align: right;
  min-width: 100px;
  flex-shrink: 0;
}

.vinho:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 700px) {
  .vinho {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .vinho .preco {
    align-self: flex-end;
    margin-top: 0.3rem;
  }
}

/* ===== FILTRO DE TIPO ===== */
.filtro-tipo {
  width: 220px;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.filtro-tipo h2 {
  font-size: 1.2rem;
  color: var(--vinho);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--destaque);
  padding-bottom: 0.3rem;
}

.filtro-tipo ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filtro-tipo li {
  padding: 0.6rem 1rem;
  margin: 0.3rem 0;
  background: var(--vinho-claro);
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filtro-tipo li:hover,
.filtro-tipo .ativo {
  background: var(--vinho);
  color: var(--branco);
  transform: translateX(4px);
}

/* ===== LAYOUT DOS FILTROS ===== */
.filtro-paises,
.filtro-tipo {
  flex-shrink: 0;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
  .filtro-tipo {
    width: 100%;
    overflow-x: auto;
    display: flex;
    padding: 0.5rem;
    margin-top: 1rem;
  }

  .filtro-tipo h2 {
    display: none;
  }

  .filtro-tipo ul {
    display: flex;
    gap: 0.5rem;
  }

  .filtro-tipo li {
    white-space: nowrap;
    font-size: 0.9rem;
  }
}

/* ===== AJUSTE DE SCROLL NA LISTA ===== */
.lista-vinhos {
  max-height: 520px;         /* Exibe até 5 vinhos, o restante com scroll */
  overflow-y: auto;          /* Ativa rolagem vertical */
  padding-right: 0.5rem;     /* Espaço para a barra de rolagem */
  scrollbar-width: thin;     /* Estilo mais discreto no Firefox */
  scrollbar-color: var(--vinho) #eee;
}

/* ===== ESTILO DA SCROLLBAR (Chrome, Edge, Safari) ===== */
.lista-vinhos::-webkit-scrollbar {
  width: 8px;
}

.lista-vinhos::-webkit-scrollbar-thumb {
  background-color: var(--vinho);
  border-radius: 8px;
}

.lista-vinhos::-webkit-scrollbar-track {
  background: #eee;
  border-radius: 8px;
}

/* ===== IMPEDIR QUE FILTROS CRESÇAM ===== */
.filtro-paises,
.filtro-tipo {
  max-height: 550px;          /* Altura fixa agradável */
  overflow-y: auto;           /* Rolagem interna, se necessário */
}

/* ===== SCROLLBAR INTERNA DOS FILTROS ===== */
.filtro-paises::-webkit-scrollbar,
.filtro-tipo::-webkit-scrollbar {
  width: 6px;
}

.filtro-paises::-webkit-scrollbar-thumb,
.filtro-tipo::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 10px;
}
