:root {
  --black:    #0a0a0a;
  --dark:     #111318;
  --card:     #16191f;
  --border:   #2a2d35;
  --accent:   #00e5a0;
  --accent2:  #00b8ff;
  --text:     #e8eaf0;
  --muted:    #8891a4;
  --white:    #ffffff;
  --font:     'Inter', sans-serif;
  --radius:   14px;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  touch-action: manipulation; /* 禁止双击缩放，提升操作手感 */
}

html, body {
  /* 移除 overflow-x: hidden，这在移动端常会导致 sticky 失效 */
  max-width: 100vw;
}

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

/* Header */
.catalog-header {
  background: var(--black);
  border-bottom: 1px solid var(--border);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000; /* 提升层级，确保在所有产品之上 */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  padding: 24px;
  text-align: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
}

.logo span {
  color: var(--accent);
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Category Navigation */
.category-nav-wrapper {
  padding: 0 24px 16px;
  overflow-x: hidden;
  background: transparent; /* 背景交给父级 header 处理 */
}

@media (max-width: 768px) {
  .header-inner {
    padding: 16px 16px 12px; /* 压缩 Logo 区域高度 */
  }
  
  .logo {
    font-size: 1.4rem; /* 缩小 Logo 字号 */
  }
  
  .subtitle {
    font-size: 0.75rem; /* 缩小副标题 */
  }

  .category-nav-wrapper {
    padding: 0 12px 12px;
  }
  
  .catalog-header {
    background: rgba(10, 10, 10, 0.92); /* 手机端半透明背景 */
  }
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.cat-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cat-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.cat-btn.active {
  background: rgba(0, 229, 160, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* Product Grid */
.catalog-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px;
  min-height: 50vh;
  overflow-x: hidden;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.p-img-cont {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #1a1d23;
  position: relative;
}

/* Shimmer Loading Effect */
.p-img-cont::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  z-index: 1;
}

.p-img-cont.loaded::before {
  display: none;
}

.p-img-cont img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .p-img-cont img {
  transform: scale(1.05);
}

.p-info {
  padding: 16px;
}

.p-cat {
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.p-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 95vw;
  height: 92vh;
  max-width: 1600px;
  max-height: 1000px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.98);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--black);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 229, 160, 0.4);
}

.close-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 229, 160, 0.6);
}

/* Modal Body - Side by Side */
.modal-layout {
  display: grid;
  grid-template-columns: 50% 50%;
  grid-template-rows: 1fr;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

/* Left - Images */
.modal-gallery {
  background: var(--black);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.main-image-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  height: 0;
}

.main-image-container {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  width: 100%;
  aspect-ratio: 4/5; /* 固定展示窗比例 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* 改回包含模式，确保图片不被裁剪，完整显示 */
  display: block;
}

.thumbnails-wrapper {
  flex-shrink: 0;
}

.thumbnails-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.thumb-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
}

.thumb-img:hover {
  opacity: 0.9;
}

.thumb-img.active {
  opacity: 1;
  border-color: var(--accent);
}

