/*
Theme Name:   Astra Child
Theme URI:    https://wpastra.com/
Description:  Astra Child Theme
Author:       百家
Author URI:   https://example.com
Template:     astra
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
*/

/* =====================================================
   静态两级菜单小部件 - BJ Static Menu Widget
   ===================================================== */

.bj-static-menu-widget {
    font-family: inherit;
    background: transparent;
}

/* ── 标题：黑色粗体 + 金色下划线 ── */
.bj-menu-header {
    color: #222222;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    padding-bottom: 10px;
    margin-bottom: 0;
    border-bottom: 2px solid #af7900;
    background: transparent;
}

/* ── 一级列表 ── */
.bj-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
}

/* ── 一级 li：底部分隔线 ── */
.bj-menu-list > li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e8e8e8;
}

.bj-menu-list > li:last-child {
    border-bottom: none;
}

/* ── 一级行 ── */
.bj-item-wrap {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

/* ── 一级文字/链接 ── */
.bj-item-label {
    color: #333333;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.5;
    display: block;
    transition: color 0.2s ease;
}

a.bj-item-label:hover,
.bj-item-wrap:hover a.bj-item-label,
.bj-item-wrap:hover span.bj-item-label {
    color: #af7900;
}

.bj-menu-list > li.current-item > .bj-item-wrap .bj-item-label {
    color: #af7900;
}

/* ── 子菜单：始终展开 ── */
.bj-sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 6px 0;
}

/* ── 子菜单 li：缩进 + › 前缀，无分隔线 ── */
.bj-sub-menu > li {
    margin: 0;
    padding: 6px 0 6px 16px;
    border: none;
    position: relative;
    list-style: none;
}

.bj-sub-menu > li::before {
    content: '›';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #aaaaaa;
    font-size: 16px;
    line-height: 1;
}

.bj-sub-menu > li > a,
.bj-sub-menu > li > span.bj-sub-label {
    color: #666666;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    line-height: 1.5;
    display: block;
    transition: color 0.2s ease;
}

.bj-sub-menu > li > a:hover,
.bj-sub-menu > li:hover > a,
.bj-sub-menu > li:hover > span.bj-sub-label {
    color: #af7900;
}

.bj-sub-menu > li:hover::before {
    color: #af7900;
}

/* =====================================================
   分类产品列表小部件 - BJ Product List Widget
   ===================================================== */

.bj-product-list-widget {
    width: 100%;
}

/* ── 产品网格：默认4列 ── */
.bj-prod-grid {
    display: grid;
    grid-template-columns: repeat( 4, 1fr );
    gap: 24px;
}

/* ── 产品卡片 ── */
.bj-prod-card {
    background-color: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
}

.bj-prod-card:hover {
    box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.10 );
}

/* ── 产品图片：铺满容器 ── */
.bj-prod-img-wrap {
    display: block;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #f5f5f5;
    flex-shrink: 0;
    position: relative;
}

.bj-prod-img-wrap img,
.bj-product-list-widget .bj-prod-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
    max-width: none;
}

.bj-prod-card:hover .bj-prod-img-wrap img {
    transform: scale( 1.05 );
}

/* ── 产品信息区：标题顶部，价格底部 ── */
.bj-prod-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;           /* 撑满卡片剩余高度 */
    gap: 0;
}

/* ── 产品名称：固定2行，超出省略 ── */
.bj-prod-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    text-decoration: none;
    line-height: 1.5;
    /* 固定高度 = 行高 × 2行，标题始终占相同空间 */
    min-height: calc( 1.5em * 2 );
    transition: color 0.2s ease;
}

.bj-prod-card:hover .bj-prod-title {
    color: #af7900;
    text-decoration: none;
}

/* ── 价格：推到信息区底部 ── */
.bj-prod-price {
    margin-top: auto;   /* 自动填充空白，价格固定在底部 */
    padding-top: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #af7900;
    line-height: 1.3;
}

