/**
 * assets/css/products.css
 * 产品库模块核心样式表 (V5.5 收藏夹与物理删除视觉增强版)
 * 包含：产品网格卡片、高危操作悬浮区、DAM数字资产画廊、侧边栏筛选器及微动效
 * @package Amz_Safe_Bridge
 */

/* ==========================================================================
   1. 基础布局与定制滚动条 (Custom Scrollbars)
   ========================================================================== */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 8px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1; /* Tailwind slate-300 */
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.3s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8; /* Tailwind slate-400 */
}

/* ==========================================================================
   2. 产品网格卡片微动效 (Product Card Micro-interactions)
   ========================================================================== */
.product-card {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
  box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
  border-color 0.3s ease;
  will-change: transform, box-shadow;
}

/* 卡片悬停时的立体上浮与发光阴影 */
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.1), 0 8px 10px -6px rgba(79, 70, 229, 0.1);
  border-color: #e0e7ff; /* Tailwind indigo-100 */
}

/* 封面图的防抖动裁剪与平滑放大 */
.product-card-cover {
  position: relative;
  overflow: hidden;
  background-color: #f8fafc;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.product-cover-img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.product-card:hover .product-cover-img {
  transform: scale(1.08);
}

/* ==========================================================================
   3. 右上角悬浮操作区 (Favorite & Delete Actions)
   ========================================================================== */
#product-card-op {
  /* 初始状态隐藏并向右略微偏移，悬停时滑入 */
  transform: translateX(10px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20; /* 确保在状态徽章和遮罩层之上 */
}

.product-card:hover #product-card-op {
  transform: translateX(0);
  opacity: 1;
  /* 悬浮时恢复指针事件，确保红心和删除按钮可以被点击，而不影响底图跳转 */
  pointer-events: auto;
}

/* 收藏红心跳动动画 (配合 JS 的乐观 UI 更新) */
@keyframes asb-heartbeat {
  0% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.3); }
  70% { transform: scale(1); }
  100% { transform: scale(1); }
}

.fav-icon.animate-pulse {
  animation: asb-heartbeat 0.8s ease-in-out forwards !important;
}

/* 物理删除按钮的极危警示 Hover 态 */
.product-delete-btn:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25); /* Tailwind red-500/25 */
  border-color: #fca5a5; /* Tailwind red-300 */
}

/* ==========================================================================
   4. 产品参数与标签的文本截断 (Text Truncation & Wrapping)
   ========================================================================== */
.product-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.product-tags {
  /* 确保标签过多时安全换行，不破坏卡片高度 */
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 52px;
  overflow: hidden;
}

/* ==========================================================================
   5. 左侧边栏定制筛选器 (Custom Filter Checkboxes)
   ========================================================================== */
.product-filter-checkbox {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  margin: 0;
  display: grid;
  place-content: center;
  transition: all 0.2s ease-in-out;
}

.product-filter-checkbox::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em currentColor;
  background-color: currentColor;
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.product-filter-checkbox:checked::before {
  transform: scale(1);
}

.product-filter-checkbox:focus {
  outline: none;
}

/* ==========================================================================
   6. DAM 数字资产画廊 (Digital Asset Management Matrix)
   ========================================================================== */
/* 画廊卡片容器 */
.dam-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  align-items: start;
}

.dam-item-card {
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #f1f5f9;
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
}

.dam-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dam-item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 遮罩与操作区 */
.dam-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.2) 50%, rgba(15, 23, 42, 0.0) 100%);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
}

.dam-item-card:hover .dam-item-overlay {
  opacity: 1;
}

/* ==========================================================================
   7. 详情页与表单内部重置 (Detail & Form Specifics)
   ========================================================================== */
/* 产品详情页的五点描述自定义列表符 */
#detail-bullet-points li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: #334155; /* Tailwind slate-700 */
}

#detail-bullet-points li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #6366f1; /* Tailwind indigo-500 */
  font-weight: bold;
  font-size: 1.2em;
  line-height: 1.2;
}

/* 编辑页弹窗的表单聚焦状态 */
.edit-form-input:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  border-color: #818cf8;
}

/* ==========================================================================
   8. 加载状态与骨架屏 (Loaders & Skeletons)
   ========================================================================== */
.skeleton-pulse {
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% { background-color: #f1f5f9; }
  50% { background-color: #e2e8f0; }
  100% { background-color: #f1f5f9; }
}

/* 渐显动画，用于详情页或弹窗加载完成后的平滑显示 */
.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 自定义精简版 Loading Spinner */
.anim-spin-custom {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}