/*
 Theme Name:   Astra Child
 Theme URI:    https://www.admiaopu.com
 Description:  安东苗圃产品详情页美化子主题
 Author:       元升证道
 Template:     astra
 Version:      2.0.0
 Text Domain:  astra-child
*/

/* ============================================
   安东苗圃 - 产品详情页美化样式
   仅作用于 WooCommerce 产品单页
   ============================================ */

/* === CSS 变量 === */
body.single-product {
    --anton-primary: #2d6a4f;
    --anton-primary-dark: #1b4332;
    --anton-primary-light: #52b788;
    --anton-red: #c1121f;
    --anton-bg: #fafaf9;
    --anton-card: #ffffff;
    --anton-text: #333333;
    --anton-text-light: #666666;
    --anton-border: #e8e4df;
}

body.single-product {
    background: var(--anton-bg);
}

/* === Hero Banner === */
.anton-hero-banner {
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    margin-top: -70px; /* 延伸到导航栏后方 */
    margin-bottom: 0;
}
.anton-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.5) 100%);
}
.anton-hero-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0 8% 50px;
    z-index: 2;
}
.anton-hero-badge {
    display: inline-block;
    background: var(--anton-primary);
    color: #fff;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
    font-weight: 500;
}
.anton-hero-content h1 {
    color: #fff;
    font-size: 48px;
    font-weight: 800;
    text-shadow: 2px 3px 10px rgba(0,0,0,0.4);
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.2;
}
.anton-hero-sub {
    color: rgba(255,255,255,0.9);
    font-size: 17px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
    margin: 0;
}

/* === 隐藏 WooCommerce 默认标题（已移到 Hero 中） === */
body.single-product .product .product_title,
body.single-product .product .woocommerce-product-rating {
    display: none !important;
}

/* === 产品主区域 - 双栏布局 === */
body.single-product .product div.product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 6%;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 50px;
    align-items: start;
}

/* 左侧：产品图片区 */
body.single-product .product div.product div.images {
    grid-column: 1;
    position: sticky;
    top: 90px;
}
body.single-product .product div.product div.images .woocommerce-main-image {
    border-radius: 12px;
    overflow: hidden;
    background: #f0ece6;
    margin-bottom: 12px;
}
body.single-product .product div.product div.images .woocommerce-product-gallery__wrapper {
    border-radius: 12px;
    overflow: hidden;
}
/* 产品图片 - 自然尺寸，不拉伸 */
body.single-product .product div.product div.images img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}
body.single-product .product div.product div.images .flex-control-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}
body.single-product .product div.product div.images .flex-control-thumbs li {
    margin: 0 !important;
    width: 100% !important;
}
body.single-product .product div.product div.images .flex-control-thumbs li img {
    border-radius: 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    aspect-ratio: 3/4;
    object-fit: cover;
}
body.single-product .product div.product div.images .flex-control-thumbs li img:hover,
body.single-product .product div.product div.images .flex-control-thumbs li img.flex-active {
    border-color: var(--anton-primary);
}

/* 右侧：产品信息区 */
body.single-product .product div.product div.summary {
    grid-column: 2;
    padding-top: 10px;
}

/* 标签 badges */
.anton-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.anton-badges .anton-badge {
    background: #e8f5e9;
    color: var(--anton-primary);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* 产品标题 */
body.single-product .product div.product div.summary .product_title {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    line-height: 1.3;
    margin-bottom: 6px;
}
.anton-subtitle {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

/* 价格区块 */
.anton-price-block {
    background: linear-gradient(135deg, #fff5f5, #fff);
    border: 1px solid #fde2e2;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.anton-price-block .anton-price-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
}
.anton-price-block .anton-price-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--anton-red);
    line-height: 1.2;
}
.anton-price-block .anton-price-value small {
    font-size: 16px;
    font-weight: 400;
    color: #999;
}
.anton-price-block .anton-price-note {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* 隐藏 WooCommerce 默认价格（已在自定义区块中显示） */
body.single-product .product div.product div.summary p.price,
body.single-product .product div.product div.summary span.price {
    display: none !important;
}

/* 规格信息 */
.anton-spec-table {
    margin-bottom: 24px;
}
.anton-spec-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--anton-border);
    font-size: 14px;
}
.anton-spec-label {
    color: #999;
    width: 80px;
    flex-shrink: 0;
}
.anton-spec-value {
    color: #333;
    font-weight: 500;
}

