/* WP Visual Builder - Frontend Styles for Published Pages */

/* ===== 全局重置：隔离主题样式污染 ===== */
.wpvb-page,
.wpvb-page * {
  box-sizing: border-box;
}

/* 强制重置 ul/li，防止主题样式污染导致列表符号出现 */
.wpvb-page ul,
.wpvb-page ol,
.wpvb-page li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 强制重置链接、标题、段落继承 */
.wpvb-page a { text-decoration: none; }
.wpvb-page h1, .wpvb-page h2, .wpvb-page h3,
.wpvb-page h4, .wpvb-page h5, .wpvb-page h6 {
  margin: 0; padding: 0; font-weight: inherit; line-height: inherit;
}
.wpvb-page p { margin: 0; padding: 0; }
/* 全局图片重置，但排除 nav logo（用更具体的选择器覆盖） */
.wpvb-page img { max-width: 100%; display: block; }
.wpvb-page button { cursor: pointer; }

/* ===== 布局容器 ===== */
.wpvb-page { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.wpvb-boxed .wpvb-nav-inner,
.wpvb-boxed .wpvb-heading,
.wpvb-boxed .wpvb-text,
.wpvb-boxed .wpvb-image-text,
.wpvb-boxed .wpvb-grid,
.wpvb-boxed .wpvb-mask-grid,
.wpvb-boxed .wpvb-table-wrap,
.wpvb-boxed .wpvb-button-wrap,
.wpvb-boxed .wpvb-social,
.wpvb-boxed .wpvb-footer-inner {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ===== NAV ===== */
.wpvb-nav { position: relative; z-index: 100; }
.wpvb-nav-inner {
  display: flex;
  align-items: center;
  height: 64px;
}
.wpvb-nav.style-logo .wpvb-nav-inner { justify-content: space-between; }
.wpvb-nav-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wpvb-nav-brand img { height: 40px; width: auto; object-fit: contain; }
.wpvb-nav-brand-name { font-weight: 700; font-size: 18px; }
.wpvb-nav-menu {
  display: flex !important;
  align-items: center !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.wpvb-nav-menu > li {
  position: relative;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.wpvb-nav-menu > li > a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}
.wpvb-nav-menu li.has-children > a::after { content: ' ▾'; font-size: 10px; }
.wpvb-nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 8px;
  min-width: 160px;
  list-style: none !important;
  padding: 6px 0 !important;
  margin: 0 !important;
  z-index: 200;
}
.wpvb-nav-menu li:hover > .wpvb-nav-dropdown { display: block; }
.wpvb-nav-dropdown li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.wpvb-nav-dropdown li a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  font-size: 13px;
  color: #374151;
  transition: background 0.2s;
}
.wpvb-nav-dropdown li a:hover { background: #f3f4f6; }

/* ===== Mobile Nav ===== */
.wpvb-nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
  margin-left: auto;
}
.wpvb-nav-mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .wpvb-nav-menu { display: none !important; }
  .wpvb-nav-menu.mobile-open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: inherit;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1000;
    padding: 8px 0 !important;
  }
  .wpvb-nav-mobile-toggle { display: flex !important; }
  .wpvb-image-text-inner { flex-direction: column !important; }
  .wpvb-grid-inner { grid-template-columns: 1fr !important; }
  .wpvb-mask-grid-inner { grid-template-columns: 1fr !important; }
  .wpvb-banner-title { font-size: 22px !important; }
  .wpvb-banner-subtitle { font-size: 14px !important; }
  .wpvb-mask-fullwidth-title { font-size: 24px !important; }
}

/* ===== 修复：nav logo 高度不被全局 img 重置覆盖 ===== */
.wpvb-page .wpvb-nav-brand img {
  height: 40px !important;
  width: auto !important;
  max-width: none !important;
  display: inline-block;
}

/* ===== 确保 image_text flex 布局在前端正常工作 ===== */
.wpvb-page .wpvb-image-text-inner {
  display: flex !important;
  align-items: center;
}
.wpvb-page .wpvb-image-text.layout-right .wpvb-image-text-inner { flex-direction: row-reverse !important; }
.wpvb-page .wpvb-image-text.layout-top .wpvb-image-text-inner { flex-direction: column !important; }
.wpvb-page .wpvb-image-text.layout-bottom .wpvb-image-text-inner { flex-direction: column-reverse !important; }
.wpvb-page .wpvb-image-text-image { flex-shrink: 0; }
.wpvb-page .wpvb-image-text-image img { height: auto !important; }

/* ===== 确保 grid flex/grid 布局在前端正常工作 ===== */
.wpvb-page .wpvb-grid-inner { display: grid !important; }
.wpvb-page .wpvb-mask-grid-inner { display: grid !important; }
.wpvb-page .wpvb-mask-fullwidth { position: relative; }

