/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Template: astra
Author: Brainstorm Force
Author URI: https://wpastra.com/
Description: This is a custom child theme for the Astra theme.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child
*/

/* 此文件仅用于主题声明，具体样式通过 functions.php 加载 */
/* 桌面端美化 */
@media (min-width: 769px) {
    body .top-filter-widget-area{          /* ← 用真实 class */
        background:#f7f9fc;
        border:1px solid #e3e8ee;
        border-radius:6px;
        padding:1rem 1.2rem;
        margin-bottom:2rem;
        box-shadow:0 2px 4px rgba(0,0,0,.04);
        font-size:.95rem;
        color:#333;
    }
    body .top-filter-widget-area .widget{
        background:#fff;
        border:1px solid #dfe4ea;
        border-radius:4px;
        padding:.6rem .8rem;
        min-width:160px;
    }
    body .top-filter-widget-area .widget-title{
        margin:0 0 .4rem 0;
        font-size:.9rem;
        font-weight:600;
        color:#0059c1;
        letter-spacing:.3px;
    }
    body .top-filter-widget-area select,
    body .top-filter-widget-area input[type=submit]{
        width:100%;
        padding:.45rem .6rem;
        border:1px solid #cbd5e1;
        border-radius:3px;
        background:#fff;
        font-size:.9rem;
    }
    body .top-filter-widget-area input[type=submit]{
        margin-top:.5rem;
        background:#0059c1;
        color:#fff;
        cursor:pointer;
        transition:background .2s;
    }
    body .top-filter-widget-area input[type=submit]:hover{
        background:#0042a3;
    }
}

/* 超高权重覆盖 Astra */
html body .top-filter-widget-area{
    background:#f7f9fc !important;
    border:1px solid #e3e8ee !important;
    border-radius:6px !important;
    padding:1rem 1.2rem !important;
    margin-bottom:2rem !important;
    box-shadow:0 2px 4px rgba(0,0,0,.04) !important;
}
html body .top-filter-widget-area .widget{
    background:#fff !important;
    border:1px solid #dfe4ea !important;
    border-radius:4px !important;
    padding:.6rem .8rem !important;
    min-width:160px !important;
}
html body .top-filter-widget-area .widget-title{
    margin:0 0 .4rem 0 !important;
    font-size:.9rem !important;
    font-weight:600 !important;
    color:#0059c1 !important;
    letter-spacing:.3px !important;
}
/* 如果还想调按钮，同理继续加 !important */

