/*
 Theme Name: Astra Child
 Template: astra
*/

/* ==========================================================================
   Astra 彻底全宽：无视任何容器限制，强制全站全宽
   ========================================================================== */

/* 1. 彻底清除 Astra 的容器宽度和边距约束 */
body, 
body.ast-separate-container, 
body.ast-separate-container .site-main, 
body.ast-separate-container .ast-article-single, 
.ast-container, 
.site-content, 
.site-main, 
#primary, 
#content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* 2. 针对页面内容区域做最后的收尾处理 */
.entry-content,
.ast-entry-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. 彻底干掉页面标题（如果还需要的话） */
.page .entry-header {
    display: none !important;
}

/* 4. 处理可能存在的 WooCommerce 页面 */
.single-product .site-content,
.single-product #primary {
    max-width: 100% !important;
    padding: 0 !important;
}

/* ==========================================================================
   新增：非首页整体下移80px（不破坏透明头部）
   ========================================================================== */

/* 只给非首页的内容区加 margin-top，不动 body */
body:not(.home):not(.front-page) #primary {
    margin-top: 80px !important;
}

/* 如果 #primary 不够，给 .site-content 也加上 */
body:not(.home):not(.front-page) .site-content {
    margin-top: 80px !important;
}

/* ========================================================================
   WooCommerce 账户、购物车、结账：与礼道黑白极简视觉统一
   仅限三个功能页，不改变 WooCommerce 原生区块、表单和提交行为。
   ======================================================================== */
body.woocommerce-cart .site-content,
body.woocommerce-checkout .site-content,
body.woocommerce-account .site-content {
    background: #faf9f6;
}

body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body.woocommerce-account .site-main {
    padding: 54px 20px 80px !important;
}

body.woocommerce-cart .entry-content,
body.woocommerce-checkout .entry-content,
body.woocommerce-account .entry-content {
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

body.woocommerce-cart .entry-content::before,
body.woocommerce-checkout .entry-content::before,
body.woocommerce-account .entry-content::before {
    display: block;
    margin: 0 auto 34px;
    color: #1d1d1f;
    font-size: 30px;
    font-weight: 400;
    letter-spacing: 3px;
    line-height: 1.3;
    text-align: center;
}
body.woocommerce-cart .entry-content::before { content: '购物车'; }
body.woocommerce-checkout .entry-content::before { content: '结账'; }
body.woocommerce-account .entry-content::before { content: '我的账户'; }

/* 账户页 */
body.woocommerce-account .woocommerce {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 36px;
    padding: 32px;
    border: 1px solid #e7e3db;
    background: #fff;
}
body.woocommerce-account .woocommerce > h2 {
    grid-column: 1 / -1;
    margin: 0 0 8px;
    color: #1d1d1f;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 1px;
}
body.woocommerce-account .woocommerce > form.login,
body.woocommerce-account .woocommerce > form.register {
    grid-column: 1 / -1;
    max-width: 520px;
    margin: 0 auto;
    padding: 24px;
    border: 1px solid #e7e3db;
    background: #faf9f6;
}
body.woocommerce-account .woocommerce > form.login + h2,
body.woocommerce-account .woocommerce > form.register + h2 {
    margin-top: 26px;
}
body.woocommerce-account .woocommerce-MyAccount-navigation {
    width: auto;
    float: none;
}
body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li {
    border-bottom: 1px solid #eeeae3;
}
body.woocommerce-account .woocommerce-MyAccount-navigation a {
    display: block;
    padding: 13px 4px;
    color: #686868;
    font-size: 13px;
    text-decoration: none;
    transition: color .2s ease, padding-left .2s ease;
}
body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a,
body.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
    padding-left: 10px;
    color: #1d1d1f;
}
body.woocommerce-account .woocommerce-MyAccount-content {
    width: auto;
    float: none;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}
