/* ========== 分类侧边栏横向滚动样式 ========== */
.fsco-cat-sidebar {
      position: relative;
      overflow: hidden;
/*       margin-bottom: 20px; */
      padding: 0 35px; /* 为滚动按钮预留空间 */
}

.fsco-cat-scroll-wrapper {
      overflow-x: auto;
      -ms-overflow-style: none; /* 隐藏IE滚动条 */
      scrollbar-width: none; /* 隐藏Firefox滚动条 */
/*       padding: 8px 0; */
}

.fsco-cat-scroll-wrapper::-webkit-scrollbar {
      display: none; /* 隐藏Chrome滚动条 */
}

/* 横向排列的分类列表 */
.fsco-cat-list {
      display: flex !important;
      flex-wrap: nowrap; /* 禁止换行 */
      gap: 12px;
      padding: 0;
      margin: 0;
      list-style: none;
}
.fsco-summary{
	margin-bottom:10px;
}

.fsco-cat-list li {
      flex: 0 0 auto; /* 保持项目固定宽度 */
      white-space: nowrap; /* 防止文本换行 */
      background: #f2f2f2;
      padding: 12px 20px;
      font-size: 16px;
      cursor: pointer;
      border-radius: 6px;
      transition:
            background 0.2s,
            color 0.2s;
      user-select: none;
}

.fsco-cat-list li:hover {
      background: #ddd;
}

.fsco-cat-list li.active {
      background: #333;
      color: #fff;
}

/* 滚动按钮样式 */
.fsco-scroll-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 34px;
      height: 34px;
      background: white;
      border: 1px solid #ddd;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 10;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
      transition: all 0.2s;
      color: #000;
      font-weight: 600;
      font-size: 20px;
}

.fsco-scroll-btn:hover {
      background: #f8f8f8;
      transform: translateY(-50%) scale(1.05);
}

.fsco-scroll-left {
      left: 0;
}

.fsco-scroll-right {
      right: 0;
}

/* ========== 产品网格响应式布局 ========== */
/* 6列布局基础样式 - 重点：添加flex等高容器 */
.fsco-display-grid #fsco-product-container {
      display: flex !important;
      flex-wrap: wrap !important;
      margin: 0 -10px !important; /* 抵消子元素内边距，保持布局整齐 */
}

.fsco-display-grid #fsco-product-container ul.products.columns-6 {
      display: flex !important;
      flex-wrap: wrap !important;
      width: 100% !important;
      gap: 20px !important;
      padding: 0 !important;
      margin: 0 !important;
}

.fsco-display-grid #fsco-product-container ul.products.columns-6 > li.product {
      flex: 1 0 calc(16.666% - 20px) !important; /* 6列布局（100%/6） */
      min-width: calc(16.666% - 20px) !important; /* 防止过窄 */
      width: auto !important;
      max-width: none !important;
      box-sizing: border-box !important;
}

/* 大屏响应式调整（1440px以上保持6列） */
@media (min-width: 1441px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-6 > li.product {
            flex: 1 0 calc(16.666% - 20px) !important;
            min-width: calc(16.666% - 20px) !important;
      }
}

/* 中大屏（1024-1440px）显示4列 */
@media (min-width: 1024px) and (max-width: 1440px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-6 > li.product {
            flex: 1 0 calc(25% - 20px) !important; /* 4列布局（100%/4） */
            min-width: calc(25% - 20px) !important;
      }
}

/* 平板（768-1023px）显示3列 */
@media (min-width: 768px) and (max-width: 1023px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-6 > li.product {
            flex: 1 0 calc(33.333% - 20px) !important; /* 3列布局（100%/3） */
            min-width: calc(33.333% - 20px) !important;
      }
}

/* 手机（767px以下）显示2列 */
@media (max-width: 767px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-6 > li.product {
            flex: 1 0 calc(50% - 16px) !important; /* 2列布局（100%/2） */
            min-width: calc(50% - 16px) !important;
            gap: 16px !important;
      }
}

