/*
 Theme Name:   Autodetail Child
 Theme URI:    https://reactheme.com/products/wordpress/autodetail
 Description:  Autodetail Child
 Author:       ReacThemes
 Author URI:   http://reactheme.com
 Template:     autodetail
 Version:      1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
 */

/* 购物车样式现在通过functions.php动态加载 */
/* 这样可以确保页面48和2489都使用统一的样式 */

/* 修复post=14013 Elementor两列布局下的宽度限制问题 */
.postid-14013 .woocommerce,
.postid-14013 .elementor-widget-woocommerce-cart .woocommerce,
.postid-14013 .wp-block-woocommerce-cart {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
}

/* 确保WooCommerce Cart内部元素也能充分利用空间 */
.postid-14013 .wc-block-cart,
.postid-14013 .wc-block-cart__container {
    max-width: none !important;
    width: 100% !important;
}

/* 直接修复post=14013页面的两列布局 - 简单有效的方案 */
body.postid-14013 .elementor-widget-woocommerce-cart .woocommerce {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 2rem !important;
}

/* 购物车表格占65%宽度 */
body.postid-14013 .woocommerce-cart-form {
    flex: 1 1 65% !important;
    min-width: 0 !important;
}

/* 购物车小计和积分面板占35%宽度 */
body.postid-14013 .cart-collaterals {
    flex: 1 1 35% !important;
    min-width: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

/* Blocks 布局：在 post=14013 强制两列（与经典布局保持一致的 65% / 35%） */
body.postid-14013 .wc-block-cart {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 2rem !important;
}
body.postid-14013 .wc-block-cart__main {
    flex: 1 1 65% !important;
    min-width: 0 !important;
}
body.postid-14013 .wc-block-cart__sidebar {
    flex: 1 1 35% !important;
    min-width: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

/* 移除所有myCred组件的固定宽度和order限制 */
body.postid-14013 .mycred-gateway,
body.postid-14013 .mycred-woo-plus-discount,
body.postid-14013 .mycred-coupon,
body.postid-14013 #mycred-partial-payment-woo,
body.postid-14013 .mycred-blocks-panel,
body.postid-14013 .ad-points-panel,
body.postid-14013 .points-panel-white {
    width: 100% !important;
    max-width: none !important;
    min-width: auto !important;
    flex: none !important;
    order: unset !important;
    margin-bottom: 1rem !important;
}

/* 确保购物车小计正常显示 */
body.postid-14013 .cart_totals {
    width: 100% !important;
    margin-bottom: 1rem !important;
}

/* 响应式处理 */
@media (max-width: 768px) {
    body.postid-14013 .elementor-widget-woocommerce-cart .woocommerce {
        flex-direction: column !important;
    }
    
    body.postid-14013 .woocommerce-cart-form,
    body.postid-14013 .cart-collaterals {
        flex: 1 1 100% !important;
    }

    /* Blocks 布局在小屏下堆叠为一列 */
    body.postid-14013 .wc-block-cart {
        flex-direction: column !important;
    }
    body.postid-14013 .wc-block-cart__main,
    body.postid-14013 .wc-block-cart__sidebar {
        flex: 1 1 100% !important;
        min-width: auto !important;
    }
}

/* 确保Elementor容器不限制宽度 */
body.postid-14013 .elementor-widget-woocommerce-cart {
    width: 100% !important;
    max-width: none !important;
}