/* cart.css */
.cart-page {
  padding: 30px 0;
}

.cart-page h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  color: #333;
}

.cart-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: flex-start;
}

.cart-items-table-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.cart-items-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-items-table th,
.cart-items-table td {
  padding: 15px;
  text-align: right;
  vertical-align: middle;
}

.cart-items-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  color: #555;
  border-bottom: 2px solid #e9ecef;
}

.cart-items-table tbody tr {
  border-bottom: 1px solid #e9ecef;
}

.cart-items-table tbody tr:last-child {
  border-bottom: none;
}

.product-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.product-info img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
}

.product-info span {
  font-weight: 500;
  color: #444;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}

.item-quantity {
  width: 50px;
  text-align: center;
  padding: 8px 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f8f9fa;
  appearance: textfield;
}

.item-quantity::-webkit-outer-spin-button,
.item-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity-btn {
  background-color: #e0e0e0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s;
}

.quantity-btn:hover {
  background-color: #d5d5d5;
}

.remove-item-btn {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
}

.remove-item-btn:hover {
  color: #c0392b;
}

.cart-summary {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 25px;
  height: fit-content;
}

.summary-box h3 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #444;
}

.summary-item span:first-child {
  font-weight: 500;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  font-size: 1.3rem;
  font-weight: bold;
  color: #2c3e50;
}

.summary-total span:first-child {
  font-weight: normal;
}

.checkout-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 25px;
  padding: 15px 20px;
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s;
}

.checkout-btn:hover {
  background-color: #218838;
}

.empty-cart-message {
  text-align: center;
  padding: 50px 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin: 30px auto;
  max-width: 600px;
}

.empty-cart-message i {
  font-size: 4rem;
  color: #ccc;
  margin-bottom: 20px;
}

.empty-cart-message p {
  font-size: 1.3rem;
  color: #555;
  margin-bottom: 25px;
}

.empty-cart-message .back-link {
  display: inline-block;
  padding: 12px 25px;
  background-color: #007bff;
  color: #fff;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.empty-cart-message .back-link:hover {
  background-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cart-container {
    grid-template-columns: 1fr;
  }
  .cart-summary {
    width: 100%;
    margin-top: 20px;
  }
  .cart-items-table thead {
    display: none;
  }
  .cart-items-table,
  .cart-items-table tbody,
  .cart-items-table tr,
  .cart-items-table td {
    display: block;
    width: 100%;
  }
  .cart-items-table tr {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
  }
  .cart-items-table td {
    text-align: right;
    padding-left: 50%;
    position: relative;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .cart-items-table td::before {
    content: attr(data-label);
    position: absolute;
    right: 10px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: bold;
    color: #555;
  }
  .product-info {
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
  }
  .product-info img {
    margin-left: auto;
  }
  .quantity-control {
    justify-content: flex-end;
  }
  .remove-item-btn {
    font-size: 1rem;
  }
}