/* Right - Details */
.modal-details {
  padding: 28px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.m-header {
  margin-bottom: 24px;
}

.m-category {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 10px;
  padding: 4px 12px;
  background: rgba(0,229,160,0.1);
  border-radius: 20px;
}

.m-title {
  font-size: 1.8rem;
  color: var(--white);
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
  word-wrap: break-word;
}

.m-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.spec-section {
  margin-bottom: 24px;
}

.spec-title {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  font-weight: 600;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 改为三列更紧凑 */
  gap: 12px;
}

.spec-item {
  background: rgba(255,255,255,0.05); /* 稍微加深背景 */
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  min-width: 0;
  transition: background 0.2s;
}

.spec-item:hover {
  background: rgba(255,255,255,0.08);
}

.spec-item .label {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.spec-item .value {
  font-size: 0.95rem;
  color: var(--white);
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.spec-item.price-highlight {
  background: linear-gradient(135deg, rgba(0,229,160,0.15), rgba(0,184,255,0.15));
  border-color: var(--accent);
}

.spec-item.price-highlight .value {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
}

/* Customization Tags */
.customization-box {
  grid-column: span 3; /* 撑满一行 */
  background: rgba(0, 184, 255, 0.05) !important;
  border-color: rgba(0, 184, 255, 0.2) !important;
  margin-top: 10px;
}

.customization-tags {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.c-tag {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--white);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.c-tag svg {
  opacity: 0.8;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .spec-grid {
    grid-template-columns: 1fr 1fr; /* 手机端恢复两列 */
  }
  .customization-box {
    grid-column: span 2;
  }
}

.modal-footer {
  margin-top: auto; /* 恢复到底部 */
  padding-top: 20px;
}

.btn-quote {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--black);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-quote:hover {
  opacity: 0.9;
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 20000;
  display: none; /* JS toggles 'flex' */
  align-items: center;
  justify-content: center;
  user-select: none;
}

.lightbox-overlay.active {
  display: flex;
}

.lb-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lb-content img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  z-index: 20002;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.05);
  color: #fff;
  border: none;
  width: 60px;
  height: 120px;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 20001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lb-arrow:hover {
  background: rgba(255,255,255,0.15);
}

.lb-prev { left: 0; border-radius: 0 10px 10px 0; }
.lb-next { right: 0; border-radius: 10px 0 0 10px; }

.lb-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  padding: 6px 16px;
  border-radius: 20px;
  color: #fff;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
}

@media (max-width: 768px) {
  .lb-arrow {
    width: 44px;
    height: 80px;
    font-size: 1.5rem;
    background: transparent; /* 手机端主要靠滑动，箭头透明点 */
  }
}

/* Responsive */
/* Tablet */
@media (max-width: 1024px) {
  .modal-content {
    width: 92vw;
    height: 88vh;
    max-width: none;
    max-height: none;
  }

  .modal-layout {
    grid-template-columns: 50% 50%;
  }

  .modal-details {
    padding: 20px 24px;
  }

  .m-title {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    overflow: hidden;
  }

  .modal-content {
    border-radius: 20px 20px 0 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 95vh; 
    height: auto; 
    overflow-y: auto; 
    display: block; 
  }

  .modal-layout {
    display: block; /* 取消伸缩布局，改为普通块布局 */
    min-height: 100%;
    width: 100%;
  }

  .modal-gallery {
    padding: 10px;
    gap: 8px;
    height: 60vh; /* 继续拉长：增加到屏幕高度的 60% */
    min-height: 60vh;
    flex-shrink: 0;
    overflow: hidden;
  }

  .main-image-container {
    aspect-ratio: auto; /* 手机端取消固定比例，自动填充窗口 */
    height: 100%;
  }

  .modal-details {
    padding: 20px;
    height: auto;
    overflow-y: visible; /* 配合父级滚动 */
  }

  .m-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }

  .m-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .spec-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .spec-item {
    padding: 10px;
  }

  .spec-item .value {
    font-size: 0.85rem;
  }

  .thumb-img {
    width: 44px;
    height: 44px;
  }

  .close-btn {
    top: max(24px, env(safe-area-inset-top, 24px));
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .btn-quote {
    padding: 14px;
    font-size: 0.95rem;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .modal-content {
    max-height: 95vh;
    height: 95vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }

  .modal-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  .modal-gallery {
    padding: 10px;
    min-height: 30vh;
    flex-shrink: 0;
    overflow: hidden;
  }

  .modal-details {
    padding: 12px 16px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .spec-item.price-highlight .value {
    font-size: 1rem;
  }

  .m-category {
    font-size: 0.6rem;
    padding: 3px 10px;
  }

  .m-title {
    font-size: 1.1rem;
  }

  .close-btn {
    top: max(24px, env(safe-area-inset-top, 24px));
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .category-nav-wrapper {
    padding: 0 12px 12px;
  }

  .category-nav {
    gap: 8px;
    width: 100%;
  }

  .cat-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.loader {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}

/* Shimmer Loading Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Base image state for fade-in effect */
img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

img.loaded {
  opacity: 1;
}

/* === FOOTER === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
footer {
  background: var(--dark); border-top: 1px solid var(--border);
  padding: 80px 0 0; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.footer-brand .logo { font-size: 1.8rem; display: inline-block; margin-bottom: 16px; text-decoration: none;}
.footer-brand p { font-size: 0.95rem; max-width: 320px; line-height: 1.8; color: var(--muted); }
.footer-col h4 { 
  color: var(--white); font-size: 1rem; font-weight: 700; 
  text-transform: uppercase; letter-spacing: 0.08em; 
  margin-bottom: 24px; position: relative; padding-bottom: 12px;
}
.footer-col h4::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 24px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 14px; }
.footer-col ul li a { 
  color: var(--muted); font-size: 0.95rem; 
  display: inline-block; transition: all 0.3s; position: relative; text-decoration:none;
}
.footer-col ul li a:hover { color: var(--accent); transform: translateX(6px); }
.footer-social { display: flex; gap: 12px; margin-top: 32px; }
.social-btn {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: all 0.3s; text-decoration:none; color:var(--text);
}
.social-btn:hover { border-color: var(--accent); background: rgba(0,229,160,0.1); }
.footer-bottom {
  border-top: 1px solid var(--border); margin-top: 60px;
  padding: 24px 0; display: flex; justify-content: space-between;
  align-items: center;
}
.footer-bottom p { font-size: 0.82rem; margin:0;}

/* === FLOATING CTA === */
@keyframes floatBounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.whatsapp-float {
  position: fixed; bottom: 32px; right: 32px; z-index: 999;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  animation: floatBounce 3s ease-in-out infinite;
}
.whatsapp-float:hover { transform: scale(1.12); box-shadow: 0 8px 32px rgba(37,211,102,0.5); }

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 1.4rem; }
}