/* ===== 全屏布局（fullwidth）强制覆盖主题容器 ===== */
/* JS 会把 .wpvb-fullwidth 移到 body 下，这里确保它全宽铺开 */
body > .wpvb-page.wpvb-fullwidth {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  left: 0 !important;
  right: 0 !important;
  box-sizing: border-box;
}
/* fullwidth 模式下所有内容组件也不限制最大宽度 */
.wpvb-fullwidth .wpvb-nav-inner,
.wpvb-fullwidth .wpvb-heading,
.wpvb-fullwidth .wpvb-text,
.wpvb-fullwidth .wpvb-image-text,
.wpvb-fullwidth .wpvb-grid,
.wpvb-fullwidth .wpvb-mask-grid,
.wpvb-fullwidth .wpvb-table-wrap,
.wpvb-fullwidth .wpvb-button-wrap,
.wpvb-fullwidth .wpvb-social,
.wpvb-fullwidth .wpvb-footer-inner {
  max-width: none !important;
  padding-left: 40px;
  padding-right: 40px;
}

/* ===== CODE BLOCK（自定义代码组件）===== */
.wpvb-code-block {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.wpvb-code-block iframe {
  display: block;
  width: 100%;
  border: none;
  min-height: 100px;
}

/* ===== PRODUCT / PRODUCT_CAT / POSTS 组件 ===== */
.wpvb-product-section,
.wpvb-product-cat-section,
.wpvb-posts-section {
  padding: 0;
}
.wpvb-section-title-wrap {
  text-align: center;
  margin-bottom: 28px;
}
.wpvb-section-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}
.wpvb-product-grid,
.wpvb-pcat-grid {
  display: grid;
}
.wpvb-product-card,
.wpvb-pcat-card {
  transition: transform .2s, box-shadow .2s;
}
.wpvb-pcat-card.wpvb-pcat-active {
  border-color: #7c3aed !important;
}
/* Responsive */
@media (max-width: 768px) {
  .wpvb-product-grid,
  .wpvb-pcat-grid,
  .wpvb-posts-section > div > div {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 480px) {
  .wpvb-product-grid,
  .wpvb-pcat-grid,
  .wpvb-posts-section > div > div {
    grid-template-columns: 1fr !important;
  }
}

/* === HOVER EFFECTS ON FRONTEND === */
.wpvb-grid-col:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
.wpvb-product-card:hover { transform: translateY(-5px) !important; box-shadow: 0 12px 36px rgba(124,58,237,0.18) !important; }
.wpvb-pcat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.10); }
.wpvb-button { transition: background 0.2s, transform 0.15s, box-shadow 0.2s !important; }
.wpvb-button:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.wpvb-stats-item:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(124,58,237,0.15); }
.wpvb-mask-grid-item { overflow: hidden; border-radius: 8px; transition: box-shadow 0.3s; }
.wpvb-mask-grid-item:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.2); }
.wpvb-table tr:hover td { background: rgba(124,58,237,0.04) !important; }

