/* Cart Page Styles - SecureParts */
:root {
  --primary-color: #8696ff;
  --primary-dark: #6c5ce7;
  --secondary-color: #040404;
  --accent-color: #e74c3c;
  --success-color: #00b894;
  --warning-color: #fdcb6e;
  --error-color: #d63031;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #6c757d;
  --text-dark: #1a1a1a;
  --text-light: #495057;
  --border-radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cart Page Container */
.cart-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* Cart Header */
.cart-header {
  text-align: center;
  margin-bottom: 40px;
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.cart-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.cart-header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-header h1 i {
  margin-right: 15px;
  color: var(--primary-color);
}

.cart-header p {
  color: var(--text-light);
  font-size: 18px;
  margin: 0;
}

/* Cart Container */
.cart-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  align-items: start;
}

/* Cart Items */
.cart-items {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  gap: 20px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--light-gray);
  transition: var(--transition);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item:hover {
  background: var(--light-gray);
  margin: 0 -20px;
  padding: 20px;
  border-radius: 8px;
}

.item-image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.cart-item:hover .item-image img {
  transform: scale(1.05);
}

.item-details h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
  line-height: 1.3;
}

.item-category {
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.item-price {
  color: var(--text-light);
  font-size: 16px;
  font-weight: 500;
}

.item-quantity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.item-quantity label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 2px solid var(--medium-gray);
  border-radius: 6px;
  overflow: hidden;
}

.qty-btn {
  background: var(--light-gray);
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  color: var(--text-dark);
}

.qty-btn:hover {
  background: var(--primary-color);
  color: white;
}

.quantity-controls input {
  border: none;
  padding: 8px 12px;
  text-align: center;
  width: 60px;
  font-weight: 600;
  color: var(--text-dark);
}

.quantity-controls input:focus {
  outline: none;
  background: var(--light-gray);
}

.item-subtotal {
  text-align: center;
}

.subtotal-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.item-actions {
  display: flex;
  justify-content: center;
}

/* Cart Summary */
.cart-summary {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 20px;
  border: 1px solid var(--medium-gray);
  position: relative;
  overflow: hidden;
}

.cart-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--success-color), var(--primary-color));
}

.cart-summary h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--text-dark);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.cart-summary h3 i {
  color: var(--primary-color);
}

.summary-items {
  margin-bottom: 25px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 16px;
  color: var(--text-light);
}

.summary-item.total {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  border-top: 2px solid var(--medium-gray);
  padding-top: 15px;
  margin-top: 15px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 25px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(134, 150, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(134, 150, 255, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--dark-gray), #495057);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error-color), #c0392b);
  color: white;
  box-shadow: 0 4px 15px rgba(214, 48, 49, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(214, 48, 49, 0.4);
}

.btn-small {
  padding: 8px 12px;
  font-size: 14px;
}

.btn-large {
  padding: 18px 30px;
  font-size: 18px;
}

.cart-security {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(134, 150, 255, 0.1));
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 184, 148, 0.2);
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--success-color);
  font-size: 15px;
  font-weight: 600;
}

.security-badge i {
  font-size: 18px;
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin: 20px 0;
}

.empty-cart-icon {
  font-size: 5rem;
  margin-bottom: 25px;
  display: block;
}

.empty-cart h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.empty-cart p {
  color: var(--text-light);
  font-size: 16px;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .cart-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .cart-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .cart-page {
    padding: 15px;
  }
  
  .cart-header h1 {
    font-size: 2.2rem;
  }
  
  .cart-item {
    grid-template-columns: 1fr;
    gap: 15px;
    text-align: center;
  }
  
  .item-image {
    justify-self: center;
  }
  
  .item-quantity {
    flex-direction: row;
    justify-content: center;
  }
  
  .cart-items,
  .cart-summary {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .cart-header h1 {
    font-size: 1.8rem;
  }
  
  .cart-items,
  .cart-summary {
    padding: 15px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-items {
  animation: fadeInUp 0.6s ease-out;
}

.cart-summary {
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* Loading States */
.cart-item.loading {
  opacity: 0.7;
  pointer-events: none;
}

.cart-item.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-color);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
