/* ==========================================================================
   2. RESET E CONFIGURAÇÕES GLOBAIS
========================================================================== */

/* Remove margens e espaçamentos padrão de todos os elementos */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Inclui padding e border no cálculo do tamanho */
}

h1 {
  color: black;
  cursor: pointer;
}

table {
  width: 85%;
  margin-left: 7%;
  height: 350px;
  text-align: center;
}

.empty-cart {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 12pt;
  font-style: italic;
}

.cart-product-image {
  width: 70px;
  height: 70px;
  /* sem object-fit a foto era esticada para virar um quadrado */
  object-fit: cover;
  border-radius: 4px;
  margin-left: 60px;
  margin-top: -50px;
  margin-bottom: 20px;
  display: block;
}

.product-identification .cart-product-title {
  text-align: center;
  display: block;
  position: relative;
  margin-left: 32%;
  margin-top: -63px;
  width: 50%;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 16px;
  text-align: start;
  font-weight: 500;
  color: rgb(125, 125, 125);
}

.cart-product {
  height: 150px;
  max-height: 150px;
  border-bottom: 1px solid rgb(231, 231, 231);
}

.item-product-price {
  font-family: sans-serif;
  font-style: italic;
  font-weight: 100;
  font-size: 14px;
}

.cart-product-price {
  font-family: sans-serif;
  font-style: italic;
  font-weight: 100;
  font-size: 14px;
}

.cart-total-container {
  background-color: white;
  height: 54px;
  text-align: left;
  border: 1px solid rgb(231, 231, 231);
  border-left: none;
  border-right: none;
}

.cart-total-container strong {
  font-family: sans-serif;
  margin-left: 5px;
}

.cart-total-container span {
  font-family: sans-serif;
  font-style: italic;
  margin-left: 15%;
}

.remove-product-button {
  background: none;
  border: none;
  width: 34px;
  height: 34px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-right: 90%;
  color: #8a8a8a;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* O ícone herda a cor do botão, por isso muda junto no hover */
.remove-product-button svg {
  width: 21px;
  height: 21px;
  display: block;
}

.remove-product-button:hover,
.remove-product-button:focus-visible {
  color: #d64545;
  background-color: #fdecec;
}

.remove-product-button:focus-visible {
  outline: 2px solid #d64545;
  outline-offset: 1px;
}

/* .cart-product:hover {
  transform: translateX(-40px);
} */

.product-qtd-input {
  width: 35px;
  height: 30px;
  text-align: center;
  font-family: sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.cupon-container {
  margin-top: 20px;
  display: flex;
}

.cupon-button {
  width: 30%;
  height: 40px;
  border: 1px solid black;
  cursor: pointer;
  color: black;
  background-color: white;
  font-weight: 600;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  margin-right: 20px;
  cursor: pointer;
}

.aplication-cupon-button {
  width: 30%;
  height: 40px;
  border: none;
  cursor: pointer;
  color: white;
  background-color: rgb(39, 158, 133);
  font-weight: 600;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
}

/* inline-flex no lugar de floats: com float, o "+" quebrava para a linha
   de baixo assim que a coluna ficava estreita (celular) */
.handle-counter {
  display: inline-flex;
  align-items: stretch;
  margin-left: 25%;
}

.handle-counter .counter-minus,
.handle-counter .counter-plus,
.handle-counter input {
  flex: 0 0 auto; /* não encolhe nem quebra linha */
  text-align: center;
}

.handle-counter .counter-minus,
.handle-counter .counter-plus {
  width: 29px;
  height: 29px;
  padding: 0;
  line-height: 1;
  font-size: 15px;
  background: none;
  border: 1px solid rgb(231, 231, 231);
  color: #555;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.handle-counter .counter-minus:hover,
.handle-counter .counter-plus:hover {
  background-color: #f3f3f3;
}

.handle-counter input {
  width: 50px;
  height: 29px;
  border: 1px solid rgb(231, 231, 231);
  border-left: none;
  border-right: none;
}

.btn {
  padding: 5px 10px;
  border: 1px solid rgb(231, 231, 231);
  height: 29px;
  background-color: white;
  cursor: pointer;
}

.btn:disabled,
.btn:disabled:hover {
  cursor: not-allowed;
}

form {
  width: 20%;
  height: 600px;
  text-align: left;
  background-color: blue;
  margin-left: 7%;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  display: none;
}

.title-form {
  color: black;
  font-size: 20px;
  text-align: center;
}

.personal-data {
  width: 332px;
  margin-right: 2%;
  margin-top: 5%;
  height: 200px;
  background-color: red;
}

.personal-data input {
  width: 246px;
}

.data-express {
  width: 332px;
  margin-left: 5%;
  height: 200px;
  background-color: red;
  display: block;
  margin-left: 0%;
}

.data-express select,
input {
  width: 246px;
}

.express-container {
  background-color: green;
  height: 400px;
  margin: 0;
  display: block;
  width: 300px;
  text-align: center;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  color: black;
}

.purchase-button {
  width: 200px;
  height: 40px;
  border-radius: 0;
  border: none;
  color: white;
  font-weight: 500;
  margin-top: 35px;
  margin-left: 19%;
  background-color: rgb(39, 158, 133);
  cursor: pointer;
  letter-spacing: 2px;
}

.purchase-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Datos del cliente (checkout) ── */
.checkout-form {
  width: 85%;
  margin: 30px auto 0;
  max-width: 360px;
  text-align: left;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
}

.checkout-title {
  color: black;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.checkout-form .checkout-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  margin-bottom: 12px;
  border: 1px solid rgb(231, 231, 231);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.checkout-form .checkout-input:focus {
  outline: none;
  border-color: rgb(39, 158, 133);
}

/* ==========================================================================
   MEDIA QUERIES — CELULAR / TABLET PEQUENO (max-width: 640px)
========================================================================== */

@media (max-width: 640px) {
  table {
    width: 96%;
    margin-left: 2%;
  }

  /* botão da lixeira um pouco menor, e a imagem recuada o bastante
     para não ficar por baixo dele */
  .remove-product-button {
    width: 30px;
    height: 30px;
    padding: 5px;
  }

  .remove-product-button svg {
    width: 19px;
    height: 19px;
  }

  .cart-product-image {
    width: 55px;
    height: 55px;
    margin-left: 38px;
  }

  .product-identification .cart-product-title {
    margin-left: 102px;
    width: auto;
    font-size: 13px;
  }

  .item-product-price,
  .cart-product-price {
    font-size: 12px;
  }

  .handle-counter {
    margin-left: 0;
  }

  /* alvos de toque um pouco maiores no celular */
  .handle-counter .counter-minus,
  .handle-counter .counter-plus {
    width: 32px;
    height: 32px;
  }

  .handle-counter input {
    width: 36px;
    height: 32px;
  }

  .cupon-container {
    flex-wrap: wrap;
  }

  .cupon-button,
  .aplication-cupon-button {
    width: 47%;
    font-size: 11px;
    letter-spacing: 1px;
    margin-right: 6%;
  }

  .aplication-cupon-button {
    margin-right: 0;
  }

  .cart-total-container span {
    margin-left: 8%;
  }

  .purchase-button {
    display: block;
    width: 90%;
    margin: 30px auto 0;
  }

  .checkout-form {
    width: 92%;
  }
}
