/*
Theme Name: 百花山畔
Theme URI: https://www.100hua.cn
Author: 梁家庄村股份经济合作社
Author URI: https://www.100hua.cn
Description: 专为百花山畔共享庭院经济设计的WordPress主题，支持二十四节气风格、WooCommerce、三方分账
Version: 2.1.0
License: GPL v2 or later
Text Domain: baihua
*/

/* ===== 商标品牌样式 ===== */
/* 移动端适配 */
@media (max-width: 480px) {
    .site-title img {
        height: 24px !important;
    }
    .site-title span {
        font-size: 0.95rem !important;
    }
}
/* ---- 头部 ---- */
.brand-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-wrapper .custom-logo {
    max-height: 50px;
    width: auto;
    height: auto;
    display: block;
}

.brand-logo-wrapper .brand-logo-img {
    max-height: 50px;
    width: auto;
    height: auto;
    display: block;
}

.brand-text-group {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2e7d32;
    letter-spacing: 1px;
}

.brand-sub {
    font-size: 0.6rem;
    font-weight: 400;
    color: #8D6E63;
    letter-spacing: 1.5px;
}

/* ---- 底部 ---- */
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 0 6px;
}

.footer-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand-logo .custom-logo {
    max-height: 36px;
    width: auto;
    height: auto;
    filter: brightness(0) invert(1); /* 白色Logo适配深色底部 */
}

.footer-brand-logo .footer-logo-img {
    max-height: 36px;
    width: auto;
    height: auto;
    filter: brightness(0) invert(1);
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.footer-brand-text .brand-name {
    font-size: 1rem;
    font-weight: 600;
    color: #f5f5f7;
    letter-spacing: 1px;
}

.footer-brand-text .brand-sub {
    font-size: 0.55rem;
    font-weight: 300;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1.5px;
}

.footer-brand-trademark {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}

/* ---- 响应式适配 ---- */
@media (max-width: 768px) {
    .brand-logo-wrapper .custom-logo,
    .brand-logo-wrapper .brand-logo-img {
        max-height: 40px;
    }
    .brand-name {
        font-size: 1rem;
    }
    .brand-sub {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }
    .footer-brand-logo .custom-logo,
    .footer-brand-logo .footer-logo-img {
        max-height: 30px;
    }
}

@media (max-width: 480px) {
    .brand-logo-wrapper {
        gap: 8px;
    }
    .brand-logo-wrapper .custom-logo,
    .brand-logo-wrapper .brand-logo-img {
        max-height: 32px;
    }
    .brand-name {
        font-size: 0.85rem;
    }
    .brand-sub {
        font-size: 0.45rem;
        letter-spacing: 0.5px;
    }
}

/* ===== 首页板块标题 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.section-header-left {
    flex: 1;
}

.section-header-left .section-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.section-header-left h2 {
    font-size: 1.6rem;
    margin: 0;
    color: #2e7d32;
}

.section-header-left .section-desc {
    color: #888;
    font-size: 0.9rem;
    margin: 2px 0 0;
}

.view-all {
    display: inline-block;
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
    white-space: nowrap;
}

.view-all:hover {
    border-bottom-color: #2e7d32;
}

/* ===== 最新动态（混合类型） ===== */
.latest-dynamic-section {
    padding: 20px 0 10px;
}

.latest-dynamic-section .section-badge {
    background: #e3f2fd;
    color: #1565c0;
}

/* ===== 图片占位统一样式（覆盖 main.css） ===== */
.news-image {
    position: relative;
    overflow: hidden;
    background: #f5f2ed;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-image .placeholder-img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0ebe3;
    color: #8b7a6b;
    font-size: 3rem;
    box-sizing: border-box;
}

.news-image .placeholder-img .placeholder-text {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 6px;
    max-width: 80%;
    text-align: center;
}

/* 认养卡片专用背景色 */
.adoption-card .news-image .placeholder-img {
    background: #f5e6da;
}

/* 动态卡片（稍矮） */
.dynamic-card .news-image {
    height: 180px;
}
.dynamic-card .news-image .placeholder-img {
    min-height: 180px;
}

/* ===== 节气徽章 - 移动端适配 ===== */
@media (max-width: 480px) {
    .solar-term-badge {
        display: none !important;
    }
}

/* ===== 响应式（首页板块 & 占位） ===== */
@media (max-width: 768px) {
    .section-header-left h2 {
        font-size: 1.4rem;
    }
    .news-image .placeholder-img {
        min-height: 140px;
        font-size: 2.4rem;
    }
    .dynamic-card .news-image .placeholder-img {
        min-height: 140px;
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .section-header-left h2 {
        font-size: 1.2rem;
    }
    .view-all {
        font-size: 0.8rem;
    }
    .news-image .placeholder-img {
        min-height: 120px;
        font-size: 2rem;
    }
    .dynamic-card .news-image .placeholder-img {
        min-height: 120px;
    }
}
/* ===== 京东风格 · WooCommerce 样式优化 ===== */

/* ---- 商品详情页 ---- */

/* 价格区 */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: #bf6f4a;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
    background: none;
    font-weight: 700;
    color: #bf6f4a;
    text-decoration: none;
}

.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    color: #aaa;
    font-size: 1rem;
    font-weight: 400;
    margin-left: 10px;
    opacity: 0.7;
}

