/* Modern Cart Design - Optimized Version */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  color: #333;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.2px;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo h1 a {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: 0.3s ease;
}

.logo h1 a:hover {
  transform: translateY(-2px);
}

.user-actions a {
  color: #555;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  transition: 0.3s ease;
  border: 1px solid transparent;
}

.user-actions a:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #222;
}

/* Navigation */
nav {
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
  padding: 0.4rem 0;
  position: relative;
  transition: 0.3s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #222;
  transition: width 0.3s ease;
}

nav a:hover {
  color: #222;
}

nav a:hover::after {
  width: 100%;
}

/* Cart */
main {
  padding: 2.5rem 1.5rem;
  min-height: 70vh;
}

.cart {
  max-width: 1100px;
  margin: 0 auto;
}

.cart h2 {
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2.5rem;
  color: #1a1a1a;
  position: relative;
}

.cart h2::after {
  content: '';
  width: 70px;
  height: 3px;
  background: linear-gradient(90deg, #222 0%, #666 100%);
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

/* Cart Items */
.cart-items {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 2rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: 0.3s ease;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item:hover {
  background: rgba(0, 0, 0, 0.02);
  transform: translateY(-1px);
}

/* Product Image */
.cart-item-image {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: 0.3s ease;
}

.cart-item:hover .cart-item-image {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* Product Info */
.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  justify-content: center;
}

.cart-item-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
}

/* Price Section */
.price-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.original-price {
  font-size: 0.9rem;
  color: #999;
  text-decoration: line-through;
}

.discounted-price, .normal-price {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.discounted-price {
  color: #e74c3c;
}

.normal-price {
  color: #2c3e50;
}

.discount-info {
  font-size: 0.75rem;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-weight: 500;
}

/* Quantity Controls */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.4rem;
  border-radius: 50px;
  width: fit-content;
}

.quantity-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: #fff;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #555;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: 0.3s ease;
}

.quantity-btn:hover {
  background: #222;
  color: #fff;
}

.quantity-input {
  width: 50px;
  text-align: center;
  border: none;
  background: #fff;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.05);
}

.quantity-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(34,34,34,0.1);
}

/* Remove Button */
.remove-item-btn {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  color: #666;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.3s ease;
}

.remove-item-btn:hover {
  background: #ff4757;
  border-color: #ff4757;
  color: #fff;
}

/* Cart Summary */
.cart-summary {
  background: #fff;
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.06);
  text-align: right;
}

.cart-summary p {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

#checkout-button {
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
  min-width: 180px;
}

#checkout-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
  .cart-item {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cart-item-info {
    align-items: center;
  }
  .cart-item > div:last-child {
    align-items: center;
  }
  .cart-summary {
    text-align: center;
  }
}
