:root {
    --main-color: #3a72f8;
    --main-color-hover: #2c57d9;
    --accent-color: #ff5722;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-card: #fff;
    --radius: 12px;
    --shadow-normal: 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 14px 28px rgba(0, 0, 0, 0.15);
  }
  
  /* ========== 全局基础样式 ========== */
  body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: #fafafa;
    line-height: 1.6;
  }
  
  /* ========== 商店首页容器 ========== */
  .custom-shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 10px;
    background: #fff;
  }
  
  /* ========== 商店标题区域 ========== */
  .custom-shop-header {
    text-align: center;
    margin-bottom: 52px;
  }
  .shop-title {
    font-size: 34px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .shop-subtitle {
    font-size: 16px;
    color: var(--text-light);
  }
  
  /* ========== 商品网格布局 ========== */
  .custom-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  
  /* ========== 商品卡片 ========== */
  .custom-product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-normal);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
  }
  .custom-product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
  }
  .custom-product-card:focus-visible {
    outline: 3px solid var(--main-color);
    outline-offset: 4px;
  }

  /* 商品图片 */
  .product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f0f4ff;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
  }

/* 商品详情 */
.product-details {
  padding: 0 20px 18px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 让价格底部对齐 */
  text-align: center;
}

/* 商品标题 */
.product-title {
  font-size: 17px;
  font-weight: 500;
  color: #222;
  margin: 8px 0 12px;
  line-height: 1.3;
  min-height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* 统一标志容器，自动发货+促销 */
.product-flags {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* 自动发货tag */
.auto-deliver-tag {
  display: inline-block;
  border: 1px solid #28a745;
  color: #28a745;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 3px;
  background-color: #f6ffef;
  font-weight: 600;
  line-height: 1;
}

/* 促销标签 */
.onsale {
  background: var(--accent-color);
  color: #ffffff !important;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 3px;
  background-color: #ff5722;
  font-weight: 600;
  line-height: 1;
}

/* 商品价格 */
.product-price {
  font-size: 25px;
  font-weight: 700;
  color: #ff0600; /* 红色 */
  display: inline-block;
  margin-bottom: 5px;
}

.woocommerce-Price-currencySymbol {
  font-size: 0.7em; 
  margin-right: 3px; 
}

.product-price-block .original-price {
  color: #888;
  font-size: 20px;
  text-decoration: line-through;
}

/* 原价样式（划线灰色） */
.product-price del {
  color: #999;
  font-size: 18px;
  text-decoration: line-through;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}

/* 促销价样式（红色，无下划线） */
.product-price ins {
  color: #ff0600;
  text-decoration: none !important;
}

/*促销商品原价不显示货币标志*/
.product-price del .woocommerce-Price-currencySymbol {
  display: none;
}

/* ========== 分页样式 ========== */
.custom-pagination {
  margin-top: 54px;
  text-align: center;
}
.custom-pagination .page-numbers {
  display: inline-block;
  padding: 10px 18px;
  margin: 0 7px;
  border-radius: 6px;
  border: 1.5px solid #ccc;
  color: #444;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}
.custom-pagination .page-numbers:hover,
.custom-pagination .page-numbers.current,
.custom-pagination .page-numbers:focus-visible {
  background: var(--main-color);
  color: #fff;
  border-color: var(--main-color);
  outline: none;
}

/* ========== 响应式布局 ========== */
@media screen and (max-width: 980px) {
  .custom-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 767px) {
  .custom-shop-container {
    padding: 10px 10px;
  }

  .custom-product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .shop-title {
    font-size: 26px;
  }

  .custom-product-card {
    flex-direction: row;
    min-height: 160px;
    border-radius: var(--radius);
    height: auto; /* 取消固定高度，改用自适应 */
  }

  .product-image {
    flex: 0 0 160px;
    border-radius: var(--radius) 0 0 var(--radius);
    margin-bottom: 0;
  }

  .product-details {
    padding: 18px 16px;
    align-items: flex-start;
    text-align: left;
    justify-content: normal;
  }

  .product-title {
    font-size: 16px;
    min-height: auto;
    margin-bottom: 6px;
  }

  .product-price {
    font-size: 24px;
  }

  .woocommerce a.button,
  .custom-product-card .button {
    padding: 8px 22px;
    font-size: 13px;
    border-radius: 20px;
    width: auto;
  }
}

@media screen and (max-width: 480px) {
  .shop-title {
    font-size: 24px;
  }
  .product-title {
    font-size: 15px;
  }
}


/* 排序导航 */
.sort-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sort-button {
    padding: 8px 14px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.sort-button:hover {
    background: #eee;
}

.sort-button.active {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* 响应式优化：移动端样式 */
@media screen and (max-width: 768px) {
    .sort-form {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 5px;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
    }

    .sort-button {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
        font-size: 13px;
        padding: 8px 12px;
        border-radius: 20px;
        margin-right: 8px;
    }

    .sort-form::-webkit-scrollbar {
        display: none; /* 隐藏滚动条 */
    }
}