/* === INQUIRY POPUP === */
.wpvb-inquiry-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99998;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.wpvb-inquiry-popup-overlay.open { display: flex; }
.wpvb-inquiry-popup-box {
  background: #fff;
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  position: relative;
  overflow: hidden;
  animation: wpvbPopupIn 0.3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes wpvbPopupIn {
  from { opacity:0; transform: scale(0.88) translateY(20px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
.wpvb-inquiry-popup-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  border: none;
  background: rgba(0,0,0,0.08);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  color: #374151;
  transition: background 0.2s;
  z-index: 2;
}
.wpvb-inquiry-popup-close:hover { background: rgba(0,0,0,0.15); }

/* === STATS COMPONENT === */
.wpvb-stats-section { padding: 40px 24px; }
.wpvb-stats-grid { display: grid; gap: 24px; }
.wpvb-stats-item {
  text-align: center;
  padding: 28px 20px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  transition: transform 0.25s, box-shadow 0.25s;
}
.wpvb-stats-number {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.wpvb-stats-suffix { font-size: 26px; font-weight: 700; }
.wpvb-stats-label { font-size: 14px; margin-top: 4px; }

/* ===== 全局 Hover 特效 ===== */
.wpvb-grid-col,
.wpvb-product-card,
.wpvb-pcat-card,
.wpvb-posts-section > div > div > div,
.wpvb-counter-item {
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
}
.wpvb-grid-col:hover,
.wpvb-product-card:hover,
.wpvb-pcat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12) !important;
}
/* 按钮 hover */
.wpvb-button {
  transition: all .2s !important;
  cursor: pointer;
}
.wpvb-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
/* 图文组合 hover */
.wpvb-image-text a:hover img,
.wpvb-product-card a:hover img {
  transform: scale(1.03);
  transition: transform .3s;
}
/* 弹窗询盘 modal 动画 */
.wpvb-inquiry-modal { transition: none; }
.wpvb-inquiry-modal > div {
  animation: wpvbModalIn .25s ease-out;
}
@keyframes wpvbModalIn {
  from { transform: scale(.9) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);    opacity: 1; }
}


/* ===== GRID / PRODUCT 图片高度修复（防止被全局 img 重置覆盖）===== */
.wpvb-page .wpvb-grid-col img,
.wpvb-page .wpvb-mask-grid-item img {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover !important;
  display: block !important;
}
.wpvb-page .wpvb-product-card img {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover !important;
  display: block !important;
}
/* banner 图片不受影响 */
.wpvb-page .wpvb-banner-slide img {
  height: 100% !important;
  width: 100% !important;
  object-fit: cover !important;
}
/* product_cat 分类卡图片 */
.wpvb-page .wpvb-pcat-card img {
  height: 140px !important;
  width: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
/* posts 文章图片 */
.wpvb-page .wpvb-posts-section img {
  object-fit: cover !important;
  display: block !important;
}
/* footer/social 图片正常 */
.wpvb-page .wpvb-footer img,
.wpvb-page .wpvb-social img {
  height: auto !important;
}

/* ===== 全局 Hover 特效加强版 ===== */
.wpvb-page .wpvb-grid-col,
.wpvb-page .wpvb-product-card,
.wpvb-page .wpvb-pcat-card,
.wpvb-page .wpvb-counter-item {
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s !important;
}
.wpvb-page .wpvb-grid-col:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.12) !important;
}
.wpvb-page .wpvb-product-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 12px 36px rgba(124,58,237,.18) !important;
}
.wpvb-page .wpvb-pcat-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.10) !important;
}
.wpvb-page .wpvb-button {
  transition: all .2s !important;
}
.wpvb-page .wpvb-button:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.18) !important;
}
/* image_text 图片缩放 hover */
.wpvb-page .wpvb-image-text-image img {
  transition: transform .35s ease !important;
  overflow: hidden;
}
.wpvb-page .wpvb-image-text-image:hover img {
  transform: scale(1.04) !important;
}
/* social icon hover */
.wpvb-page .wpvb-social-icon {
  transition: transform .2s, opacity .2s !important;
}
.wpvb-page .wpvb-social-icon:hover {
  transform: scale(1.15) translateY(-3px) !important;
  opacity: 0.9 !important;
}
/* table row hover */
.wpvb-page .wpvb-table tr:hover td {
  background: rgba(124,58,237,.05) !important;
}
/* nav menu item hover */
.wpvb-page .wpvb-nav-menu > li > a {
  transition: color .2s, background .2s !important;
}
/* counter number animation */
.wpvb-counter-item {
  transition: transform .25s, box-shadow .25s !important;
}
.wpvb-counter-item:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 28px rgba(124,58,237,.15) !important;
}