.bj-prod-price del {
    color: #aaaaaa;
    font-weight: 400;
    font-size: 13px;
    margin-right: 4px;
}

.bj-prod-price ins {
    text-decoration: none;
}

/* ── 无产品提示 ── */
.bj-prod-empty {
    color: #999999;
    text-align: center;
    padding: 48px 0;
    font-size: 15px;
}

/* ── 分页 ── */
.bj-prod-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 36px;
}

.bj-prod-pagination a,
.bj-prod-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.bj-prod-pagination a {
    color: #555555;
    background-color: #ffffff;
    cursor: pointer;
}

.bj-prod-pagination a:hover {
    background-color: #af7900;
    border-color: #af7900;
    color: #ffffff;
    text-decoration: none;
}

.bj-prod-pagination span.current {
    background-color: #af7900;
    border-color: #af7900;
    color: #ffffff;
    font-weight: 700;
    cursor: default;
}

.bj-prod-pagination span.dots {
    border-color: transparent;
    background: transparent;
    color: #aaaaaa;
    cursor: default;
    min-width: auto;
    padding: 0 6px;
}

.bj-prod-pagination span.disabled {
    color: #cccccc;
    border-color: #eeeeee;
    background: transparent;
    cursor: not-allowed;
}

/* ── 响应式 ── */
@media ( max-width: 1024px ) {
    .bj-prod-grid {
        grid-template-columns: repeat( 3, 1fr );
    }
}

@media ( max-width: 768px ) {
    .bj-prod-grid {
        grid-template-columns: repeat( 2, 1fr );
    }
}

@media ( max-width: 480px ) {
    .bj-prod-grid {
        grid-template-columns: repeat( 2, 1fr );
    }
}

/* =====================================================
   Product Gallery Slider Widget (bj_product_gallery)
   ===================================================== */

.bj-gallery-widget {
    width: 100%;
    box-sizing: border-box;
}

/* ── Main Swiper container ── */
.bj-gallery-main {
    position: relative;
    width: 100%;
}

/* 1:1 ratio wrapper for each main slide */
.bj-gallery-main-slide {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: block;
    position: relative;
    box-sizing: border-box;
}

.bj-gallery-main-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.bj-gallery-main .swiper-slide:hover .bj-gallery-main-slide img {
    transform: scale( 1.03 );
}

/* ── Navigation arrows ── */
.bj-gallery-prev,
.bj-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY( -50% );
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background-color: rgba( 0, 0, 0, 0.45 );
    transition: background-color 0.2s ease;
    padding: 0;
}

.bj-gallery-prev {
    left: 10px;
}

.bj-gallery-next {
    right: 10px;
}

.bj-gallery-prev:hover,
.bj-gallery-next:hover {
    background-color: rgba( 0, 0, 0, 0.75 );
}

.bj-gallery-prev svg,
.bj-gallery-next svg {
    width: 60%;
    height: 60%;
    display: block;
    fill: #ffffff;
    pointer-events: none;
}

/* ── Thumbnail Swiper ── */
.bj-gallery-thumbs {
    margin-top: 10px;
    width: 100%;
}

.bj-gallery-thumbs .swiper-slide {
    cursor: pointer;
}

/* 1:1 ratio wrapper for each thumbnail */
.bj-gallery-thumb-slide {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    display: block;
    box-sizing: border-box;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.bj-gallery-thumb-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Inactive thumbnail opacity */
.bj-gallery-thumbs .swiper-slide:not( .swiper-slide-thumb-active ) .bj-gallery-thumb-slide {
    opacity: 0.55;
}

/* Active thumbnail highlight */
.bj-gallery-thumbs .swiper-slide-thumb-active .bj-gallery-thumb-slide {
    opacity: 1;
    border-color: #af7900;
}

/* =====================================================
   Third-party plugin overrides
   ===================================================== */

/* Hide WooCommerce Wholesale minimum quantity notice */
.whols_minimum_quantity_notice {
    display: none !important;
}
