/* -------------------------------------------------
   Carrinho & Checkout
-------------------------------------------------- */

:root {
  --pk-primary: #fd0000;
  --pk-secondary: #0b33e6;
  --pk-accent: #f3eae4;
  --pk-text: #3a3a3a;
  --pk-bg: #ffffff;
  --pk-radius: 12px;
  --pk-shadow: 0 4px 12px rgba(0,0,0,0.08);
  --pk-transition: 0.3s;
  --whatsapp-green: #25D366;
  --whatsapp-dark: #128C7E;
}

body {
  background-color: #f5f5f5;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  color: var(--pk-text);
  margin: 0;
  padding: 0;
}

main.container {
  max-width: 700px;
  margin: 40px auto;
  background: var(--pk-bg);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
  padding: 30px 24px 40px;
}

/* --- Botão voltar --- */
.btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pk-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 20px;
  transition: color var(--pk-transition);
}
.btn-voltar:hover {
  color: var(--pk-primary);
}
.btn-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pk-secondary);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
}

/* --- Títulos --- */
h1, h2 {
  color: var(--pk-text);
  text-align: center;
  font-weight: 600;
}
h1 {
  margin-bottom: 24px;
  font-size: 1.6rem;
}
h1 i { color: var(--pk-secondary); }
h2 {
  margin-bottom: 20px;
  font-size: 1.3rem;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

/* --- Cart Items --- */
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  margin-bottom: 12px;
  transition: box-shadow var(--pk-transition);
}
.cart-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cart-produto-info {
  flex: 1;
}
.cart-produto-info strong {
  font-size: 1rem;
  color: var(--pk-text);
}

.cart-qnt-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}
.btn-qnt {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--pk-transition);
}
.btn-qnt:hover {
  background: var(--pk-secondary);
  color: #fff;
  border-color: var(--pk-secondary);
}
.input-qnt {
  width: 96px;
  min-width: 88px;
  max-width: 120px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
/* Evita setas estreitas do type=number em alguns navegadores; mantém campo legível */
.input-qnt::-webkit-outer-spin-button,
.input-qnt::-webkit-inner-spin-button {
  opacity: 1;
  height: 28px;
}

.cart-precos {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
}
.cart-precos strong {
  color: var(--pk-secondary);
}

.btn-remove {
  background: none;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--pk-transition);
  white-space: nowrap;
}
.btn-remove:hover {
  background: #e74c3c;
  color: #fff;
}

.cart-total {
  text-align: right;
  font-size: 1.3rem;
  color: var(--pk-text);
  padding: 16px 0 8px;
  border-top: 2px solid #eee;
  margin-top: 8px;
}
.cart-total strong {
  color: var(--pk-secondary);
}

hr {
  margin: 12px 0;
  border: none;
  border-top: 1px solid #f0f0f0;
}

/* --- Formulário --- */
#checkout-form {
  margin-top: 8px;
}

#checkout-form label {
  display: block;
  margin-top: 16px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #333;
}
#checkout-form label::after {
  content: " *";
  color: #e74c3c;
  font-weight: bold;
}
#checkout-form label.label-opcional::after {
  content: " (opcional)";
  color: #999;
  font-weight: normal;
  font-size: 0.82rem;
}

#checkout-form input,
#checkout-form textarea,
#checkout-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--pk-transition), box-shadow var(--pk-transition);
  box-sizing: border-box;
}

#checkout-form input:focus,
#checkout-form textarea:focus,
#checkout-form select:focus {
  outline: none;
  border-color: var(--pk-secondary);
  box-shadow: 0 0 0 3px rgba(11, 51, 230, 0.1);
}

#checkout-form textarea {
  resize: vertical;
}

/* --- Botão WhatsApp submit --- */
.btn-whatsapp-submit {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  background: var(--whatsapp-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--pk-transition), transform var(--pk-transition), box-shadow var(--pk-transition);
}
.btn-whatsapp-submit:hover {
  background: var(--whatsapp-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp-submit:disabled {
  background: #aaa;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-whatsapp-submit i {
  font-size: 1.3rem;
}

/* --- Feedback de sucesso --- */
#checkout-feedback {
  margin-top: 24px;
}

.pedido-sucesso {
  background: #f0faf4;
  border: 1px solid #b7e4c7;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
}
.pedido-sucesso h3 {
  color: #198754;
  margin: 0 0 8px;
  text-align: center;
}
.pedido-sucesso p {
  color: #555;
  margin: 0 0 16px;
}

.btn-whatsapp-enviar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--whatsapp-green);
  color: #fff;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background var(--pk-transition), transform var(--pk-transition);
}
.btn-whatsapp-enviar:hover {
  background: var(--whatsapp-dark);
  transform: translateY(-2px);
}
.btn-whatsapp-enviar i {
  font-size: 1.4rem;
}

/* --- Carrinho vazio --- */
.cart-empty {
  text-align: center;
  padding: 40px 20px;
  background: #f9f9f9;
  border-radius: 12px;
  margin: 20px 0;
}
.cart-empty i {
  font-size: 48px;
  color: #ccc;
  display: block;
  margin-bottom: 15px;
}
.cart-empty p {
  color: #999;
  font-size: 1.05rem;
}

/* --- Cart items container --- */
.cart-items {
  margin: 20px 0;
}

/* --- Estrutura do item (nova) --- */
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-nome {
  font-size: 1rem;
  color: #333;
  display: block;
  margin-bottom: 2px;
}
.cart-item-preco {
  color: #666;
  font-size: 0.88rem;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cart-item-subtotal {
  flex: 1;
  text-align: right;
  font-size: 0.92rem;
  color: #333;
}
.cart-item-subtotal strong {
  color: var(--pk-secondary);
}

/* --- Aviso WhatsApp --- */
.whatsapp-aviso {
  color: #888;
  font-size: 0.78rem;
  margin-top: 8px;
}

/* --- Ícone de sucesso --- */
.pedido-sucesso > i.fa-check-circle {
  font-size: 48px;
  color: #28a745;
  display: block;
  margin-bottom: 12px;
}

/* --- Toast de adição ao carrinho --- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #28a745;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  z-index: 9999;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlideIn 0.35s ease;
}
.toast-notification i {
  font-size: 1.1rem;
}
@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* --- Responsivo --- */
@media (max-width: 600px) {
  main.container {
    margin: 16px;
    padding: 20px 16px 30px;
  }
  h1 { font-size: 1.3rem; }
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .cart-item-actions {
    width: 100%;
    justify-content: space-between;
  }
  .btn-remove {
    align-self: flex-end;
  }
  .btn-whatsapp-submit {
    font-size: 1rem;
    padding: 14px;
  }
  .toast-notification {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
  }
}

/* --- Alerta região sem entrega --- */
.checkout-regiao-alert {
  margin: 12px 0 4px;
  padding: 14px 16px;
  border-radius: var(--pk-radius);
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #7f1d1d;
  font-size: 0.95rem;
  line-height: 1.45;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.checkout-regiao-alert[hidden] {
  display: none !important;
}
.btn-whatsapp-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
