/* ====================================
   豪华购物车系统 - 奢华优雅样式
   主题配色：#f5b754 (金色), #333 (深色), #fff (白色)
   ==================================== */

/* 右下角浮动购物车按钮 */
.floating-cart-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #f5b754, #e6a643);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 8px 30px rgba(245, 183, 84, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  animation: floatingPulse 3s infinite;
}

.floating-cart-button:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 15px 40px rgba(245, 183, 84, 0.6);
}

.floating-cart-button:active {
  transform: translateY(-2px) scale(1.05);
}

@keyframes floatingPulse {
  0%, 100% { 
    box-shadow: 0 8px 30px rgba(245, 183, 84, 0.4), 0 0 0 0 rgba(245, 183, 84, 0.7);
  }
  50% { 
    box-shadow: 0 8px 30px rgba(245, 183, 84, 0.4), 0 0 0 20px rgba(245, 183, 84, 0);
  }
}

.floating-cart-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-cart-button i {
  font-size: 28px;
  color: #333;
  transition: transform 0.3s ease;
}

.floating-cart-button:hover i {
  transform: scale(1.2);
}

.floating-cart-count {
  position: absolute;
  top: -12px;
  right: -12px;
  background: linear-gradient(135deg, #333, #555);
  color: #f5b754;
  font-size: 14px;
  font-weight: 800;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  animation: countBounce 0.5s ease;
}

@keyframes countBounce {
  0% { transform: scale(0.3); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 浮动购物车提示框 */
.floating-cart-tooltip {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 15px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.floating-cart-button:hover .floating-cart-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-5px);
}

.tooltip-text {
  background: linear-gradient(135deg, #333, #555);
  color: #f5b754;
  padding: 12px 16px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  position: relative;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #333;
}

/* ✅ 强制显示购物车按钮 - 移除所有隐藏条件 */
.floatingCartButton,
#floatingCartButton,
.floating-cart-button {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9998;
}

/* ✅ 移除隐藏类 */
.floatingCartButton.hidden,
#floatingCartButton.hidden,
.floating-cart-button.hidden {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 响应式：移动端调整 */
@media (max-width: 768px) {
  .floating-cart-button {
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
  }
  
  .floating-cart-button i {
    font-size: 24px;
  }
  
  .floating-cart-count {
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    top: -10px;
    right: -10px;
  }
  
  .floating-cart-tooltip {
    display: none;
  }
}

/* 购物车遮罩层 */
.luxury-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.luxury-cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 豪华购物车侧边栏 */
.luxury-cart-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: linear-gradient(135deg, #ffffff, #fafafa);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.luxury-cart-overlay.active .luxury-cart-sidebar {
  transform: translateX(0);
}

/* 购物车头部 */
.luxury-cart-header {
  background: linear-gradient(135deg, #f5b754, #e6a643);
  padding: 25px;
  position: relative;
  overflow: hidden;
}

.luxury-cart-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="luxury-pattern" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23luxury-pattern)"/></svg>');
  opacity: 0.3;
}

.cart-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.cart-title {
  color: #333;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-gem-icon {
  font-size: 20px;
  animation: gemSparkle 3s infinite;
}

@keyframes gemSparkle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(5deg) scale(1.1); }
  75% { transform: rotate(-5deg) scale(1.1); }
}

.cart-item-count {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.8;
}

.cart-close-btn {
  background: none;
  border: none;
  color: #333;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cart-close-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.3s ease;
}

.cart-close-btn:hover {
  transform: rotate(90deg);
}

.cart-close-btn:hover::before {
  transform: scale(1);
}

.cart-header-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  margin-top: 15px;
  position: relative;
  z-index: 2;
}

/* 购物车内容区域 */
.luxury-cart-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #f5b754 transparent;
}

.luxury-cart-content::-webkit-scrollbar {
  width: 6px;
}

.luxury-cart-content::-webkit-scrollbar-track {
  background: transparent;
}

.luxury-cart-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #f5b754, #e6a643);
  border-radius: 3px;
}

/* 空购物车状态 */
.empty-cart-message {
  text-align: center;
  padding: 60px 30px;
  color: #666;
}

