/*
 Theme Name:   Storefront Son
 Template:     storefront
 Version:      1.0.0
*/

/* 强制覆盖WordPress注入的全局样式，保持与原始demo一致 */
html {
  margin-top: 0px !important;
}

body {
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-family: "Microsoft YaHei", sans-serif !important;
  color: #333 !important;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  font-weight: normal !important;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  font-weight: normal;
  text-decoration: none;
  color: #333;
  font-size: 15px;
}

/* 覆盖 WordPress 古腾堡/经典主题注入的 h1-h6 字号和字重 */
h1 {
  font-size: 20px !important;
  font-weight: normal !important;
}
h2 {
  font-size: 24px !important;
  font-weight: normal !important;
}
h3 {
  font-size: 18px !important;
  font-weight: normal !important;
}
h4 {
  font-size: 16px !important;
  font-weight: normal !important;
}
h5 {
  font-size: 14px !important;
  font-weight: normal !important;
}
h6 {
  font-size: 12px !important;
  font-weight: normal !important;
}

/* 阻止 WordPress inline style 设置 .wp-container 等的 font-size */
.wp-container-core-columns-layout-1,
.wp-container-core-columns-layout-2,
[class*="wp-container"] {
  font-size: 14px !important;
}

/* 修复管理工具栏与固定导航的冲突 */
html.admin-bar {
  margin-top: 0 !important;
}

@media screen and (max-width: 782px) {
  html.admin-bar {
    margin-top: 0 !important;
  }
}

/* 移动端内页子导航补偿 - 间距由layout.css统一管理 */

/* 修复大屏幕下导航间距不匹配问题 */
@media (min-width: 1680px) {
  .logo {
    padding: 20px 0 0 60px !important;
  }

  /* 调整header-nav的padding-left以更好地匹配布局 */
  .header-nav {
    padding-left: 5% !important;
  }
}

/* 确保图片显示与demo一致 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 修复WordPress可能添加的额外样式影响 */
.headerweb .logo img {
  display: block;
  max-width: none;
}

/* 确保导航布局与demo一致 */
.header-nav {
  float: left;
}

.header-right {
  float: right;
}

/* 确保header容器布局正确 */
.headerweb {
  max-width: 100%;
  width: 100%;
}

/* 修复WordPress body_class可能添加的类对布局的影响 */
body.home .headerweb,
body.page .headerweb,
body.single .headerweb {
  position: relative;
}

/* 确保在所有屏幕尺寸下commonweb容器正常工作 */
.commonweb {
  width: 100%;
  box-sizing: border-box;
}

/* 修复搜索图标样式 */
.head-search__btn span {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: #fff;
}

/* ==================== 产品下拉菜单样式 ==================== */
.menu-pro-sub {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s ease-in-out;
  transition-duration: 0.6s;
  position: fixed;
  top: 99px;
  z-index: 999999;
  left: 0;
  background: #fff;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  padding: 20px 0;
}

.menu-pro-sub .commonweb {
  display: flex;
}

.menu-pro-sub .item {
  flex: 1;
  padding-right: 160px;
}

.menu-pro-sub .item a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 0;
  display: block;
  color: #333;
  font-size: 15px;
}

.menu-pro-sub .item h4 {
  border-bottom: 2px solid #74a92d;
  padding-bottom: 5px;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 18px;
}

.menu-pro-sub .item h4 a {
  font-weight: bold;
  font-size: 18px;
}

.menu-pro-sub .item a:hover {
  color: #399d26;
}

li:hover .menu-pro-sub {
  transform: scaleY(1);
}

@media screen and (max-width: 992px) {
  .menu-pro-sub {
    display: none;
  }
}

/* 系列菜单链接每排显示2个 */
.menu-pro-sub .item:nth-child(2) h4 {
  width: 100%;
  display: block;
}

.menu-pro-sub .item:nth-child(2) {
  display: flex;
  flex-wrap: wrap;
}

.menu-pro-sub .item:nth-child(2) a {
  display: inline-block;
  width: 50%;
  box-sizing: border-box;
}

/* ==================== 联系我们页面样式 ==================== */
#page-contact-us {
  overflow: hidden;
}

#page-contact-us .contact-wrapper {
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}

#page-contact-us .thumb {
  float: left;
  width: 557px;
  margin: -1px 0 -1px -1px;
}

