/* ==========================================
   CART.CSS
   USING FLEXBOX ONLY
   ========================================== */

.cart-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.cart-items {
  flex: 1 1 600px;
}

.cart-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.cart-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: var(--radius);
  padding: 0.5rem;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.cart-item-info .price {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-item-controls button {
  width: 35px;
  height: 35px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.cart-item-controls button:hover {
  background: var(--bg-light);
  border-color: var(--primary-color);
}

.cart-item-controls .quantity {
  font-weight: bold;
  font-size: 1.1rem;
  min-width: 40px;
  text-align: center;
}

.cart-item-controls .btn-remove {
  width: auto;
  padding: 0.5rem 1rem;
  background: #e74c3c;
  color: #fff;
  border: none;
}

.cart-item-controls .btn-remove:hover {
  background: #c0392b;
}

/* Cart Summary */
.cart-summary {
  flex: 1 1 300px;
  max-width: 400px;
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  align-self: flex-start;
  position: sticky;
  top: 90px;
}

.cart-summary h3 {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.summary-row.total {
  font-size: 1.3rem;
  font-weight: bold;
  padding-top: 1rem;
  border-top: 2px solid var(--border-color);
  margin-top: 1rem;
  color: var(--text-dark);
}

.btn-checkout {
  width: 100%;
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.continue-shopping {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.continue-shopping:hover {
  text-decoration: underline;
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-cart h2 {
  margin-bottom: 1rem;
  color: var(--text-gray);
}

.empty-cart p {
  margin-bottom: 2rem;
  color: var(--text-gray);
}

/* Responsive */
@media (max-width: 768px) {
  .cart-container {
    flex-direction: column;
  }

  .cart-summary {
    max-width: 100%;
    position: static;
  }

  .cart-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cart-item img {
    width: 150px;
    height: 150px;
  }

  .cart-item-info {
    width: 100%;
  }

  .cart-item-controls {
    justify-content: center;
  }
}
