/*
 Theme Name:   Astra Child - IceBag
 Theme URI:    https://icebagchina.com
 Description:  Astra Child Theme for IceBag China with custom product page template
 Author:       IceBag China
 Author URI:   https://icebagchina.com
 Template:     astra
 Version:      1.4.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  astra-child-icebag
*/

/* ============================================
   产品分类页 - 图片1:1比例
   ============================================ */
.archive .ast-article-post .post-thumb-img-content img,
.archive .ast-article-single .post-thumb-img-content img,
.tax-products_category .ast-article-post .post-thumb-img-content img,
.category .ast-article-post .post-thumb-img-content img,
.post-type-archive-products .ast-article-post .post-thumb-img-content img {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    width: 100% !important;
    height: auto !important;
}

.archive .post-thumb-img-content,
.tax-products_category .post-thumb-img-content,
.category .post-thumb-img-content,
.post-type-archive-products .post-thumb-img-content {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

/* ============================================
   重要：覆盖 Astra 主题默认布局（仅限产品详情页）
   使用更精确的选择器，避免影响其他页面
   ============================================ */

/* 产品详情页：Astra容器设置 */
.single-products #content.site-content > .ast-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
}

.single-products #content.site-content {
    padding-top: 0 !important;
}

/* ============================================
   产品详情页样式 - 参考 tempcontrolpack.com
   ============================================ */

/* 顶部 Header Banner - 全宽显示 */
.product-header-banner {
    display: block !important;
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    position: relative !important;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    background-image: url('https://dev.icebagchina.com/wp-content/uploads/factory.png');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    padding: 60px 0;
    box-sizing: border-box;
    float: none !important;
    clear: both !important;
}

.product-header-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.85) 0%, rgba(44, 82, 130, 0.85) 100%);
    z-index: 1;
}

.product-header-banner .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.product-header-banner h1 {
    color: #fff !important;
    font-size: 2rem;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.product-breadcrumb {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.product-breadcrumb a {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    transition: color 0.3s;
}

.product-breadcrumb a:hover {
    color: #fff !important;
    text-decoration: underline;
}

.product-breadcrumb span.separator {
    margin: 0 8px;
}

/* ============================================
   主内容区域 - 两栏布局（关键修复）
   ============================================ */
.product-page-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 50px;
    gap: 30px;
    align-items: flex-start;
    clear: both !important;
    box-sizing: border-box;
}

/* 左侧栏 - 固定宽度 */
.product-sidebar {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    position: sticky;
    top: 100px;
    box-sizing: border-box;
}

/* 主内容区 - 自适应宽度 */
.product-main-content {
    flex: 1 1 0% !important;
    min-width: 0;
    max-width: calc(100% - 310px);
    box-sizing: border-box;
}

/* ============================================
   侧边栏组件样式
   ============================================ */
.sidebar-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sidebar-widget h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e3a5f;
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3182ce;
}

/* 产品分类导航 */
.category-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-nav li {
    margin-bottom: 0;
}

.category-nav a {
    display: block;
    padding: 8px 10px;
    color: #4a5568;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.category-nav li:last-child a {
    border-bottom: none;
}

.category-nav a:hover,
.category-nav a.active {
    background: #ebf8ff;
    color: #3182ce;
}

/* 热门产品 */
.popular-product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.popular-product-item:last-child {
    border-bottom: none;
}

.popular-product-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.popular-product-item a {
    color: #4a5568;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.2s;
}

.popular-product-item a:hover {
    color: #3182ce;
}

/* 产品标签云 */
.product-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-tags-cloud a {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f4f8;
    color: #4a5568;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
}

.product-tags-cloud a:hover {
    background: #3182ce;
    color: #fff;
}

/* ============================================
   产品顶部区域：图片 + 信息（左右布局）
   ============================================ */
.product-top-section {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 30px;
    margin-bottom: 30px;
    align-items: flex-start;
}

/* 产品图片画廊 - 左侧 45% */
.product-gallery {
    flex: 0 0 45% !important;
    width: 45% !important;
    max-width: 45% !important;
}

.product-gallery-main {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f8f9fa;
}

.product-gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

.product-gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product-gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.product-gallery-thumb.active,
.product-gallery-thumb:hover {
    border-color: #3182ce;
}

.product-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 产品信息 - 右侧 55% */
.product-info {
    flex: 0 0 55% !important;
    width: 55% !important;
    max-width: 55% !important;
}

.product-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

/* 产品简介 */
.product-summary {
    margin-bottom: 20px;
}

.product-summary-label {
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 8px;
    font-size: 14px;
}

.product-summary-text {
    color: #4a5568;
    line-height: 1.7;
    font-size: 14px;
}

/* 产品规格列表 */
.product-specs-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.product-specs-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #4a5568;
}

.product-specs-list li:last-child {
    border-bottom: none;
}

.product-specs-list .spec-name {
    font-weight: 600;
    color: #1e3a5f;
    margin-right: 8px;
}

/* 按钮区域 */
.product-actions {
    margin-bottom: 20px;
}