/* 数量选择器样式优化 */
body.single-product .product div.product div.summary .quantity {
    margin-bottom: 20px;
}
body.single-product .product div.product div.summary .quantity .qty {
    width: 80px;
    height: 40px;
    border: 1px solid var(--anton-border);
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
}

/* 加入购物车按钮 */
body.single-product .product div.product div.summary .single_add_to_cart_button {
    width: 100%;
    padding: 14px 32px;
    background: var(--anton-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 20px;
}
body.single-product .product div.product div.summary .single_add_to_cart_button:hover {
    background: var(--anton-primary-dark);
}

/* 服务保障 */
.anton-guarantee {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid var(--anton-border);
    margin-top: 20px;
}
.anton-guarantee-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
}
.anton-guarantee-item .icon {
    font-size: 18px;
}

/* === 详情标签页 === */
body.single-product .product div.product .woocommerce-tabs {
    grid-column: 1 / -1;
    max-width: 100%;
    margin: 40px 0;
    padding: 0;
}
body.single-product .woocommerce-tabs ul.tabs {
    display: flex;
    border-bottom: 2px solid var(--anton-border);
    padding: 0;
    margin: 0;
    list-style: none;
}
body.single-product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}
body.single-product .woocommerce-tabs ul.tabs li::before,
body.single-product .woocommerce-tabs ul.tabs li::after {
    display: none;
}
body.single-product .woocommerce-tabs ul.tabs li a {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #999;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: block;
    transition: all 0.2s;
}
body.single-product .woocommerce-tabs ul.tabs li.active a,
body.single-product .woocommerce-tabs ul.tabs li a:hover {
    color: var(--anton-primary);
    border-bottom-color: var(--anton-primary);
}
body.single-product .woocommerce-tabs .panel {
    background: var(--anton-card);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-top: 20px;
}
body.single-product .woocommerce-tabs .panel h2 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin: 32px 0 16px;
    padding-left: 14px;
    border-left: 4px solid var(--anton-primary);
}
body.single-product .woocommerce-tabs .panel h2:first-child {
    margin-top: 0;
}
body.single-product .woocommerce-tabs .panel p {
    font-size: 15px;
    color: var(--anton-text-light);
    line-height: 1.9;
    margin-bottom: 12px;
}
body.single-product .woocommerce-tabs .panel ul {
    margin: 12px 0 12px 24px;
}
body.single-product .woocommerce-tabs .panel ul li {
    font-size: 15px;
    color: var(--anton-text-light);
    line-height: 2;
}

/* 高亮信息框 */
.anton-highlight-box {
    background: #f0f7f4;
    border-left: 4px solid var(--anton-primary-light);
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}
.anton-highlight-box p {
    margin: 0;
    color: var(--anton-primary-dark);
    font-weight: 500;
}

/* === 隐藏不需要的默认元素 === */
body.single-product .product div.product div.summary .product_meta,
body.single-product .product div.product div.summary .woocommerce-product-details__short-description:empty {
    display: none;
}

/* === 页脚美化 === */
body.single-product footer.site-footer,
body.single-product .site-footer {
    background: #2d2d2d;
}

/* === 响应式 === */
@media (max-width: 900px) {
    .anton-hero-banner {
        height: 320px;
    }
    .anton-hero-content h1 {
        font-size: 32px;
    }
    .anton-hero-sub {
        font-size: 14px;
    }
    body.single-product .product div.product {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    body.single-product .product div.product div.images {
        grid-column: 1;
        position: static;
    }
    body.single-product .product div.product div.summary {
        grid-column: 1;
    }
    body.single-product .woocommerce-tabs ul.tabs {
        flex-wrap: wrap;
    }
    body.single-product .woocommerce-tabs .panel {
        padding: 24px 16px;
    }
}
