/* =================== GERAL =================== */
html, body {
  height: 100%;
}

body {
  font-family: 'Alata', sans-serif;
  color: #333;
  margin: 0;
  padding: 0;
}

/* =================== TÍTULO =================== */
h1 {
  font-size: 1.2rem;
  color: #767676;
  text-transform: uppercase;
  margin: 40px 0 20px 50px;
  letter-spacing: 1px;
  font-weight: 100;
}
/* =================== TABELA DO CARRINHO =================== */
.cart-table {
  width: 90%;
  margin: 0 auto;
  border-collapse: collapse;
  background-color: white;
  border-radius: 5px;
  overflow: hidden;
}

.cart-table thead {
  background-color: #252A36;
  color: white;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.cart-table th {
  text-align: center;
  padding: 14px;
}

.cart-table th:first-child {
  text-align: left;
  padding-left: 20px;
}

.cart-table td {
  padding: 16px;
  border-bottom: 1px solid #e1e1e1;
  text-align: center;
  vertical-align: middle;
  font-size: 0.95rem;
}

/* =================== PRODUTO =================== */
.product-name {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
}

.product-name img {
  width: 110px;
  height: 110px;
  border-radius: 5px;
  object-fit: cover;
}

/* =================== QUANTIDADE =================== */
.quantity {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.quantity button {
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: bold;
  color: #252A36;
  transition: 0.3s ease;
}

.quantity button:hover {
  background-color: #252A36;
  color: white;
}

.quantity span {
  font-weight: 500;
  text-align: center; /* Garante que o número fique sempre centralizado */
}


/* =================== PREÇO =================== */
.price {
  font-weight: 500;
}

/* =================== BOTÃO REMOVER =================== */
.remove-btn {
  background-color: transparent;
  border: 1px solid #dc3545;
  color: #dc3545;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: 0.3s ease;
}

.remove-btn:hover {
  background-color: #dc3545;
  color: white;
}

/* =================== BOTÃO LIMPAR =================== */
.clear-btn {
  margin: 25px 0 0 5%;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  background-color: #252A36;
  color: white;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 500;
  transition: 0.3s;
}

.clear-btn:hover {
  text-decoration: underline;
}

/* =================== RESUMO (Subtotal / Entrega / Total) =================== */
.summary {
  display: flex;
  justify-content: flex-end;
  margin: 0 5% 0 0;
}

.summary-table {
  background: white;
  border-radius: 10px;
  width: 320px;
  border-collapse: collapse;
  overflow: hidden;
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
}

.summary-table td {
  padding: 15px 25px;
  font-size: 0.95rem;
  color: #777;
  border-bottom: 1px solid #e1e1e1;
}

.summary-table tr:last-child td {
  border-bottom: none;
}

.summary-table tr.total-row td {
  font-weight: bold;
  color: #252A36;
}

/* =================== BOTÕES FINAIS =================== */
.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  margin: 40px auto;
}

.action-link {
  background-color: #252A36;
  color: white;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 500;
  transition: 0.3s;
}
 
.action-link:hover {
  background-color: #1d202b;
}

.total-actions {
  text-align: center;
  font-weight: 500;
}

.total-actions span {
  display: block; 
  margin-bottom: 8px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.main-content {
  flex: 1;
}

footer {
  margin-top: auto;
}

@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cart-table {
    min-width: 400px;
  }
  
  .cart-table thead th {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 10px 5px;
  }

  .product-name {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 180px;
  }

  .product-name img {
    width: 75px;
    height: 75px;
  }

  .price-col, .quantity-col, .total-col {
    min-width: 100px;
  }

  td, th {
    padding: 12px 8px;
    font-size: 0.85rem;
  }

  .quantity {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .quantity button {
    width: 26px;
    height: 26px;
  }

  .product-name {
    white-space: normal;
  }

  .cart-actions {
    flex-direction: column;
    gap: 15px;
  }

  .cart-actions .action-link {
    width: 100%;
    text-align: center;
  }

  .summary {
    justify-content: center;
    margin: 40px auto 0 auto;
  }
}