body.woocommerce-account .woocommerce-MyAccount-content a { color: #1d1d1f; }

/* 功能页表单 */
body.woocommerce-cart form,
body.woocommerce-checkout form,
body.woocommerce-account form {
    color: #555;
}
body.woocommerce-cart input,
body.woocommerce-cart select,
body.woocommerce-cart textarea,
body.woocommerce-checkout input,
body.woocommerce-checkout select,
body.woocommerce-checkout textarea,
body.woocommerce-account input,
body.woocommerce-account select,
body.woocommerce-account textarea {
    border: 1px solid #dedbd4 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #1d1d1f !important;
    box-shadow: none !important;
}
body.woocommerce-cart input:focus,
body.woocommerce-cart select:focus,
body.woocommerce-cart textarea:focus,
body.woocommerce-checkout input:focus,
body.woocommerce-checkout select:focus,
body.woocommerce-checkout textarea:focus,
body.woocommerce-account input:focus,
body.woocommerce-account select:focus,
body.woocommerce-account textarea:focus {
    border-color: #9a7b4f !important;
    outline: none;
}
body.woocommerce-cart button,
body.woocommerce-cart .button,
body.woocommerce-checkout button,
body.woocommerce-checkout .button,
body.woocommerce-account button,
body.woocommerce-account .button {
    border: 1px solid #1d1d1f !important;
    border-radius: 0 !important;
    background: #1d1d1f !important;
    color: #fff !important;
    font-size: 13px;
    letter-spacing: 1px;
    transition: background .25s ease, color .25s ease;
}
body.woocommerce-cart button:hover,
body.woocommerce-cart .button:hover,
body.woocommerce-checkout button:hover,
body.woocommerce-checkout .button:hover,
body.woocommerce-account button:hover,
body.woocommerce-account .button:hover {
    background: #9a7b4f !important;
    border-color: #9a7b4f !important;
}

/* 购物车 Blocks */
body.woocommerce-cart .wc-block-cart {
    padding: 30px;
    border: 1px solid #e7e3db;
    background: #fff;
}
body.woocommerce-cart .wc-block-cart-items,
body.woocommerce-cart .wc-block-cart__totals-title,
body.woocommerce-cart .wc-block-components-totals-wrapper {
    border-color: #e7e3db !important;
}
body.woocommerce-cart .wc-block-cart-item__image img { border-radius: 0; }
body.woocommerce-cart .wc-block-cart-item__product {
    color: #1d1d1f;
}
body.woocommerce-cart .wc-block-components-product-name {
    color: #1d1d1f;
    font-weight: 600;
}
body.woocommerce-cart .wc-block-cart__submit-container {
    background: transparent;
}
body.woocommerce-cart .wc-block-components-button {
    border-radius: 0 !important;
}
body.woocommerce-cart .wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-components-button.wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-components-button.wp-element-button {
    --wp--preset--color--vivid-cyan-blue: #1d1d1f !important;
    --wc-blue: #1d1d1f !important;
    width: 100% !important;
    border: 1px solid #1d1d1f !important;
    border-radius: 0 !important;
    background: #1d1d1f !important;
    color: #fff !important;
    box-shadow: none !important;
}
body.woocommerce-cart .wc-block-cart__submit-button:hover,
body.woocommerce-cart .wc-block-components-button.wc-block-cart__submit-button:hover {
    border-color: #9a7b4f !important;
    background: #9a7b4f !important;
    color: #fff !important;
}

/* 结账 Blocks */
body.woocommerce-checkout .wc-block-checkout {
    padding: 30px;
    border: 1px solid #e7e3db;
    background: #fff;
}
body.woocommerce-checkout .wc-block-components-checkout-step {
    border-color: #e7e3db;
}
body.woocommerce-checkout .wc-block-components-checkout-step__heading {
    color: #1d1d1f;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
}
body.woocommerce-checkout .wc-block-components-order-summary {
    border: 1px solid #e7e3db;
    background: #faf9f6;
}
body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
    min-height: 48px;
}

@media (max-width: 768px) {
    body.woocommerce-cart .site-main,
    body.woocommerce-checkout .site-main,
    body.woocommerce-account .site-main {
        padding: 38px 14px 54px !important;
    }
    body.woocommerce-cart .entry-content::before,
    body.woocommerce-checkout .entry-content::before,
    body.woocommerce-account .entry-content::before {
        margin-bottom: 24px;
        font-size: 25px;
    }
    body.woocommerce-account .woocommerce {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px;
    }
    body.woocommerce-account .woocommerce-MyAccount-navigation ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        column-gap: 18px;
    }
    body.woocommerce-cart .wc-block-cart,
    body.woocommerce-checkout .wc-block-checkout {
        padding: 18px;
    }
}
