/* ========================================
   Shopping Cart Panel Styles
   ======================================== */

/* Cart Badge */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 10;
}

.header-action-item.cart {
  position: relative;
  cursor: pointer;
}

/* Cart Panel Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}

.cart-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Cart Panel */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.cart-panel.open {
  transform: translateX(0);
}

/* Cart Panel Header */
.cart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.cart-panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.cart-panel-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #6b7280;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.cart-panel-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Cart Content */
.cart-panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Cart Items List */
.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

/* Empty Cart */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: #9ca3af;
  text-align: center;
}

.cart-empty svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.cart-empty p {
  margin: 0;
  font-size: 16px;
}

/* Cart Item */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-variation {
  display: inline-block;
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 600;
  color: #0891b2;
}

/* Cart Item Controls */
.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cart-quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.cart-qty-btn:hover {
  background: #0891b2;
  color: #fff;
}

.cart-qty-value {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.cart-item-remove {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.cart-item-remove:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* Cart Panel Footer */
.cart-panel-footer {
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
  flex-shrink: 0;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 16px;
}

.cart-subtotal span:first-child {
  color: #6b7280;
}

.cart-subtotal span:last-child {
  font-weight: 700;
  font-size: 20px;
  color: #1f2937;
}

.cart-panel-checkout-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--btn-primary-bg, var(--primary-color, #0891b2));
  color: var(--btn-primary-text, #fff);
  border: none;
  border-radius: var(--btn-radius, var(--border-radius, 10px));
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  margin-bottom: 10px;
}

.cart-panel-checkout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.cart-panel-continue-btn {
  width: 100%;
  padding: 12px 24px;
  background: var(--btn-secondary-bg, transparent);
  color: var(--btn-secondary-text, #6b7280);
  border: 1px solid var(--btn-secondary-border, #e5e7eb);
  border-radius: var(--btn-radius, var(--border-radius, 10px));
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.cart-panel-continue-btn:hover {
  background: var(--btn-secondary-hover-bg, #f3f4f6);
  color: var(--btn-secondary-hover-text, #1f2937);
  opacity: 0.9;
}

/* Toast Notification */
.cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1f2937;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 10001;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.cart-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cart-toast svg {
  color: #10b981;
}

/* Add to Cart Button States */
.product-add-btn.added {
  background: #10b981 !important;
  pointer-events: none;
}

.product-add-btn.added svg {
  stroke: #fff;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .cart-panel {
    max-width: 100%;
  }
  
  .cart-panel-header {
    padding: 16px 20px;
  }
  
  .cart-items-list {
    padding: 12px 20px;
  }
  
  .cart-item {
    gap: 12px;
  }
  
  .cart-item-image {
    width: 64px;
    height: 64px;
  }
  
  .cart-panel-footer {
    padding: 16px 20px;
  }
}