#page-contact-us .thumb img {
  display: block;
  max-width: 100%;
  height: auto;
}

#page-contact-us .infor {
  padding: 0px 24px 0 70px;
  color: #929292;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 36px;
  overflow: hidden;
}

#page-contact-us .section-title {
  margin: 0;
  padding: 0 0 5px;
  font-size: 24px;
  color: #399d26;
  font-weight: normal;
}

#page-contact-us .info-item {
  margin: 0;
}

#page-contact-us .PS {
  margin: 0;
  padding: 0;
}

#page-contact-us .name,
#page-contact-us .text {
  margin: 0;
  padding: 0;
  display: block;
}

#page-contact-us .name {
  float: left;
}

#page-contact-us .factory-title {
  display: inline-block;
  font-size: 24px;
  color: #ff0000;
}

/* ==================== 免费定制样品页面样式 ==================== */

#page-custom-sample .custom-sample-title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin: 0 0 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #74a92d;
}

#page-custom-sample .custom-sample-features {
  list-style: none;
  padding: 0;
}

#page-custom-sample .custom-sample-features li {
  padding: 3px 0;
}

#page-custom-sample .custom-sample-features li:last-child {
  border-bottom: none;
}

#page-custom-sample .feature-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.8;
  display: block;
}

#page-custom-sample .custom-sample-tip {
  font-size: 16px;
  color: #333;
  margin: 30px 0 0;
  padding: 20px;
  background: #f9f9f9;
  border-left: 4px solid #74a92d;
  border-radius: 4px;
}

/* ==================== 产品详情页样式 ==================== */
/* 产品详情页主容器 */
.product-detail-page {
  background: #f8f8f8;
  padding: 20px 0;
}

/* 顶部Tab切换 */
.product-tab-nav {
  background: #fff;
  padding: 0;
  margin-bottom: 30px;
}

.product-tab-nav ul {
  display: flex;
  justify-content: center;
  gap: 40px;
}

.product-tab-nav li {
  padding: 15px 0;
}

.product-tab-nav li a {
  font-size: 18px;
  color: #666;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.product-tab-nav li.active a {
  color: #399d26;
  border-bottom-color: #399d26;
}

/* 产品主内容区 */
.product-main-content {
  background: #fff;
  padding: 40px;
  margin-bottom: 30px;
}

/* 左侧图片区 */
.product-image-box {
  display: inline-block;
  vertical-align: top;
  width: 45%;
  padding-right: 30px;
}

.product-image-box .image-wrapper {
  position: relative;
  background: white;
  padding: 40px;
  text-align: center;
  border: 1px solid #399d26;
}

.product-image-box .image-wrapper img {
  max-width: 100%;
  height: auto;
  max-height: 400px;
}

/* 产品相册 */
.product-gallery .gallery-main {
  margin-bottom: 10px;
}

