/* css/cart.css */

/* Base Styles */
:root {
  --primary-color: #4a6fa5;
  --secondary-color: #166088;
  --accent-color: #4fc3f7;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #757575;
  --white: #ffffff;
  --success-color: #4caf50;
  --error-color: #f44336;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-gray);
  padding: 20px;
}

/* Header Styles */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--medium-gray);
}

h1 {
  font-size: 28px;
  color: var(--secondary-color);
  font-weight: 600;
}

/* .cart-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.85); 
  border: 1px solid var(--medium-gray);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); 
  transition: background 0.2s ease;
} */

.cart-item:hover {
  background: rgba(255, 255, 255, 0.95); 
}

/* .cart-item img {
  width: 60px; 
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
} */

.cart-item-content {
  flex: 1;
}

.cart-item-content h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 4px;
}

.cart-item-content p {
  font-size: 13px;
  color: var(--dark-gray);
  margin-bottom: 6px;
}

/* Quantity Controls */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.qty-controls button {
  background: var(--medium-gray);
  border: none;
  padding: 3px 8px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.qty-controls button:hover {
  background: var(--accent-color);
  color: var(--white);
}

/* Remove Button */
.remove {
  background: transparent;
  border: none;
  color: var(--error-color);
  font-size: 13px;
  cursor: pointer;
  padding: 3px 0;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.remove:hover {
  color: #d32f2f;
}


/* Button Styles */
.product-btn {
  display: inline-block;
  padding: 10px 15px;
  margin-bottom: 20px;
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  font-weight: 500;
}

.product-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

/* Cart Container */
.cart-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 600px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease-out;
}

.cart-icon {
  position: relative;
  color: var(--primary-color);
  font-size: 24px;
  text-decoration: none;
}

.cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: var(--accent-color);
  color: var(--white);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 10px; 
  margin-bottom: 8px; 
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--medium-gray);
  border-radius: 50px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03); 
  transition: background 0.2s ease;
}

.cart-item:hover {
  background: rgba(255, 255, 255, 0.95); /* slightly brighter on hover */
}

.cart-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 30px;
}

.cart-item-details {
  flex: 1;
  margin-left: 6px;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 2px;
}

.cart-item-price {
  font-size: 13px;
  color: var(--dark-gray);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 5px;
}

.qty-btn {
  background: var(--medium-gray);
  border: none;
  padding: 3px 7px;
  font-size: 13px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.qty-btn:hover {
  background: var(--accent-color);
  color: var(--white);
}


/* Cart Summary */
.cart-summary {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
  width: 100%;
  order: 2; /* Ensures summary comes after items */
}

.cart-summary p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--dark-gray);
}

.cart-summary h3 {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  padding-top: 15px;
  border-top: 1px solid var(--medium-gray);
  font-size: 20px;
  color: var(--secondary-color);
}

.checkout-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.checkout-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

/* Empty Cart State */
.cart-items.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--dark-gray);
}

/* Responsive Design - Now summary will always be below items */
@media (min-width: 768px) {
  .cart-summary {
    max-width: 800px; /* Match container width */
    margin: 0 auto;
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-container {
  animation: fadeIn 0.5s ease-out;
}