.empty-cart-icon {
  font-size: 80px;
  color: #f5b754;
  margin-bottom: 25px;
  opacity: 0.7;
}

.empty-cart-message h4 {
  font-size: 24px;
  color: #333;
  margin-bottom: 15px;
  font-weight: 600;
}

.empty-cart-message p {
  font-size: 16px;
  margin-bottom: 30px;
  line-height: 1.6;
}

.continue-shopping-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f5b754, #e6a643);
  color: #333;
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(245, 183, 84, 0.3);
}

.continue-shopping-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 183, 84, 0.4);
  color: #333;
  text-decoration: none;
}

/* 购物车商品列表 */
.cart-items-list {
  padding: 20px 0;
}

.luxury-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px 25px;
  border-bottom: 1px solid rgba(245, 183, 84, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.luxury-cart-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(245, 183, 84, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.luxury-cart-item:hover {
  background: rgba(245, 183, 84, 0.02);
}

.luxury-cart-item:hover::before {
  opacity: 1;
}

.cart-item-image {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(245, 183, 84, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-item-image:hover .image-overlay {
  opacity: 1;
}

.cart-item-image:hover img {
  transform: scale(1.1);
}

.view-product-icon {
  color: #333;
  font-size: 18px;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.product-name a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-name a:hover {
  color: #f5b754;
}

.product-meta {
  margin-bottom: 12px;
}

.product-sku {
  font-size: 12px;
  color: #666;
  background: rgba(245, 183, 84, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.price-quantity-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  border-radius: 25px;
  padding: 4px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: #f5b754;
  color: #333;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 12px;
}

.qty-btn:hover {
  background: #e6a643;
  transform: scale(1.1);
}

.qty-input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.qty-input:focus {
  outline: none;
}

.item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.unit-price {
  font-size: 12px;
  color: #666;
  text-decoration: line-through;
}

.item-total {
  font-size: 16px;
  font-weight: 700;
  color: #f5b754;
}

.remove-item-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-item-btn:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

/* 购物车底部 */
.luxury-cart-footer {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-top: 2px solid rgba(245, 183, 84, 0.1);
  padding: 25px;
}

/* 优惠券区域 */
.coupon-section {
  margin-bottom: 20px;
}

.coupon-input-group {
  display: flex;
  gap: 10px;
}

.coupon-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.coupon-input:focus {
  outline: none;
  border-color: #f5b754;
  box-shadow: 0 0 0 3px rgba(245, 183, 84, 0.1);
}

.apply-coupon-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #f5b754, #e6a643);
  color: #333;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.apply-coupon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 183, 84, 0.3);
}

/* 购物车总计 */
.cart-totals {
  margin-bottom: 25px;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.total-row:last-child {
  border-bottom: none;
}

.total-final {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #f5b754;
  font-size: 18px;
  font-weight: 700;
}

.total-label {
  color: #666;
  font-weight: 500;
}

.total-value {
  font-weight: 600;
  color: #333;
}

.final-amount {
  color: #f5b754;
  font-size: 20px;
}

.discount-amount {
  color: #28a745;
}

/* 操作按钮 */
.cart-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.view-cart-btn, .checkout-btn {
  flex: 1;
  padding: 15px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.view-cart-btn {
  background: transparent;
  color: #333;
  border: 2px solid #f5b754;
}

.view-cart-btn:hover {
  background: #f5b754;
  color: #333;
  transform: translateY(-2px);
  text-decoration: none;
}

.checkout-btn {
  background: linear-gradient(135deg, #f5b754, #e6a643);
  color: #333;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(245, 183, 84, 0.3);
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 183, 84, 0.4);
  color: #333;
  text-decoration: none;
}

/* 安全信息 */
.security-info {
  text-align: center;
  color: #666;
  font-size: 12px;
}

.security-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 8px;
}

.security-icons i {
  color: #f5b754;
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .luxury-cart-sidebar {
    width: 100vw;
  }
  
  .luxury-cart-trigger {
    padding: 6px 12px;
    gap: 8px;
  }
  
  .cart-total-amount {
    display: none;
  }
  
  .cart-actions {
    flex-direction: column;
  }
  
  .quantity-controls {
    flex-wrap: wrap;
  }
  
  .price-quantity-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* 动画效果 */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.luxury-cart-item {
  animation: fadeInUp 0.3s ease forwards;
}

.luxury-cart-item:nth-child(1) { animation-delay: 0.1s; }
.luxury-cart-item:nth-child(2) { animation-delay: 0.2s; }
.luxury-cart-item:nth-child(3) { animation-delay: 0.3s; }
.luxury-cart-item:nth-child(4) { animation-delay: 0.4s; }
.luxury-cart-item:nth-child(5) { animation-delay: 0.5s; }

/* 高级伪类效果 */
.luxury-cart-item:nth-child(odd)::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(135deg, #f5b754, #e6a643);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.luxury-cart-item:hover:nth-child(odd)::after {
  opacity: 1;
}

.luxury-cart-item:nth-child(even)::before {
  content: '✨';
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 12px;
  opacity: 0;
  transition: all 0.3s ease;
  color: #f5b754;
}

.luxury-cart-item:hover:nth-child(even)::before {
  opacity: 1;
  transform: rotate(360deg);
}

/* 高级按钮伪类效果 */
.qty-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.3s ease;
  transform: translate(-50%, -50%);
}

.qty-btn:hover::before {
  width: 100%;
  height: 100%;
}

.qty-btn:active {
  transform: scale(0.95);
}

/* 购物车按钮神奇效果 */
.floating-cart-button::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, #f5b754, #e6a643, #f5b754, #e6a643);
  background-size: 300% 300%;
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  animation: gradientShift 3s ease infinite;
  transition: opacity 0.3s ease;
}

.floating-cart-button:hover::after {
  opacity: 1;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* 高级loading效果 */
.luxury-cart-content.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(245, 183, 84, 0.1), 
    rgba(245, 183, 84, 0.3), 
    rgba(245, 183, 84, 0.1));
  background-size: 200% 200%;
  animation: luxuryShimmer 2s ease-in-out infinite;
  z-index: 999;
}

@keyframes luxuryShimmer {
  0% {
    background-position: -200% -200%;
  }
  100% {
    background-position: 200% 200%;
  }
}

/* 精美的输入框效果 */
.coupon-input:focus::placeholder {
  transform: translateX(10px);
  opacity: 0;
  transition: all 0.3s ease;
}

.coupon-input:focus {
  background: linear-gradient(45deg, 
    rgba(245, 183, 84, 0.05), 
    rgba(255, 255, 255, 1));
}

/* 按钮涟漪效果 */
.apply-coupon-btn, .checkout-btn, .view-cart-btn {
  position: relative;
  overflow: hidden;
}

.apply-coupon-btn::before, .checkout-btn::before, .view-cart-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.apply-coupon-btn:active::before, .checkout-btn:active::before, .view-cart-btn:active::before {
  width: 300px;
  height: 300px;
}

/* 豪华阴影效果 */
.luxury-cart-item:hover {
  box-shadow: 
    0 10px 30px rgba(245, 183, 84, 0.2),
    0 1px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 精美的边框动画 */
.cart-totals::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    #f5b754, 
    transparent);
  animation: borderFlow 3s ease-in-out infinite;
}

@keyframes borderFlow {
  0%, 100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

/* 购物车头部豪华效果 */
.luxury-cart-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.luxury-cart-header:hover::after {
  width: 80%;
}

/* 商品图片高级效果 */
.cart-item-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(245, 183, 84, 0.3) 50%, 
    transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.cart-item-image:hover::after {
  transform: translateX(100%);
}

/* 移除按钮特殊效果 */
.remove-item-btn::after {
  content: '确认删除?';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc3545;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.remove-item-btn:hover::after {
  opacity: 1;
  top: -35px;
}

/* 价格闪烁效果 */
.final-amount {
  position: relative;
}

.final-amount::before {
  content: '💎';
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  animation: gemTwinkle 2s ease-in-out infinite;
}

@keyframes gemTwinkle {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(-50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
  }
}

/* 购物车按钮弹跳动画 */
.cart-bounce {
  animation: cartBounce 0.6s ease;
}

@keyframes cartBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px) scale(1.1);
  }
  60% {
    transform: translateY(-5px) scale(1.05);
  }
}

.luxury-cart-open {
  overflow: hidden;
}