/* ===== 全局弹窗 Inquiry Popup ===== */
.wpvb-global-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.wpvb-global-popup-overlay.wpvb-popup-open {
  display: flex;
}
.wpvb-global-popup-box {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  padding: 32px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: wpvbPopIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes wpvbPopIn {
  from { opacity: 0; transform: scale(.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.wpvb-global-popup-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  border: none; background: #f3f4f6;
  border-radius: 50%; cursor: pointer;
  font-size: 18px; line-height: 32px;
  text-align: center; color: #374151;
  transition: background .2s;
}
.wpvb-global-popup-close:hover { background: #e5e7eb; }

/* ============================================================
   产品主图组件 (product_hero)
   ============================================================ */
.wpvb-product-hero { padding: 32px 24px; }
.wpvb-ph-layout { display: flex; align-items: flex-start; gap: 20px; max-width: 1200px; margin: 0 auto; }
.wpvb-ph-main-img { flex: 1; min-width: 0; }
.wpvb-ph-img-ratio { position: relative; width: 100%; overflow: hidden; border-radius: 8px; background: #f3f4f6; }
.wpvb-ph-slide { position: absolute; inset: 0; display: none; }
.wpvb-ph-slide.active { display: block; }
.wpvb-ph-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5); color: #fff; border: none;
  width: 36px; height: 36px; border-radius: 50%; font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 2; transition: background .2s;
}
.wpvb-ph-arrow:hover { background: rgba(0,0,0,.75); }
.wpvb-ph-prev { left: 10px; }
.wpvb-ph-next { right: 10px; }

/* 底部缩略图（样式1） */
.wpvb-ph-thumbs-bottom { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.wpvb-ph-thumbs-bottom .wpvb-ph-thumb-item { width: 72px; height: 54px; flex-shrink: 0; border-radius: 4px; overflow: hidden; border: 2px solid #e5e7eb; cursor: pointer; transition: border-color .2s; }
.wpvb-ph-thumbs-bottom .wpvb-ph-thumb-item.active { border-color: #7c3aed; }

/* 左侧缩略图（样式2） */
.wpvb-ph-thumbs-left { width: 88px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
.wpvb-ph-thumb-nav { width: 100%; background: #f3f4f6; border: none; padding: 6px 0; cursor: pointer; border-radius: 4px; color: #374151; font-size: 16px; line-height: 1; }
.wpvb-ph-thumb-nav:hover { background: #e5e7eb; }
.wpvb-ph-thumbs-track { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.wpvb-ph-thumbs-left .wpvb-ph-thumb-item { width: 100%; height: 70px; border-radius: 4px; overflow: hidden; border: 2px solid #e5e7eb; cursor: pointer; transition: border-color .2s; }
.wpvb-ph-thumbs-left .wpvb-ph-thumb-item.active { border-color: #7c3aed; }

/* 右侧文字 */
.wpvb-ph-info { flex: 1; padding-left: 24px; }
.wpvb-ph-title { font-size: 24px; font-weight: 700; color: #111827; margin-bottom: 14px; line-height: 1.3; }
.wpvb-ph-desc { font-size: 15px; color: #6b7280; line-height: 1.75; margin-bottom: 20px; }
.wpvb-ph-share { margin-bottom: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wpvb-ph-btn-wrap { margin-top: 4px; }
.wpvb-ph-cta {
  display: inline-block; background: #7c3aed; color: #fff;
  padding: 12px 32px; border-radius: 6px; font-size: 15px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
  transition: opacity .2s; line-height: 1.4;
}
.wpvb-ph-cta:hover { opacity: .85; color: #fff; }

@media (max-width: 768px) {
  .wpvb-ph-layout { flex-direction: column; }
  .wpvb-ph-thumbs-left { flex-direction: row; width: 100%; }
  .wpvb-ph-thumbs-track { flex-direction: row; }
  .wpvb-ph-info { padding-left: 0; margin-top: 16px; }
}

/* ============================================================
   图片横向滚动组件 (img_scroll)
   ============================================================ */
.wpvb-img-scroll-wrap { overflow: hidden; padding: 16px 0; }
.wpvb-img-scroll-track {
  display: flex;
  width: max-content;
  animation: wpvbScrollLeft 30s linear infinite;
}
@keyframes wpvbScrollLeft {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.wpvb-img-scroll-wrap:hover .wpvb-img-scroll-track { animation-play-state: paused; }
.wpvb-img-scroll-item { flex-shrink: 0; }
.wpvb-img-scroll-title { text-align: center; font-size: 12px; color: #374151; margin-top: 6px; line-height: 1.4; }

/* ============================================================
   产品详情页 (product_hero + 产品管理)
   ============================================================ */
.wpvb-ph-price {
  font-size: 22px;
  font-weight: 700;
  color: #7c3aed;
  margin: 10px 0 16px;
  line-height: 1.3;
}

/* 富文本内容渲染（RTE） */
.wpvb-rte-content { line-height: 1.75; color: #374151; }
.wpvb-rte-content h2 { font-size: 1.35em; font-weight: 700; margin: 1em 0 .5em; color: #111827; }
.wpvb-rte-content h3 { font-size: 1.15em; font-weight: 700; margin: 1em 0 .4em; color: #111827; }
.wpvb-rte-content h4 { font-size: 1.05em; font-weight: 700; margin: 1em 0 .4em; color: #111827; }
.wpvb-rte-content p  { margin: 0 0 .75em; }
.wpvb-rte-content ul, .wpvb-rte-content ol { padding-left: 1.5em; margin: 0 0 .75em; }
.wpvb-rte-content li { margin-bottom: .3em; }
.wpvb-rte-content a  { color: #7c3aed; text-decoration: underline; }
.wpvb-rte-content strong, .wpvb-rte-content b { font-weight: 700; }
.wpvb-rte-content em, .wpvb-rte-content i { font-style: italic; }
.wpvb-rte-content u  { text-decoration: underline; }
.wpvb-rte-content table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.wpvb-rte-content td, .wpvb-rte-content th { padding: 8px 12px; border: 1px solid #e5e7eb; }
.wpvb-rte-content th { background: #f3f4f6; font-weight: 600; }

/* 产品链接单元格 */
.wpvb-prod-link-cell a {
  color: #7c3aed;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 240px;
}
.wpvb-prod-link-cell a:hover { text-decoration: underline; }
