/*
Theme Name: Astra Child - 产品页面
Description: 只修改产品详情页面的子主题
Template: astra
Version: 1.0.0
*/

/* 导入父主题样式 */
@import url("../astra/style.css");

/* ========== 只在产品页面生效的样式 ========== */

/* 只在产品页面隐藏默认布局 */
.single-product .woocommerce div.product div.images,
.single-product .woocommerce div.product div.summary {
    display: none !important;
}

/* 自定义产品页面容器 */
.custom-single-product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.custom-product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.custom-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* 左侧图片区域 */
.custom-gallery-section {
    padding: 30px;
    background: #fff;
    position: relative;
}

.custom-main-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #eee;
    cursor: zoom-in;
}

.custom-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.custom-main-img:hover img {
    transform: scale(1.02);
}

.custom-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.custom-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-thumb.active {
    border-color: #0073aa;
}

.custom-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-sale-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #e74c3c;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

/* 右侧信息区域 */
.custom-info-section {
    padding: 40px;
    background: white;
}

.custom-product-name {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}

.custom-product-price {
    margin-bottom: 25px;
}

.custom-product-price .price {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    color: #e74c3c !important;
}

.custom-product-price .price del {
    font-size: 1.4rem !important;
    color: #999 !important;
    margin-right: 10px;
}

.custom-short-desc {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.custom-features {
    margin-bottom: 25px;
}

.custom-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: #333;
}

.custom-features li::before {
    content: "✓";
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1rem;
}

/* 购买区域 */
.custom-buy-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.custom-buy-section .cart {
    margin: 0 !important;
}

.custom-buy-section .single_add_to_cart_button {
    background: #0073aa !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 15px 25px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
    width: 100% !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.custom-buy-section .single_add_to_cart_button:hover {
    background: #005177 !important;
    transform: translateY(-1px);
}

.custom-buy-section .quantity {
    margin-bottom: 10px !important;
}

.custom-buy-section .quantity .qty {
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    padding: 8px !important;
    width: 70px !important;
    text-align: center !important;
}

/* 保障信息 */
.custom-guarantees {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.custom-guarantee {
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}

.custom-guarantee-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* 详情标签区域 */
.custom-tabs-area {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.08);
    overflow: hidden;
}

.custom-tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.custom-tab-btn {
    flex: 1;
    padding: 18px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.custom-tab-btn.active {
    color: #0073aa;
    background: white;
    border-bottom-color: #0073aa;
}

.custom-tab-panel {
    padding: 30px;
    display: none;
    line-height: 1.6;
}

.custom-tab-panel.active {
    display: block;
}

.custom-tab-panel h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 规格表格 */
.custom-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.custom-spec-table th,
.custom-spec-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.custom-spec-table th {
    background: #f8f9fa;
    font-weight: 600;
    width: 30%;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .custom-product-layout {
        grid-template-columns: 1fr;
    }
    
    .custom-gallery-section,
    .custom-info-section {
        padding: 20px;
    }
    
    .custom-product-name {
        font-size: 1.4rem;
    }
    
    .custom-product-price .price {
        font-size: 1.8rem !important;
    }
    
    .custom-tab-nav {
        flex-wrap: wrap;
    }
    
    .custom-tab-btn {
        min-width: 50%;
        padding: 15px 10px;
        font-size: 0.9rem;
    }
}