@media (min-width: 1191px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-4 {
            display: flex !important;
            flex-wrap: wrap !important;
            width: 100% !important;
            gap: 24px !important;
            padding: 0 !important;
            margin: 0 !important;
      }
      .fsco-display-grid #fsco-product-container ul.products.columns-4 > li.product {
            flex: 1 0 calc(25% - 24px) !important;
            min-width: calc(25% - 24px) !important;
      }
}

@media (min-width: 781px) and (max-width: 1190px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-3 {
            display: flex !important;
            flex-wrap: wrap !important;
            width: 100% !important;
            gap: 20px !important;
            padding: 0 !important;
            margin: 0 !important;
      }
      .fsco-display-grid #fsco-product-container ul.products.columns-3 > li.product {
            flex: 1 0 calc(33.333% - 20px) !important;
            min-width: calc(33.333% - 20px) !important;
      }
}

@media (max-width: 780px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-2 {
            display: flex !important;
            flex-wrap: wrap !important;
            width: 100% !important;
            gap: 16px !important;
            padding: 0 !important;
            margin: 0 !important;
      }
      .fsco-display-grid #fsco-product-container ul.products.columns-2 > li.product {
            flex: 1 0 calc(50% - 16px) !important;
            min-width: calc(50% - 16px) !important;
      }
}

@media (max-width: 480px) {
      .fsco-display-grid #fsco-product-container ul.products.columns-1 {
            display: flex !important;
            flex-wrap: wrap !important;
            width: 100% !important;
            gap: 16px !important;
            padding: 0 !important;
            margin: 0 !important;
      }
      .fsco-display-grid #fsco-product-container ul.products.columns-1 > li.product {
            flex: 1 0 100% !important;
            min-width: 100% !important;
      }
}

/* 产品项通用样式 - 重点：flex布局实现等高 */
.fsco-display-grid #fsco-product-container ul.products > li.product {
      display: flex !important;
      flex-direction: column !important;
      align-items: flex-start !important; /* 产品项内部元素左对齐 */
      /* padding: 15px !important; */
      margin-bottom: 0 !important;
      transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

/* 短描述容器 - 核心：flex:1 自动填充剩余空间，实现等高 + 左对齐 */
.woocommerce-product-details__short-description {
      flex: 1 !important; /* 关键属性：让所有短描述容器高度一致 */
      width: 100% !important;
      font-size: 14px !important;
      /* line-height: 1.6 !important; */
      color: #666 !important;
      text-align: left !important; /* 短描述左对齐 */
      /* padding: 10px 0 !important; 移除左右内边距，避免对齐偏移 */
      margin: 0 !important;
      box-sizing: border-box !important;
}

.fsco-display-grid #fsco-product-container ul.products > li.product:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* ========== 过滤栏布局 ========== */
.fsco-filter-bar {
      display: flex;
      gap: 16px;
      align-items: center;
      margin-bottom: 20px;
      flex-wrap: wrap;
}

/* ========== 产品图片样式 - 恢复原有大小（移除固定尺寸限制） */
.fsco-display-grid #fsco-product-container .product img {
      width: 100% !important; /* 恢复原CSS的宽度设置 */
      height: auto !important; /* 恢复自动高度，不固定尺寸 */
      object-fit: cover !important; /* 保持原有的比例控制 */
      object-position: center !important;
      margin-bottom: 8px !important;
      border: none !important;
      padding: 0 !important;
      display: block !important;
      margin-left: 0 !important; /* 图片左对齐，与价格、描述保持一致 */
      margin-right: auto !important;
}

/* ========== 隐藏不需要的元素（仅隐藏标题和加入购物车按钮，显示价格） ========== */
.fsco-display-grid #fsco-product-container .woocommerce-loop-product__title,
.fsco-display-grid #fsco-product-container .button.add_to_cart_button {
      display: none !important; /* 只隐藏标题和加入购物车按钮 */
}

