yoone-wc-product-bundles/assets/css/frontend.css

112 lines
2.9 KiB
CSS

/* Yoone Product Bundles 前端样式(简版) */
.yoone-bundle-form { margin-top: 1em; }
.yoone-bundle-group { margin-bottom: 1.5em; }
.yoone-bundle-group-title { margin: 0.5em 0; font-weight: 600; }
.yoone-bundle-table { width: 100%; border-collapse: collapse; }
.yoone-bundle-table th, .yoone-bundle-table td { border-bottom: 1px solid #eee; padding: 8px; }
.yoone-bundle-meta { display: flex; gap: 1em; align-items: center; }
.yoone-bundle-actions { margin-top: 1em; }
/* 在混装产品页面隐藏默认产品图片区域(兼容常见主题结构) */
.product.type-yoone_bundle div.images,
.single-product .product.type-yoone_bundle .images {
display: none !important;
}
/* 表格列宽优化 */
.yoone-bundle-table th:nth-child(3),
.yoone-bundle-table td:nth-child(3) { width: 160px; }
/* 强制混装产品页面的内容区域为全宽,以容纳卡片布局 */
.yoone-bundle-product-page .summary {
width: 100% !important; /* 覆盖主题默认的宽度限制 */
float: none !important; /* 清除浮动 */
}
.yoone-bundle-add-to-cart-button {
margin-top: 1em;
}
/* 新的卡片式布局样式 */
.yoone-bundle-items-wrapper {
display: flex;
flex-wrap: wrap;
gap: 1em;
margin: 1em;
}
.yoone-bundle-item-card {
display: flex;
flex-direction: column;
align-items: center; /* 垂直居中对齐 */
width: 150px; /* 卡片宽度,可根据需要调整 */
border: 1px solid #eee;
border-radius: 8px;
padding: 10px;
text-align: center;
transition: box-shadow 0.3s;
}
.yoone-bundle-item-card:hover {
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.yoone-bundle-item-card .item-image img {
max-width: 100%;
height: auto;
border-radius: 4px;
}
.yoone-bundle-item-card .item-title {
font-size: 14px;
margin: 8px 0;
font-weight: bold;
}
.yoone-bundle-item-card .item-price {
font-size: 16px;
margin-bottom: 8px;
}
.yoone-bundle-item-card .item-quantity input {
width: 80px;
text-align: center;
}
/* 购物车:混装容器与子项目的分组样式 */
.woocommerce-cart .cart_item.yoone-bundle-container td {
border-top: 2px solid #ececec;
}
.woocommerce-cart .cart_item.yoone-bundle-child td {
padding-top: 6px;
padding-bottom: 6px;
}
.woocommerce-cart .cart_item.yoone-bundle-child .product-name {
position: relative;
padding-left: 18px;
font-size: 0.95em;
}
.woocommerce-cart .cart_item.yoone-bundle-child .product-name::before {
content: '↳';
position: absolute;
left: 0;
color: #9aa0a6;
}
.woocommerce-cart .cart_item.yoone-bundle-child .product-thumbnail img {
max-width: 32px;
height: auto;
opacity: 0.9;
}
.woocommerce-cart .cart_item.yoone-bundle-child {
color: #444;
}
.woocommerce-cart .cart_item.yoone-bundle-child .product-price,
.woocommerce-cart .cart_item.yoone-bundle-child .product-subtotal {
font-size: 0.93em;
}