.product-gallery .gallery-thumbs ul {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.product-gallery .gallery-thumbs li {
  width: 60px;
  height: 60px;
  border: 2px solid #eee;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.3s;
}

.product-gallery .gallery-thumbs li.active {
  border-color: #399d26;
}

.product-gallery .gallery-thumbs li:hover {
  border-color: #399d26;
}

.product-gallery .gallery-thumbs li a {
  display: block;
  width: 100%;
  height: 100%;
}

.product-gallery .gallery-thumbs li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 右侧信息区 */
.product-info-box {
  display: inline-block;
  vertical-align: top;
  width: 54%;
  padding-left: 30px;
}

.product-info-box .product-category {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.product-info-box .product-title {
  font-size: 32px;
  color: #399d26;
  margin-bottom: 15px;
  line-height: 1.3;
}

.product-info-box .product-model {
  font-size: 20px;
  color: #333;
  margin-bottom: 20px;
}

.product-info-box .product-desc {
  font-size: 18px;
  color: #666;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
}

.product-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  margin-bottom: 10px;
}

.product-info-grid .product-desc {
  padding: 6px 0;
  font-size: 16px;
  color: #555;
  border-bottom: 1px dashed #e0e0e0;
  margin-bottom: 0;
}

/* 产品标签 */
.product-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.product-tag-icon {
  font-size: 18px;
  line-height: 1;
  margin-right: 4px;
  opacity: 0.75;
}

.product-tag {
  display: inline-block;
  font-size: 12px;
  color: #399d26;
  background: #f0faf0;
  border: 1px solid #d4edd4;
  border-radius: 3px;
  padding: 3px 10px;
  text-decoration: none !important;
  line-height: 1.6;
  transition: all 0.2s;
  white-space: nowrap;
}

.product-tag:hover {
  color: #fff;
  background: #399d26;
  border-color: #399d26;
}

/* 价格样式 */
.product-price-box {
  margin-bottom: 15px;
  padding: 10px 0;
}

.product-price-box .price-regular {
  font-size: 18px;
  color: #999;
  text-decoration: line-through;
  margin-right: 10px;
}

.product-price-box .price-sale {
  font-size: 24px;
  color: #399d26;
  font-weight: bold;
}

.product-price-box .price-current {
  font-size: 24px;
  color: #399d26;
  font-weight: bold;
}

/* 库存样式 */
.product-stock-box {
  margin-bottom: 20px;
}

.product-stock-box .stock-in {
  color: #399d26;
  font-weight: 500;
}

.product-stock-box .stock-out {
  color: #d82019;
  font-weight: 500;
}

.product-stock-box .stock-available {
  color: #666;
}

.product-info-box .product-actions {
  display: flex;
  gap: 20px;
}

.product-info-box .product-actions a {
  display: inline-block;
  padding: 12px 30px;
  font-size: 16px;
  background: #399d26;
  color: #fff;
  transition: background 0.3s;
}

.product-info-box .product-actions a:hover {
  background: #2d7d1e;
}

.product-info-box .product-actions a.secondary {
  background: #666;
}

.product-info-box .product-actions a.secondary:hover {
  background: #444;
}

/* 详情内容区 */
.product-detail-content {
  background: #fff;
  padding: 40px;
  margin-bottom: 30px;
}

/* 左侧菜单 */
.detail-sidebar {
  display: inline-block;
  vertical-align: top;
  width: 22%;
  padding-right: 20px;
}

.detail-sidebar ul {
  border: 1px solid #eee;
}

.detail-sidebar li {
  border-bottom: 1px solid #eee;
}

.detail-sidebar li:last-child {
  border-bottom: none;
}

.detail-sidebar li a {
  display: block;
  padding: 15px 20px;
  font-size: 16px;
  color: #333;
  background: #fafafa;
  transition: all 0.3s;
}

.detail-sidebar li.active a,
.detail-sidebar li a:hover {
  background: #399d26;
  color: #fff;
}

/* 右侧详情 */
.detail-content {
  display: inline-block;
  vertical-align: top;
  width: 76%;
  padding-left: 30px;
}

.detail-section {
  display: none;
}

.detail-section.active {
  display: block;
}

.detail-section .section-title {
  font-size: 20px;
  color: #333;
  padding-bottom: 15px;
  border-bottom: 2px solid #399d26;
  margin-bottom: 20px;
}

/* 参数表格 */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.param-table tr {
  border-bottom: 1px solid #eee;
}

.param-table td {
  padding: 12px 10px;
  line-height: 1.6;
}

.param-table td:first-child {
  font-weight: 500;
  color: #333;
  width: 35%;
  background: #f9f9f9;
}

.param-table td:last-child {
  color: #666;
}

/* 参数免责声明 */
.param-disclaimer {
  font-size: 12px;
  color: #999;
  font-style: italic;
  line-height: 1.6;
  padding: 10px 14px;
  margin: 0 0 8px 0;
  background: #fffbe6;
  border-left: 3px solid #faad14;
  border-radius: 0 4px 4px 0;
}

/* 维度Tab */
.dimension-section {
  display: none;
}

.dimension-section.active {
  display: block;
}

.dimension-section img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
}

/* 相关产品 */
.related-products {
  background: #fff;
  padding: 40px;
  margin-bottom: 30px;
}

.related-products .section-title {
  font-size: 28px;
  text-align: center;
  color: #333;
}