/* 恢复价格显示样式 + 左对齐 */
.fsco-display-grid #fsco-product-container .price,
.fsco-display-grid #fsco-product-container .price1 {
      display: block !important; /* 强制显示价格 */
      text-align: left !important; /* 价格左对齐 */
      padding-left: 5px !important; /* 移除左侧内边距，与短描述对齐 */
      /* margin: 8px 0 !important; 优化上下间距 */
      font-weight: 600;
}

/* 强制价格模板内的元素左对齐 */
.fsco-display-grid #fsco-product-container .price * {
      text-align: left !important;
      white-space: nowrap !important;
      display: inline !important; /* 把块级元素转为行内元素 */
      float: none !important; /* 清除可能的浮动 */
      margin: 0 !important; /* 清除内部元素边距干扰 */
      padding: 0 !important;
      font-size: 1em;
}

/* 正方形产品图片样式（保留原有冗余备份，不修改） */
.product-square-img {
      width: 200px !important;
      height: 200px !important;
      object-fit: cover !important;
      object-position: center !important;
      display: block !important;
      border: none !important;
      padding: 0 !important;
      margin: 0 auto !important; /* 居中显示 */
}

/* ========== 列表模式样式 ========== */
.fsco-display-list #fsco-product-container {
      display: block;
      width: 100%;
}

.fsco-display-list #fsco-product-container ul.products {
      display: block !important;
      max-width: 1000px;
      margin: 0 auto !important;
      /*padding: 0 16px !important;*/
}

.fsco-display-list #fsco-product-container li.product.list-view {
      display: flex !important;
      flex-direction: row !important;
      align-items: flex-start !important; /* 列表模式也等高 */
      width: 100% !important;
      padding: 16px !important;
      margin-bottom: 12px !important;
      border-bottom: 1px solid #eee !important;
}

.fsco-display-list .product-list-thumb {
      flex: 0 0 140px;
      margin-right: 20px;
}

.fsco-display-list .product-list-thumb img {
      width: 100%;
      height: 140px;
      object-fit: cover;
      border-radius: 8px;
}

/* 列表模式短描述等高 + 左对齐 */
.fsco-display-list .woocommerce-product-details__short-description {
      flex: 1 !important;
      text-align: left !important;
      padding: 0 !important;
}

/* 列表模式隐藏不需要的元素（仅隐藏标题和加入购物车按钮，显示价格） */
.fsco-display-list .woocommerce-loop-product__title,
.fsco-display-list .button.add_to_cart_button {
      display: none !important;
}
.fsco-display-list .price,
.fsco-display-list .price1 {
      display: block !important; /* 列表模式也显示价格 */
      text-align: left !important; /* 列表模式价格左对齐 */
      padding-left: 5px !important;
      /* margin: 8px 0 !important; */
      font-weight: 600;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
      .fsco-filter-bar {
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
      }

      #fsco-sort-select,
      #fsco-per-page-select {
               width: 88%;
            margin-left: 25px;
            max-width: none;
            margin-bottom: 0;
      }

      /* 移动端分类显示调整 */
      .fsco-cat-sidebar {
            padding: 0 25px;
      }

      .fsco-cat-list li {
            padding: 10px 16px;
            font-size: 14px;
      }

      .fsco-scroll-btn {
            width: 30px;
            height: 30px;
      }

      /* 列表模式移动端调整 */
      .fsco-display-list #fsco-product-container li.product.list-view {
            flex-direction: column;
            align-items: flex-start;
      }

      .fsco-display-list .product-list-thumb {
            width: 100%;
            flex: none;
            margin-right: 0;
            margin-bottom: 12px;
      }

      /* 移动端图片大小适配（恢复原有设置，不固定高度） */
      .fsco-display-grid #fsco-product-container .product img {
            width: 100% !important;
            height: auto !important; /* 恢复自动高度 */
      }
}