.btn-inquiry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-inquiry:hover {
    background: linear-gradient(135deg, #2c5282 0%, #1e3a5f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
}

.btn-inquiry svg {
    width: 18px;
    height: 18px;
}

/* 社交分享 */
.product-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.product-share span {
    color: #718096;
    font-size: 13px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s;
}

.share-btn svg {
    width: 16px;
    height: 16px;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn.linkedin svg {
    fill: #fff;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.facebook svg {
    fill: #fff;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ============================================
   产品详情内容区
   ============================================ */
.product-details-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

/* Tab 导航 */
.product-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
}

.product-tab {
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -1px;
}

.product-tab:hover {
    color: #3182ce;
}

.product-tab.active {
    color: #3182ce;
    border-bottom-color: #3182ce;
    background: #fff;
}

/* Tab 内容 */
.product-tab-content {
    display: block;
    padding: 25px;
}

.product-tab-content.active {
    display: block;
}

/* 详情区块 */
.detail-section {
    margin-bottom: 30px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3a5f;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3182ce;
}

.detail-section-content {
    color: #4a5568;
    line-height: 1.8;
    font-size: 14px;
}

.detail-section-content p {
    margin-bottom: 15px;
}

.detail-section-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

/* 视频容器 */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 旧内容兼容 */
.legacy-content-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.legacy-content {
    color: #4a5568;
    line-height: 1.8;
}

.legacy-content img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   上下产品导航
   ============================================ */
.product-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
    background: #f8f9fa;
}

.product-nav-item {
    flex: 0 0 48%;
}

.product-nav-item.prev {
    text-align: left;
}

.product-nav-item.next {
    text-align: right;
}

.product-nav-item a {
    text-decoration: none;
    display: block;
}

.product-nav-label {
    font-size: 12px;
    color: #718096;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
    transition: color 0.2s;
}

.product-nav-item a:hover .product-nav-title {
    color: #3182ce;
}

/* ============================================
   图片灯箱
   ============================================ */
.image-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.image-lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 992px) {
    .product-page-wrapper {
        flex-direction: column !important;
    }
    
    .product-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        position: relative;
        top: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .product-sidebar .sidebar-widget {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 200px;
        margin-bottom: 0;
    }
    
    .product-main-content {
        width: 100%;
        max-width: 100%;
    }
    
    .product-top-section {
        flex-direction: column !important;
    }
    
    .product-gallery,
    .product-info {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .product-header-banner {
        padding: 40px 0;
    }
    
    .product-header-banner h1 {
        font-size: 1.5rem;
    }
    
    .product-sidebar .sidebar-widget {
        flex: 1 1 100%;
    }
    
    .product-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .product-nav-item {
        flex: 0 0 100%;
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    .product-page-wrapper {
        padding: 20px 15px 30px;
    }
    
    .product-tabs {
        flex-wrap: wrap;
    }
    
    .product-tab {
        flex: 1 1 50%;
        text-align: center;
        padding: 12px 15px;
    }
}

/* ========================================
   Category Dropdown Styles
   添加到 style.css 文件中
   ======================================== */

/* 分类导航容器 */
.category-nav ul.category-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 一级分类项 */
.category-nav ul.category-list > li {
    margin-bottom: 0 !important;
    border-bottom: 1px solid #e2e8f0;
}

.category-nav ul.category-list > li:last-child {
    border-bottom: none;
}

/* 分类项容器 */
.category-nav .category-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 0 !important;
}

/* 分类链接 */
.category-nav .category-item a {
    color: #2d3748 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
    flex: 1 !important;
}

.category-nav .category-item a:hover {
    color: #c53030 !important;
}

/* 当前激活的分类 */
.category-nav li.active > .category-item a {
    color: #c53030 !important;
    font-weight: 600 !important;
}

/* 展开/收起图标 */
.category-nav .toggle-icon {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 24px !important;
    height: 24px !important;
    background-color: #edf2f7 !important;
    border-radius: 4px !important;
    color: #4a5568 !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    user-select: none !important;
}

.category-nav .toggle-icon:hover {
    background-color: #c53030 !important;
    color: #fff !important;
}

/* 展开状态的图标 */
.category-nav li.expanded > .category-item .toggle-icon {
    background-color: #c53030 !important;
    color: #fff !important;
}

/* 二级分类列表 */
.category-nav ul.sub-categories {
    list-style: none !important;
    padding: 0 0 10px 20px !important;
    margin: 0 !important;
    background-color: #f7fafc !important;
    border-left: 2px solid #e2e8f0 !important;
}

/* 二级分类项 */
.category-nav ul.sub-categories li {
    margin: 0 !important;
    padding: 8px 0 !important;
    border-bottom: 1px dashed #e2e8f0 !important;
}

.category-nav ul.sub-categories li:last-child {
    border-bottom: none !important;
}

/* 二级分类链接 */
.category-nav ul.sub-categories li a {
    color: #4a5568 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    transition: color 0.2s ease !important;
    display: block !important;
    padding-left: 10px !important;
}

.category-nav ul.sub-categories li a:hover {
    color: #c53030 !important;
}

/* 当前激活的二级分类 */
.category-nav ul.sub-categories li.active a {
    color: #c53030 !important;
    font-weight: 600 !important;
}

/* 二级分类前的小圆点 */
.category-nav ul.sub-categories li a::before {
    content: "•" !important;
    margin-right: 8px !important;
    color: #a0aec0 !important;
}

.category-nav ul.sub-categories li.active a::before {
    color: #c53030 !important;
}
/* ============================================
   Tab内容区域样式修复
   ============================================ */
.tab-pane {
    display: none !important;
}

.tab-pane.active {
    display: block !important;
}
