* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: linear-gradient(
    to bottom,
    #01080E 10%,
    #FFF 10%,
    #FFF 90%,
    #01080E 90%
  );
  padding: 7vh 8vw 5vh;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
}

button {
  background: inherit;
  color: inherit;
  border: 0;
}

select {
  appearance: none;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
}

.texto-medio-azul {
  color: #1875E8;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 110%;
}

.texto-azul {
  color: #1875E8;
}

.conteudo-principal {
  filter: drop-shadow(0px 0px 70px rgba(2, 189, 255, 0.4));
  padding: 10rem 10rem;

  max-width: 1400px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1.375fr 1fr;
  gap: 5rem;

  background: white url('./assets/frieren.jpg') no-repeat left bottom;
  background-size: auto 40%;
  position: relative;
}

.grafismo-azul {
  position: absolute;
  width: 31.9375rem;
  height: 2.0625rem;
  background: url('./assets/grafismo-azul.svg') no-repeat;
  top: -1rem;
}

.titulo {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 5rem;
  font-weight: 700;
  line-height: 100%;
  margin-bottom: 2.5rem;
}

.formulario {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.campo-grupo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.produto-input {
  width: 100%;
  max-width: 40rem;
  height: 3.5rem;
  padding: 1rem 3.5rem 1rem 1rem;

  border-radius: 0.5rem;
  border: 1px solid #1875E8;

  font-size: 1.25rem;
  font-style: italic;

  background: url('./assets/arrow-down.svg') no-repeat right 1rem center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parte-inferior {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.quantidade-input {
  width: 4.5rem;
  height: 3.5rem;
  padding: 1rem;

  border-radius: 0.5rem;
  border: 1px solid #1875E8;

  font-size: 1.25rem;
  font-style: italic;
}

.botoes-wrapper {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.botao-form {
  width: 13rem;
  height: 3.25rem;
  border-radius: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

.botao-adicionar {
  background: #1875E8;
  color: #FFF;
  box-shadow: 0 0 20px rgba(24, 117, 232, 0.5);
}

.botao-limpar {
  background: #01080E;
  color: #FFF;
  box-shadow: 0 0 20px rgba(1, 8, 14, 0.5);
}

.botao-voltar {
  display: inline-block;
  margin-bottom: 2rem;

  background: #F2A6C2;
  color: #01080E;
  text-decoration: none;

  padding: 0.6rem 1.4rem;
  border-radius: 1rem;

  font-size: 1.1rem;
  font-weight: 600;

  box-shadow: 0 0 18px rgba(242, 166, 194, 0.6);
  transition: 0.3s ease;
}

.botao-voltar:hover {
  background: #1875E8;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(24, 117, 232, 0.5);
}

.carrinho {
  width: 100%;
  max-width: 24rem;
  max-height: 420px;

  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.carrinho > img {
  max-width: 72px;
  height: auto;
  display: block;
}

.titulo-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.carrinho__titulo {
  font-size: 1.5rem;
  font-weight: 600;
}

.carrinho__produtos {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
  max-height: 60px;  
  overflow-y: auto;
  padding-right: 0.5rem;
}

.carrinho__produtos__produto {
  font-size: 1.3rem;
  font-style: italic;
}

.divisoria {
  width: 100%;
  height: 1px;
  background: #000;
}

.carrinho__total {
  font-size: 2.25rem;
  font-weight: 700;
}

.preview-produto {
  position: absolute;
  top: 260px;
  left: 120px;

  width: 220px;
  padding: 1rem;
  border-radius: 1rem;

  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);

  display: flex;
  gap: 0.75rem;
  align-items: center;

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.3s ease;
  z-index: 10;
}

.preview-produto.show {
  opacity: 1;
  transform: translateY(0);
}

.preview-produto img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.preview-info {
  max-width: 130px;
}

#preview-nome {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden {
  display: none;
}

@media (max-width: 1024px) {
  .conteudo-principal {
    grid-template-columns: 1fr;
    row-gap: 4rem;
    padding: 6rem 4rem;
    background-size: auto 30%;
    background-position: right bottom;
    background-size: auto 30%;
  }

  .carrinho {
    width: 100%;
    max-height: 500px;
  }

  .carrinho__produtos {
    max-height: 160px;
    overflow-y: auto;
  }

  .divisoria {
    width: 100%;
  }

  .titulo {
    font-size: 4rem;
  }

  .preview-produto {
    position: relative;
    top: auto;
    left: auto;
    margin-top: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    padding: 4vh 5vw;
  }

  .conteudo-principal {
    padding: 4rem 2rem;
    gap: 3rem;
    background-image: none;
  }

  .titulo {
    font-size: 3rem;
  }

  .produto-input {
    width: 100%;
    font-size: 1.1rem;
  }

  .quantidade-input {
    width: 100%;
  }

 .parte-inferior {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }

  .botoes-wrapper {
    flex-direction: column;
  }

  .botao-form {
    width: 100%;
  }

  .botao-voltar {
    width: 100%;
    text-align: center;
  }

  .carrinho {
    width: 100%;
    max-height: 140px;
  }

  .carrinho > img {
    max-width: 56px;
  }

  .preview-produto {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
  }

  .preview-produto.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 480px) {
  .carrinho > img {
    max-width: 48px;
  }

  .carrinho {
    max-height: 180px;
  }

  .titulo {
    font-size: 2.4rem;
  }

  .texto-medio-azul {
    font-size: 1.2rem;
  }

  .carrinho__total {
    font-size: 1.8rem;
  }

  .carrinho__produtos {
    max-height: 200px;
  }

}
