/* === CARRINHO === */
.cart-page {
  max-width: 84rem;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.cart-title {
  font-size: 2.6rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 3rem;
  color: #222;
}

/* === ITENS DO CARRINHO === */
.cart-items-container {
  background-color: #fff;
  border-radius: 1.2rem;
  padding: 2.4rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  background-color: #fafafa;
  border-radius: 0.8rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
  gap: 1.6rem;
}

.livro-info {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex: 1;
  min-width: 260px;
}

.livro-info img {
  width: 6.4rem;
  height: 9rem;
  object-fit: contain;
  border-radius: 0.4rem;
  background-color: #e0e0e0;
}

.livro-detalhes {
  display: flex;
  flex-direction: column;
}

.livro-titulo {
  font-weight: 600;
  font-size: 1.6rem;
  color: #222;
}

.livro-autor {
  font-size: 1.4rem;
  color: #888;
  margin: 0.4rem 0;
}

.livro-preco {
  font-size: 1.6rem;
  font-weight: 500;
  color: #1a73e8;
}

.cart-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cart-actions button {
  padding: 0.6rem 1rem;
  font-size: 1.4rem;
  border-radius: 0.4rem;
  background-color: #fff;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cart-actions button:hover {
  background-color: #f0f0f0;
}

.cart-actions span {
  min-width: 2.6rem;
  text-align: center;
  font-weight: 500;
  font-size: 1.4rem;
}

.btn-remover {
  color: #e53935;
  border: none;
  font-size: 1.8rem;
  background: transparent;
  cursor: pointer;
}

.btn-remover:hover {
  background-color: #ffe5e5;
  border-radius: 0.4rem;
}

/* === RESUMO DO PEDIDO === */
.cart-summary {
  margin-top: 4rem;
  background-color: #fff;
  padding: 3rem;
  border-radius: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.cart-summary h2 {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
  color: #222;
}

.cart-summary p {
  font-size: 1.6rem;
  margin: 0.8rem 0;
  display: flex;
  justify-content: space-between;
}

.cart-summary p strong {
  color: #111;
}

.cart-summary p:last-child {
  border-top: 1px solid #ddd;
  padding-top: 1.2rem;
  font-weight: 600;
  font-size: 1.8rem;
}

/* Botão finalizar compra */
.btn-finalizar {
  margin: 2rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 25px;
  font-size: 1.5rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative; 
}

.btn-finalizar:hover {
  background-color: #135cc7;
}

/* Link continuar comprando */
.continue-shopping {
  display: block;
  text-align: center;
  margin-top: 2rem;
  color: #1a73e8;
  text-decoration: none;
  font-size: 1.4rem;
}

.continue-shopping:hover {
  color: #0f5fc0;
  text-decoration: underline;
}

/* === ESTADOS === */
.empty-cart,
.error-msg {
  text-align: center;
  font-size: 1.6rem;
  color: #999;
  padding: 3rem 0;
}


/* === RESPONSIVO === */
@media (max-width: 768px) {
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }

  .cart-actions {
    align-self: stretch;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
  }

  .cart-summary {
    padding: 2rem;
  }

  .btn-finalizar {
    width: 100%;
  }
}
