* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 130%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
  background: #555;
}

main {
  flex: 1;
}

body > button:last-of-type {
  display: block;
  border: none;
  font-size: 20px;
  width: 50%;
  padding: 0.5rem;
  margin: 20px auto;
  max-width: 100%;
}
body > button:last-of-type:hover {
  border: 1px solid dodgerblue;
}

ul {
  padding: 0;
}

li {
  list-style: none;
  padding-block: 5px;
}

#produtos {
  display: flex;
  justify-content: space-around;
}

#produtos li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 1px solid;
  padding-inline: 10px;
  border-radius: 8px;
  gap: 10px;
  margin: 10px;
}

.cart-body li:last-child {
  margin-bottom: 10px;
}

.cart-body li {
  display: flex;
  max-width: 400px;
  width: 100%;
  justify-content: space-between;
}

button {
  outline: none;
  border: none;
  padding: 0.2rem;
  border-radius: 8px;
  height: 40px;
  cursor: pointer;
  width: 100%;
  font-weight: bold;
}

#carrinho button {
  color: rebeccapurple;
  max-width: 25px;
  max-height: 25px;
}

button:hover {
  box-shadow: 0 0 2px royalblue;
  transition: 1s;
}

#produtos button:hover {
  border: 1px solid royalblue;
}
section {
  background: #333;
  margin-block: 10px;
  border-radius: 8px;
}
section > :not(:first-child) {
  padding-inline: 20px;
}
section h2 {
  padding-inline: 20px;
}

/*    section:hover{
          box-shadow: 0 0 10px royalblue;
         } */

footer {
  margin-top: 50px;
  font-size: 12px;
  width: 100%;
  text-align: center;
}

.cart {
  max-width: 300px;
  width: 100%;
  overflow-y: scroll;
  height: 350px;
  position: relative;
}

h1 {
  text-align: center;
  padding: 0.2em;
}

/* all h1 not h1 in .top-cart class */
h1:not(.top-cart h1) {
  background: #444;
}

.cart h1 {
  position: sticky;
  top: 0;
  width: 100%;
}

.cart h2 {
  text-align: center;
}

.total {
  text-align: center;
}

.total + button {
  text-align: center;
  margin-top: 10px;
  margin: 0 auto;
  display: block;
}

.shopping-list {
  flex: 0 1 360px;
}

@media screen and (max-width: 650px) {
  article {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  #produtos {
    flex-wrap: wrap;
    xflex-direction: column;
  }
}

/* top cart */
.container {
  display: none;
  width: 100%;
  max-height: 50vh;
  padding: 0.5rem;
  background: #222;
  overflow-y: scroll;
  border-radius: 8px;
}

.top-cart {
  position: absolute;
  top: 0;
  right: 10px;
  cursor: pointer;
  max-width: 300px;
  width: fit-content;
}
.cart-icon {
  text-align: right;
  float: right;
}
.cart-body button {
  width: 25px;
  height: 25px;
}

#removeitem:hover,
.cartFooter button:hover {
  border: 1px solid blueviolet;
  color: #222;
}

.top-cart:hover .container {
  display: block;
}

.cartFooter button {
  height: 25px;
}

.cartFooter {
  background: #181818;
  width: 100%;
  position: absolute;
  left: 0;
  bottom: 10px;
  transform: translateY(60px);
  padding: 0.5rem;
}

figure img {
  width: 100px;
}
