:root {
  --blue: #6495ed;
  --white: #f5f5f5;
  --black: #000000;
  --yellow: #ffd700;
  --green: #28a745;
  --red: #dc3545;
}

* {
  color: var(--fontColor);
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  overscroll-behavior-y: contain;
  /* Bloqueia pull-to-refresh no celular */
}

header {
  color: rgb(253, 249, 249);
  text-align: center;
  font-size: 50px;
}

section {
  background: #f5f5f5;
  border-radius: 10px;
  padding: 15px;
  width: 100%;
  max-width: 500px;
  margin: 10px auto;
  box-shadow: 3px 3px 10px #000000;
  text-align: center;
}

.text-input {
  width: 60px;
  padding: 0.3em;
  font-size: 14px;
  text-align: center;
}

/* ================== Botões com cores específicas ================== */

#adicionar-item {
  background-color: var(--blue);
  color: var(--white);
}

.btn-editar-item {
  background-color: var(--yellow);
  color: var(--black);
}

.btn-salvar {
  background-color: var(--green);
  color: var(--white);
}

.btn-excluir-item {
  background-color: var(--red);
  color: var(--white);
}

#finalizar-compra {
  background-color: var(--green);
  color: var(--white);
  display: block;
  margin: 20px auto;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
}

#limpar-historico {
  background-color: var(--red);
  color: var(--white);
  display: block;
  margin: 10px auto;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
}

/* Hover para todos os botões */
button:hover {
  opacity: 0.8;
  transition: 0.2s;
}

/* Seu CSS existente: temas, responsividade, inputs, botões, lista etc. */


/* ================== Responsividade ================== */

@media (max-width: 768px) {
  body {
    padding: 0 15px;
  }

  header {
    font-size: 40px;
  }

  section {
    max-width: 90%;
    margin: 20px auto;
  }

  .text-input {
    width: 80px;
  }

  #novo-item {
    flex-wrap: wrap;
    gap: 5px;
  }

  li .preco input,
  li .quantidade input {
    width: 70px;
  }

  .btnTema {
    width: 120px;
    height: 45px;
  }

  h2 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0 10px;
  }

  header {
    font-size: 30px;
  }

  section {
    max-width: 100%;
    padding: 10px;
  }

  .text-input {
    width: 50px;
  }

  #novo-item {
    flex-direction: column;
    align-items: center;
  }

  li .preco input,
  li .quantidade input {
    width: 60px;
  }

  .btnTema {
    width: 110px;
    height: 40px;
  }

  h2 {
    font-size: 16px;
  }

  footer {
    font-size: 14px;
  }
}

/* ================== Lista de compras ================== */

li {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

li .preco input,
li .quantidade input {
  width: 50px;
}

.light-theme {
  --bg: var(--blue);
  --fontColor: var(--black);
  --btnFontColor: var(--white);
  --btnBg: var(--black);
}

.dark-theme {
  --bg: var(--black);
  --fontColor: var(--black);
  --btnFontColor: var(--black);
  --btnBg: var(--white);
}

#novo-item input[type="number"] {
  width: 110px;
  padding: 0.3em;
  font-size: 14px;
  margin-right: 10px;
}

#novo-item {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--blue);
}

ul#lista-de-compras {
  list-style-type: none;
  margin-top: 20px;
  padding: 0;
}

ul#lista-de-compras li {
  margin-bottom: 10px;
}

h2 {
  text-align: center;
}

footer {
  --fontColor: var(--white);
  text-align: center;
  font-style: italic;
}

.btnTema {
  color: var(--btnFontColor);
  background-color: var(--btnBg);
  position: relative;
  height: 50px;
  width: 100px;
  border-radius: 10px;
  border: none;
}

.btnTema:hover {
  background-color: var(--btnFontColor);
  color: var(--btnBg);
  cursor: pointer;
}