/* ============================================================
   大熊物联科技 — product.css  产品中心专属样式
   ============================================================ */

/* =================================================================
   筛选侧边栏 + 产品布局
   ================================================================= */
.product-page { padding: 64px 0 88px; }
.product-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  align-items: start;
}

/* ---- 侧边分类 ---- */
.product-sidebar { position: sticky; top: 90px; }
.sidebar-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; border: 1px solid var(--border);
}
.sidebar-card h3 {
  padding: 18px 22px; font-size: 0.95rem; font-weight: 700;
  background: var(--primary-dark); color: #fff; letter-spacing: 0.04em;
}
.sidebar-card ul { padding: 10px 0; }
.sidebar-cat {
  display: block; padding: 11px 22px; font-size: 0.9rem; color: var(--text-mid);
  cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-cat i      { width: 16px; text-align: center; color: var(--primary); font-size: 0.88rem; }
.sidebar-cat:hover  { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); }
.sidebar-cat.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

.sidebar-contact {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius); padding: 24px 22px; color: #fff; margin-top: 20px; text-align: center;
}
.sidebar-contact h4 { font-size: 0.95rem; margin-bottom: 8px; }
.sidebar-contact p  { font-size: 0.84rem; opacity: 0.8; line-height: 1.7; margin-bottom: 16px; }
.sidebar-contact .phone { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; display: block; }

/* ---- 产品主体 ---- */
.product-main {}

/* 顶部工具栏 */
.product-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 14px;
}
.product-search-box {
  display: flex; align-items: center; gap: 0; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; background: #fff; flex: 1; max-width: 320px;
}
.product-search-box input {
  border: none; outline: none; padding: 10px 14px; font-size: 0.9rem; flex: 1; background: transparent;
}
.product-search-box button {
  background: var(--primary); color: #fff; border: none; padding: 10px 16px; font-size: 0.9rem;
  transition: background 0.2s;
}
.product-search-box button:hover { background: var(--primary-dark); }
.product-count { font-size: 0.88rem; color: var(--text-gray); }

/* 产品网格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* 产品卡片 */
.p-card { cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; transition: transform 0.3s, box-shadow 0.3s; }
.p-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.p-card-img {
  position: relative; overflow: hidden;
  height: 200px;
  background: var(--bg-light); display: flex; align-items: center; justify-content: center;
  padding: 16px;
  cursor: zoom-in;
}
.p-card-img img { max-width: 100%; max-height: 168px; width: auto; height: auto; object-fit: contain; transition: transform 0.3s; }
.p-card:hover .p-card-img img { transform: scale(1.04); }

/* =================================================================
   悬停大图预览
   ================================================================= */
.img-preview-overlay {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.img-preview-overlay.visible { opacity: 1; }
.img-preview-box {
  background: #fff; border-radius: 16px; padding: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.06);
  max-width: 520px; max-height: 520px;
  display: flex; align-items: center; justify-content: center;
}
.img-preview-box img { max-width: 480px; max-height: 480px; object-fit: contain; display: block; }
.p-card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: #fff; font-size: 0.75rem;
  font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.p-card-body { padding: 18px 20px 22px; }
.p-card-body h3 { font-size: 0.96rem; font-weight: 700; margin-bottom: 6px; line-height: 1.45; color: var(--text-dark); }
.p-card-body .model { font-size: 0.82rem; color: var(--text-gray); margin-bottom: 8px; font-family: monospace; }
.p-card-body p { font-size: 0.84rem; color: var(--text-gray); line-height: 1.7; margin-bottom: 14px; }
.p-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-light);
}
.p-card-footer .price { font-size: 0.9rem; font-weight: 700; color: var(--accent); }
.p-card-footer .btn-sm { font-size: 0.82rem; padding: 6px 16px; }

/* 隐藏产品（过滤时用） */
.p-card.hidden { display: none; }

/* =================================================================
   产品详情弹窗
   ================================================================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 820px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h2 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
  width: 36px; height: 36px; border: none; background: var(--bg-light);
  border-radius: 50%; font-size: 1.1rem; color: var(--text-gray); display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: #fde; color: #e00; }
.modal-body { padding: 28px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
.modal-img { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-light); }
.modal-img img { width: 100%; display: block; }
.modal-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.modal-info .modal-model { font-family: monospace; color: var(--text-gray); font-size: 0.85rem; margin-bottom: 16px; }
.modal-info p { font-size: 0.9rem; color: var(--text-gray); line-height: 1.8; margin-bottom: 18px; }
.param-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; margin-bottom: 20px; }
.param-table th, .param-table td { padding: 9px 14px; border: 1px solid var(--border); }
.param-table th { background: var(--bg-light); font-weight: 600; color: var(--text-dark); width: 35%; }
.param-table td { color: var(--text-mid); }
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* =================================================================
   全部产品分类区 (锚点段落)
   ================================================================= */
.cat-section { margin-bottom: 56px; }
.cat-section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; padding-bottom: 14px; border-bottom: 2px solid var(--primary-light);
}
.cat-section-header .cat-icon {
  width: 42px; height: 42px; background: var(--primary); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; flex-shrink: 0;
}
.cat-section-header h2 { font-size: 1.2rem; font-weight: 700; }
.cat-section-header span { font-size: 0.85rem; color: var(--text-gray); }

/* =================================================================
   应用领域区块
   ================================================================= */
.app-area {
  margin-top: 28px; padding: 22px 28px; background: var(--bg-light);
  border-radius: var(--radius); border-left: 4px solid var(--primary);
}
.app-area h4 { font-size: 0.96rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 14px; }
.app-area h4 i { margin-right: 8px; }
.app-area ul {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px;
  list-style: none; padding: 0; margin: 0;
}
.app-area ul li { font-size: 0.87rem; color: var(--text-mid); display: flex; align-items: center; gap: 7px; }
.app-area ul li i { color: var(--primary); font-size: 0.78rem; flex-shrink: 0; }

/* =================================================================
   响应式
   ================================================================= */
@media (max-width: 1024px) {
  .product-layout { grid-template-columns: 200px 1fr; gap: 24px; }
  .products-grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .product-layout { grid-template-columns: 1fr; }
  .product-sidebar { position: static; }
  .products-grid  { grid-template-columns: repeat(2, 1fr); }
  .modal-grid     { grid-template-columns: 1fr; }
  .app-area ul    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .products-grid  { grid-template-columns: 1fr; }
  .app-area ul    { grid-template-columns: repeat(2, 1fr); }
}