/* 地区抽屉：多列紧凑标签（权重拉高） */
html body .wc-block-product-filter-checkbox-list__items{
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 6px 10px !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
    padding: 8px !important;
    background: #fff !important;
    border: 1px solid #e6eaf0 !important;
    border-radius: 4px !important;
}
html body .wc-block-product-filter-checkbox-list__item{
    margin: 0 !important;
}
html body .wc-block-product-filter-checkbox-list__label{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    color: #495057 !important;
    background: #f7f9fc !important;
    border: 1px solid #dee6f0 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all .2s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
/* 已选 / 悬停高亮 */
html body .wc-block-product-filter-checkbox-list__item:has(.wc-block-product-filter-checkbox-list__input:checked) .wc-block-product-filter-checkbox-list__label,
html body .wc-block-product-filter-checkbox-list__label:hover{
    background: #0059c1 !important;
    color: #fff !important;
    border-color: #0059c1 !important;
}
/* 手机端 3 列 */
@media (max-width: 768px){
    html body .wc-block-product-filter-checkbox-list__items{
        grid-template-columns: repeat(3, 1fr) !important;
        font-size: 12px !important;
        gap: 5px 8px !important;
        max-height: 30vh !important;
    }
}

/* 地区抽屉：强制多列标签（权重 999） */
.wc-block-product-filter-checkbox-list.wc-block-product-filter-checkbox-list{
    display: block !important;          /* 拆掉 flex-column */
}
html body .wc-block-product-filter-checkbox-list__items{
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 6px 10px !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
    padding: 8px !important;
    background: #fff !important;
    border: 1px solid #e6eaf0 !important;
    border-radius: 4px !important;
}
html body .wc-block-product-filter-checkbox-list__item{
    margin: 0 !important;
}
html body .wc-block-product-filter-checkbox-list__label{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    color: #495057 !important;
    background: #f7f9fc !important;
    border: 1px solid #dee6f0 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all .2s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
/* 已选 / 悬停高亮 */
html body .wc-block-product-filter-checkbox-list__item:has(.wc-block-product-filter-checkbox-list__input:checked) .wc-block-product-filter-checkbox-list__label,
html body .wc-block-product-filter-checkbox-list__label:hover{
    background: #0059c1 !important;
    color: #fff !important;
    border-color: #0059c1 !important;
}
/* 手机端 3 列 */
@media (max-width: 768px){
    html body .wc-block-product-filter-checkbox-list__items{
        grid-template-columns: repeat(3, 1fr) !important;
        font-size: 12px !important;
        gap: 5px 8px !important;
        max-height: 30vh !important;
    }
}
/* ===== 地区抽屉：多列紧凑标签 ===== */
html body .wc-block-product-filter-checkbox-list__items{
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 6px 10px !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
    padding: 8px !important;
    background: #fff !important;
    border: 1px solid #e6eaf0 !important;
    border-radius: 4px !important;
}
html body .wc-block-product-filter-checkbox-list__item{
    margin: 0 !important;
}
html body .wc-block-product-filter-checkbox-list__label{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    color: #495057 !important;
    background: #f7f9fc !important;
    border: 1px solid #dee6f0 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all .2s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
html body .wc-block-product-filter-checkbox-list__item:has(.wc-block-product-filter-checkbox-list__input:checked) .wc-block-product-filter-checkbox-list__label,
html body .wc-block-product-filter-checkbox-list__label:hover{
    background: #0059c1 !important;
    color: #fff !important;
    border-color: #0059c1 !important;
}
@media (max-width: 768px){
    html body .wc-block-product-filter-checkbox-list__items{
        grid-template-columns: repeat(3, 1fr) !important;
        font-size: 12px !important;
        gap: 5px 8px !important;
        max-height: 30vh !important;
    }
}

/* 1. 让抽屉整体更宽 */
html body .wc-block-product-filters__overlay-dialog{
    max-width: 520px !important;   /* 默认 400px，加到 520 */
    width: 90vw !important;        /* 小屏也留边 */
}

/* 2. 地区网格自动填满 */
html body .wc-block-product-filter-checkbox-list__items{
    width: 100% !important;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
    gap: 6px 8px !important;
}

/* 3. 手机端再缩一点 */
@media (max-width: 600px){
    html body .wc-block-product-filters__overlay-dialog{
        max-width: 98vw !important;
    }
    html body .wc-block-product-filter-checkbox-list__items{
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        gap: 5px 6px !important;
    }
}

/* 加宽抽屉，让地区有空间排多列 */
html body .wc-block-product-filters__overlay-dialog{
    max-width: 560px !important;   /* 默认 400px，拉到 560 */
    width: 90vw !important;        /* 小屏也留边 */
}

html body .wc-block-product-filter-checkbox-list__items{
    width: 100% !important;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important; /* 80px 更紧凑 */
    gap: 6px 8px !important;
}

@media (max-width: 600px){
    html body .wc-block-product-filters__overlay-dialog{
        max-width: 98vw !important;
    }
    html body .wc-block-product-filter-checkbox-list__items{
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
        gap: 5px 6px !important;
    }
}
/* 让筛选框容器占满父级宽度 */
html body .ast-filter-wrap{
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* 抽屉再宽一点，防止又被内部限制 */
html body .wc-block-product-filters__overlay-dialog{
    max-width: 860px !important;   /* 可以再拉到 860-900 */
}