/* ==========================
   RESET E BASE
========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: #f2f2f2;
  color: #333;
  padding: 0;
  line-height: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1 {
  text-align: center;
  margin: 15px 0;
  font-size: 1.6rem;
  color: #222;
}

/* ==========================
   ALERTAS
========================== */
.alerta-sucesso,
.popup-removido {
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  position: fixed;
  right: 15px;
  z-index: 999;
  animation: fadeIn 0.3s;
}

.alerta-sucesso {
  top: 15px;
  background: #d4edda;
  color: #155724;
}

.popup-removido {
  top: 60px;
  background: #f8d7da;
  color: #721c24;
  display: none;
}

/* ==========================
   BOTÕES
========================== */
button,
.btn-voltar-menu {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

button:hover,
.btn-voltar-menu:hover {
  opacity: 0.9;
}

/* Botão voltar ao menu moderno */
.btn-voltar-menu {
  display: inline-block;
  background: linear-gradient(135deg, #1982c4, #06d6a0);
  color: #fff;
  font-weight: 700;
  margin: 10px 15px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-voltar-menu:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.25);
}

/* ==========================
   LISTA DE ITENS (CARDS ULTRA COMPACTOS)
========================== */
.checkout-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px; /* scroll se muitos itens */
  overflow-y: auto;
  padding: 10px 15px;
  background: #ffffff; /* fundo do container para destacar */
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

/* Item do checkout */
.item-checkout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9f9f9;
  padding: 6px 10px;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.item-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.item-checkout img {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Informações do item */
.item-checkout .info {
  flex: 1;
  margin-left: 8px;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.item-checkout .info strong {
  font-size: 0.9rem;
  color: #111;
}

.item-checkout .info .descricao-produto,
.item-checkout .info em {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 2px;
}

/* Subtotal destacado */
.item-checkout .info #subtotal-0,
.item-checkout .info strong[id^="subtotal-"] {
  color: #06d6a0;
  font-weight: 700;
  margin-top: 2px;
  font-size: 0.88rem;
}

/* Botões do lado direito compactos */
.item-checkout .acoes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-left: 8px;
  flex-shrink: 0;
}

.item-checkout .acoes button {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
}

.item-checkout .acoes button:first-child {
  background: #1982c4;
  color: #fff;
}

.item-checkout .acoes button:last-child {
  background: #ff595e;
  color: #fff;
}

/* ==========================
   FORMULÁRIO PREMIUM
========================== */
form#form-checkout {
  background: #fff;
  margin-top: 10px;
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

form#form-checkout label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #444;
  margin-bottom: 3px;
}

form#form-checkout input,
form#form-checkout select,
form#form-checkout textarea {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ccc;
  font-size: 0.88rem;
  width: 100%;
  transition: all 0.2s;
}

form#form-checkout input:focus,
form#form-checkout select:focus,
form#form-checkout textarea:focus {
  border-color: #06d6a0;
  outline: none;
  box-shadow: 0 0 5px rgba(6,214,160,0.3);
}

/* Total destacado */
form#form-checkout p strong {
  font-size: 1.12rem;
  color: #d60606;
  font-weight: 700;
}

/* Botão enviar pedido fixo no rodapé */
form#form-checkout button[type="submit"] {
  position: sticky;
  bottom: 10px;
  background: linear-gradient(135deg, #06d6a0, #1982c4);
  color: #fff;
  font-size: 1rem;
  padding: 14px;
  margin-top: 10px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
  transition: all 0.2s;
}

form#form-checkout button[type="submit"]:hover {
  background: linear-gradient(135deg, #05c38f, #1982c4);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.25);
}

/* ==========================
   SCROLL CUSTOM
========================== */
.checkout-lista::-webkit-scrollbar {
  width: 6px;
}

.checkout-lista::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 3px;
}

/* ==========================
   ANIMAÇÕES
========================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================
   RESPONSIVO
========================== */
@media (max-width: 768px) {
  .item-checkout {
    flex-direction: row;
    align-items: center;
  }

  .item-checkout .info {
    margin-left: 6px;
  }

  .item-checkout .acoes {
    flex-direction: row;
    gap: 4px;
    margin-left: 4px;
  }

  form#form-checkout button[type="submit"] {
    bottom: 5px;
  }
}

/* ==========================
   TOTAL DO CARRINHO
========================== */
#carrinho-total {
  font-size: 1.4rem;        /* maior que o restante */
  font-weight: 800;         /* bem pesado */
  color: #d60606;           /* cor chamativa */
  background: #e0f7f1;      /* leve fundo para destacar */
  padding: 6px 10px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

#carrinho-total:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Container do total */
.total-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #d60606;
  padding: 12px 15px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.total-container strong {
  color: #06d6a0;
  font-size: 1.3rem;
  font-weight: 800;
}
