/*
Theme Name: ZBLLED Clean
Theme URI: https://zblled.com
Description: Clean theme for ZBLLED
Author: ZBLLED
Version: 1.0
*/

/* 强制修复产品网格 - 防止被挤下 */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
}
.woocommerce ul.products li.product {
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    clear: none !important;
}
/* 确保第4个不被挤 */
.woocommerce ul.products li.product:nth-child(4n+1) {
    clear: left;
}
@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


.hero .btn, .btn-blue {
    background-color: #007cba !important;
    color: #fff !important;
}
.hero .btn:hover, .btn-blue:hover {
    background-color: #005a8c !important;
}


/* 强制产品网格每行4列，解决最后一排被挤问题 */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
}
.woocommerce ul.products li.product {
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    list-style: none !important;
}
/* 确保父容器没有额外边距 */
.products-section .container,
.woocommerce .products {
    overflow: visible !important;
}
/* 手机端改为2列 */
@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
/* Shop Now 蓝底按钮 */
.hero .btn,
.btn-blue {
    background-color: #007cba !important;
    color: #fff !important;
    border: none !important;
}
.hero .btn:hover,
.btn-blue:hover {
    background-color: #005a8c !important;
}
/* ========== 强制产品网格每行4列，永不换行 ========== */
.woocommerce ul.products,
ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.woocommerce ul.products li.product,
ul.products li.product {
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    clear: none !important;
    float: none !important;
    box-sizing: border-box !important;
}
/* 所有卡片内部强制盒模型 */
.product, .product * {
    box-sizing: border-box !important;
}
/* 父容器宽度限制，防止溢出 */
.products-section .container,
.woocommerce .products {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow-x: hidden !important;
}
/* 手机端改为2列 */
@media (max-width: 768px) {
    .woocommerce ul.products,
    ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
/* 最简单可靠的网格：自动适配，永不换行错位 */
.woocommerce ul.products {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
    padding: 0;
}
.woocommerce ul.products li.product {
    flex: 1 1 calc(25% - 20px);  /* 每行4个，减掉间隙 */
    margin: 0;
    min-width: 180px;
    list-style: none;
}
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        flex: 1 1 calc(50% - 20px); /* 手机每行2个 */
    }
}
