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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  line-height: 1.6;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-weight: 500;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

nav a.active {
  background: rgba(255, 255, 255, 0.3);
}

.logout-btn {
  background: rgba(255, 77, 77, 0.8) !important;
}

.logout-btn:hover {
  background: rgba(255, 77, 77, 1) !important;
}

/* Main Container */
main {
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.cart-header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

.cart-header h1 {
  font-size: 36px;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.cart-header p {
  font-size: 18px;
  opacity: 0.9;
}

/* Cart Content Layout */
.cart-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

/* Cart Items Section */
.cart-items-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 2fr 150px 120px 50px;
  gap: 20px;
  padding: 20px;
  border-bottom: 2px solid #f0f0f0;
  align-items: center;
  transition: all 0.3s ease;
}

.cart-item:hover {
  background: #f9f9f9;
  border-radius: 10px;
}

.cart-item:last-child {
  border-bottom: none;
}

.item-image img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-details h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 8px;
}

.item-price {
  font-size: 16px;
  color: #667eea;
  font-weight: 600;
}

.item-quantity label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 5px;
}

.quantity-controls button {
  width: 30px;
  height: 30px;
  border: none;
  background: #667eea;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.quantity-controls button:hover {
  background: #764ba2;
  transform: scale(1.1);
}

.qty-display {
  font-size: 16px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

.item-total {
  text-align: right;
}

.total-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.total-price {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.item-remove {
  text-align: center;
}

.remove-btn {
  width: 35px;
  height: 35px;
  border: none;
  background: #ff6b6b;
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #ff5252;
  transform: rotate(90deg) scale(1.1);
}

/* Cart Summary */
.cart-summary {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.cart-summary h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 15px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 16px;
  color: #666;
}

.summary-line.total {
  border-top: 2px solid #f0f0f0;
  margin-top: 15px;
  padding-top: 20px;
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.checkout-btn, .continue-shopping-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
}

.checkout-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.continue-shopping-btn {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.continue-shopping-btn:hover {
  background: #f0f0f0;
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 60px 20px;
}

.empty-cart-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-cart h2 {
  font-size: 28px;
  color: #333;
  margin-bottom: 10px;
}

.empty-cart p {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
}

.shop-now-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.shop-now-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Loading and Error States */
.loading, .error-message {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: #666;
}

/* Footer */
footer {
  background: rgba(0, 0, 0, 0.2);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 60px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .cart-content {
    grid-template-columns: 1fr;
  }
  
  .cart-summary {
    position: static;
  }
  
  .cart-item {
    grid-template-columns: 80px 1fr 120px 100px 40px;
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .cart-item {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .item-image {
    justify-self: center;
  }
  
  .item-total {
    text-align: center;
  }
  
  .quantity-controls {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cart-header h1 {
    font-size: 28px;
  }
  
  .cart-items-section, .cart-summary {
    padding: 20px;
  }
}