.related-products .product-list {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.related-products .product-item {
  width: 25%;
  padding: 0 10px;
  margin-bottom: 30px;
}

.related-products .product-item a {
  display: block;
  background: #fafafa;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
}

.related-products .product-item a:hover {
  background: #f0f0f0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.related-products .product-item .item-cat {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

.related-products .product-item .item-name {
  font-size: 16px;
  color: #333;
  margin-bottom: 10px;
}

.related-products .product-item .item-desc {
  font-size: 13px;
  color: #666;
}

.related-products .product-item img {
  max-width: 100%;
  height: auto;
  max-height: 120px;
  margin-bottom: 15px;
}

/* 相关产品竖排列表（详情页侧栏Tab） */
.related-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #eee;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
}

.related-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  text-decoration: none !important;
  color: #333;
  transition: background 0.2s;
}

.related-item:hover {
  background: #f6f9ff;
}

.related-item-img {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

.related-item-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.related-item-body {
  flex: 1;
  min-width: 0;
}

.related-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a3a6b;
  margin-bottom: 6px;
}

.related-item:hover .related-item-title {
  color: #0056b3;
}

.related-item-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 8px;
}

.related-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #888;
}

.related-item-meta span {
  position: relative;
  padding-left: 12px;
}

.related-item-meta span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  background: #399d26;
  border-radius: 50%;
}

/* 申请样品区域 */
.sample-apply {
  background: #fff;
  padding: 50px;
  text-align: center;
  margin-bottom: 30px;
}

.sample-apply p {
  font-size: 20px;
  margin-bottom: 20px;
}

.sample-apply a {
  display: inline-block;
  padding: 15px 40px;
  background: #399d26;
  color: #fff;
  font-size: 18px;
  transition: background 0.3s;
}

.sample-apply a:hover {
  background: #2d7d1e;
}

/* 产品详情页响应式 */
@media (max-width: 992px) {
  .product-image-box,
  .product-info-box {
    width: 100%;
    display: block;
    padding: 0 0 20px 0;
  }

  .product-image-box {
    text-align: center;
  }

  .detail-sidebar,
  .detail-content {
    width: 100%;
    display: block;
  }

  .detail-sidebar {
    margin-bottom: 15px;
  }

  .detail-sidebar ul {
    display: flex;
    flex-wrap: wrap;
  }

  .detail-sidebar li {
    border-bottom: none;
    border-right: 1px solid #eee;
  }

  .detail-sidebar li:last-child {
    border-right: none;
  }

  .detail-sidebar li a {
    padding: 10px 15px;
    font-size: 14px;
  }

  .related-products .product-item {
    width: 50%;
  }

  .product-tab-nav ul {
    gap: 20px;
  }

  .product-tab-nav li a {
    font-size: 15px;
  }

  .product-tab-nav {
    margin-bottom: 15px;
  }

  .product-tab-nav li {
    padding: 10px 0;
  }

  .param-table td {
    padding: 8px;
    font-size: 13px;
  }

  .detail-section .section-title {
    font-size: 16px;
    padding-bottom: 10px;
    margin-bottom: 15px;
  }
}

@media (max-width: 768px) {
  .product-tab-nav ul {
    gap: 15px;
  }

  .product-tab-nav li a {
    font-size: 14px;
  }

  .product-main-content,
  .product-detail-content,
  .related-products,
  .sample-apply {
    padding: 12px;
  }

  .product-info-box .product-title {
    font-size: 20px;
  }

  .product-info-box .product-desc {
    font-size: 13px;
  }

  .product-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
  }

  .product-info-grid .product-desc {
    font-size: 13px;
    padding: 4px 0;
  }

  .product-info-box .product-actions {
    flex-direction: column;
  }

  .product-info-box .product-actions a {
    text-align: center;
    font-size: 14px;
    padding: 10px 20px;
  }

  .related-products .product-item {
    width: 100%;
  }

  .related-products .product-item a {
    padding: 12px;
  }

  .related-products .product-item .item-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .related-products .section-title {
    font-size: 18px;
  }

  .related-item {
    padding: 12px;
    gap: 10px;
  }

  .related-item-img {
    width: 56px;
    height: 56px;
  }

  .related-item-title {
    font-size: 14px;
  }

  .related-item-desc {
    font-size: 12px;
  }

  .related-item-meta {
    font-size: 11px;
    gap: 8px;
  }

  .sample-apply {
    padding: 15px;
  }

  .sample-apply p {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .sample-apply a {
    padding: 10px 25px;
    font-size: 14px;
  }

  .param-table td {
    padding: 6px;
    font-size: 12px;
  }

  .detail-section .section-title {
    font-size: 15px;
  }
}