/* 加入购物车按钮 */
.woocommerce div.product form.cart .button {
    background: #bf6f4a;
    color: #fff;
    padding: 14px 48px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    transition: background 0.2s;
}

.woocommerce div.product form.cart .button:hover {
    background: #a85a3a;
}

/* 数量输入框 */
.woocommerce div.product form.cart .quantity .qty {
    padding: 10px 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 68px;
    text-align: center;
}

/* SKU 元信息 */
.woocommerce div.product .product_meta {
    font-size: 0.85rem;
    color: #888;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.woocommerce div.product .product_meta span {
    display: inline-block;
    margin-right: 16px;
}

/* ---- 商品列表页 ---- */

/* 商品卡片按钮（已在模板中内联样式，此处分隔清晰） */
.product-card-jd .button {
    font-size: 0.8rem !important;
    padding: 6px 0 !important;
    border-radius: 30px !important;
    transition: background 0.2s !important;
}

/* ---- 购物车页面 ---- */

/* 购物车表格优化 */
.woocommerce-cart-form .shop_table {
    border-collapse: collapse;
    width: 100%;
}

.woocommerce-cart-form .shop_table td,
.woocommerce-cart-form .shop_table th {
    padding: 12px 8px;
    vertical-align: middle;
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 商品详情页：左右变为上下 */
    .product-detail-wrapper > div[style*="display:flex"] {
        flex-direction: column !important;
    }
    .product-detail-wrapper > div[style*="display:flex"] > div {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }
    /* 价格字号缩小 */
    .woocommerce div.product p.price,
    .woocommerce div.product span.price {
        font-size: 1.4rem;
    }
    /* 购物车表格：滚动 */
    .cart-wrapper .woocommerce-cart-form {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .woocommerce div.product form.cart .button {
        padding: 12px 30px;
        font-size: 0.9rem;
        width: 100%;
    }
    .woocommerce div.product form.cart .quantity {
        display: block;
        margin-bottom: 12px;
    }
    .woocommerce div.product form.cart .quantity .qty {
        width: 100%;
    }
    /* 列表页：2列 */
    .container > div[style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    /* 购物车 */
    .cart-wrapper {
        padding: 12px !important;
    }
    .woocommerce-cart-form .shop_table td,
    .woocommerce-cart-form .shop_table th {
        padding: 8px 4px !important;
        font-size: 0.8rem !important;
    }
    .woocommerce-cart-form .shop_table .product-thumbnail img {
        max-width: 40px !important;
    }
}
/* ===== 产品图片区域 · 修复版 ===== */

/* 1. 主图容器：撑满左侧 */
.woocommerce-product-gallery {
    width: 100% !important;
    float: none !important;
}

/* 2. 主图本身：填满容器 */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:first-child {
    width: 100% !important;
    display: block !important;
}

.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:first-child img {
    width: 100% !important;
    height: auto !important;
    max-height: 500px;
    object-fit: contain;
}

/* 3. 缩略图：每行5个，更大更紧凑 */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
    display: inline-block !important;
    width: 18% !important;
    margin: 0 1% 8px 1% !important;
    float: left !important;
}

.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    cursor: pointer;
}

.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img:hover {
    border-color: #2e7d32;
}

/* 4. 促销标签位置 */
.onsale {
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    font-size: 0.85rem !important;
    padding: 4px 16px !important;
    border-radius: 20px !important;
    background: #bf6f4a !important;
    color: #fff !important;
    z-index: 10 !important;
}

/* 5. 清浮动 */
.woocommerce-product-gallery__wrapper::after {
    content: '';
    display: table;
    clear: both;
}

/* 6. 移动端适配 */
@media (max-width: 768px) {
    .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:first-child img {
        max-height: 320px;
    }
    .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
        width: 23% !important;
        margin: 0 1% 6px 1% !important;
    }
}

@media (max-width: 480px) {
    .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:first-child img {
        max-height: 240px;
    }
    .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
        width: 31% !important;
        margin: 0 1% 4px 1% !important;
    }
}