/* ========== 分页样式 ========== */
.fsco-pagination {
      margin-top: 30px;
      text-align: center;
      display: flex;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
}

.fsco-pagination .fsco-page-btn {
      min-width: 40px;
      min-height: 40px;
      padding: 8px 12px;
      font-size: 16px;
      border: 1px solid #ccc;
      background: #fff;
      color: #333;
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.2s;
}

.fsco-pagination .fsco-page-btn:hover {
      background-color: #f5f5f5;
      border-color: #aaa;
}

.fsco-pagination .fsco-page-btn.active {
      background-color: #333;
      color: #fff;
      border-color: #333;
}

/* ========== 加载动画 ========== */
.fsco-loader {
      text-align: center;
      padding: 60px 0;
}

.fsco-loader::after {
      content: "";
      display: inline-block;
      width: 40px;
      height: 40px;
      border: 4px solid #eee;
      border-top: 4px solid #333;
      border-radius: 50%;
      animation: spin 1s linear infinite;
}

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

/* ========== 分类下拉菜单 (仅移动端显示) ========== */
.fsco-cat-dropdown {
      display: none;
      width: 100%;
      padding: 12px;
      font-size: 16px;
      border: 1px solid #ccc;
      border-radius: 6px;
      margin-bottom: 15px;
      background: #fff;
      box-sizing: border-box;
}

@media (max-width: 576px) {
      .fsco-cat-list {
            display: none !important;
      }
      .fsco-cat-dropdown {
            display: block !important;
      }
      .fsco-scroll-btn {
            display: none !important;
      }
}

/* ========== 弹出层样式 ========== */
/* 弹窗容器默认隐藏 */
.fsco-img-popup-overlay { display: none; transition: opacity 0.3s ease !important; }

.fsco-img-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    overflow: hidden;
    box-shadow: 0 10px 60px rgba(0,0,0,0.5);
    max-width: 98vw;
    max-height: 96vh;
    padding: 0;
    margin: 0;
    border-radius: 0 !important; /* 移除圆角，减少视觉边框感 */
}

.fsco-img-popup-original {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.fsco-img-popup-close {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.95) !important;
    color: white !important;
    border: none !important;
    width: 15px !important;
    /* height: 44px !important; */
    border-radius: 50% !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

.fsco-img-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000 !important;
    z-index: 99998;
    touch-action: manipulation;
}

/* 移动端核心优化：最大化图片显示，压缩黑边 */
@media (max-width: 767px) {
    .fsco-img-popup-container {
        max-width: 100vw !important; /* 完全贴紧左右边框，无任何边距 */
        max-height: 100vh !important; /* 完全贴紧上下边框，无任何边距 */
        top: 0 !important; /* 取消居中偏移，直接从顶部开始 */
        left: 0 !important;
        transform: none !important; /* 移除居中转换，避免额外间距 */
    }

    .fsco-img-popup-original {
        width: 100vw !important; /* 强制图片宽度等于屏幕宽度 */
        height: 100vh !important; /* 强制图片高度等于屏幕高度 */
        object-fit: contain !important; /* 仍保持图片完整，不裁剪 */
        object-position: center !important; /* 确保图片居中，避免偏移 */
    }

    .fsco-img-popup-close {
        top: 10px !important; /* 按钮上移，避免遮挡图片 */
        right: 20px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 32px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.7) !important;
    }

    .fsco-img-popup-backdrop {
        backdrop-filter: none !important;
    }
}

/* 移动端横屏优化 */
@media (max-width: 767px) and (orientation: landscape) {
    .fsco-img-popup-original {
        width: 100vw !important;
        height: 100vh !important;
    }

    .fsco-img-popup-close {
        top: 5px !important;
        right: 5px !important;
        width: 32px !important;
        height: 32px !important;
    }
}