/* ECW Cart Styles - Safe version without Elementor conflicts */
/* ===== 1. Wrapper & Khung chung ===== */
.ecw-cart-wrapper {
  margin: 40px 0;
}
.ecw-cart-wrapper h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Toàn khung giỏ hàng: border + border-radius + padding */
.ecw-cart-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 24px;
  background: #fff;
}

/* ===== 2. Mỗi sản phẩm (item) ===== */
.ecw-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.ecw-cart-item:last-child {
  margin-bottom: 0;
}

/* 2.1 Ảnh sản phẩm (cột trái) */
.ecw-item-image {
  flex: 0 0 80px;
  margin-right: 20px;
}
.ecw-item-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* 2.2 Phần thông tin chính (tên + variation + qty + delete) */
.ecw-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-right: 20px;
}

/* Tên sản phẩm (ở đầu) */
.ecw-item-name {
  color: #3d3d3d !important;
  font-size: 22px;
  font-weight: 900;  
  text-decoration: none;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* Stock info styling */
.ecw-stock-info {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}

.ecw-stock-info.in-stock {
  color: #28a745;
}

.ecw-stock-info.low-stock {
  color: #ffc107;
}

.ecw-stock-info.out-of-stock {
  color: #dc3545;
}

/* Dropdown biến thể (ngay dưới tên) */
.ecw-variation-select {
  width: 100%;
  max-width: 300px;
  background: #8BC53F;
  color: #3d3d3d;
  border: none;
  padding: 8px 12px;
  font-size: 18px;
  border-radius: 4px;
  margin-bottom: 12px;
  cursor: pointer;
  font-weight: 700;
}

/* 2.3 Nhóm số lượng "[-] [input] [+]" và nút xóa nằm cùng hàng */
.ecw-qty-delete-wrapper {
  display: flex;
  align-items: center;
}

/* Nhóm "[-] [input] [+]" bo viền */
.ecw-qty-wrapper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  height: 36px;
  width: 80px;
}

/* Nút "−" */
.ecw-qty-minus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 100%;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.ecw-qty-minus i {
  font-size: 16px;
  color: #222;
}

/* Input số lượng */
.ecw-qty-input {
  width: 60px;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 14px;
  line-height: 36px;
  outline: none;
}

/* Nút "+" */
.ecw-qty-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 100%;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.ecw-qty-plus i {
  font-size: 16px;
  color: #222;
}

/* Khoảng cách giữa nhóm qty và icon xóa */
.ecw-qty-delete-wrapper .ecw-qty-wrapper {
  margin-right: 12px;
}

/* Icon xóa (thùng rác) */
.ecw-remove-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #222;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}
.ecw-remove-item:hover {
  color: #e74c3c;
  transform: scale(1.1);
}
.ecw-remove-item .ecw-trash-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Handle both SVG and IMG trash icons */
.ecw-remove-item .ecw-trash-icon img,
.ecw-remove-item .ecw-trash-icon {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.2s ease;
}

.ecw-remove-item:hover .ecw-trash-icon,
.ecw-remove-item:hover .ecw-trash-icon img {
  transform: scale(1.1);
}

/* ===== 3. Giá tiền (cột phải) ===== */
.ecw-item-price {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 700;
  color: #8BC53F;
  white-space: nowrap;
}

/* ===== 4. Tổng tiền tạm tính ===== */
.ecw-cart-total {
  text-align: right;
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
}

/* ===== 5. Ẩn nút Cập nhật (đã auto submit) ===== */
.ecw-update-wrapper {
  display: none;
}

/* ===== 5.1. Loading states for AJAX updates ===== */
.ecw-variation-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ecw-qty-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f5f5f5;
}

.ecw-cart-loading {
  position: relative;
  opacity: 0.7;
}

.ecw-cart-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* Empty cart state */
.ecw-empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

/* ===== 6. Toast Notifications ===== */
.ecw-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  max-width: 400px;
  background: #333;
  color: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%) scale(0.8);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ecw-notification.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.ecw-notification.hide {
  opacity: 0;
  transform: translateX(100%) scale(0.8);
  transition: all 0.3s ease-in;
}

/* Notification types */
.ecw-notification.success {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  border-color: rgba(76, 175, 80, 0.3);
}

.ecw-notification.error {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  border-color: rgba(244, 67, 54, 0.3);
}

.ecw-notification.warning {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  border-color: rgba(255, 152, 0, 0.3);
}

.ecw-notification.info {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  border-color: rgba(33, 150, 243, 0.3);
}

.ecw-notification-content {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
}

.ecw-notification-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.ecw-notification-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.ecw-notification-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ecw-notification-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.ecw-notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 0 12px 12px;
  transform-origin: left;
  transform: scaleX(1);
  transition: transform linear;
}

/* ===== 7. Responsive (narrow mobile) ===== */
@media (max-width: 600px) {
  .ecw-cart-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .ecw-item-image {
    margin-bottom: 12px;
  }
  .ecw-item-info {
    margin-right: 0;
    margin-bottom: 12px;
  }
  .ecw-item-price {
    margin: 12px 0 0;
  }
  
  .ecw-notification {
    top: 15px;
    right: 15px;
    left: 15px;
    min-width: auto;
    max-width: none;
  }
} 