/**
 * WooCommerce 商品选项卡组件样式
 */

/* CSS变量定义 */
:root {
    --aee-product-size: 285px;
    --aee-grid-gap: 20px;
    --aee-primary-color: #d4af37;
    --aee-text-white: #ffffff;
    --aee-text-white-60: rgba(255, 255, 255, 0.6);
    --aee-text-white-10: rgba(255, 255, 255, 0.1);
    --aee-text-white-05: rgba(255, 255, 255, 0.05);
    --aee-shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --aee-grid-gap: 30px;
    --aee-content-bg: rgba(0, 0, 0, 0.6);
    --aee-default-image: url('../images/placeholder-bg.svg');
}

.aee-product-tabs-widget {
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
}

/* 标题样式已移除 */

/* 选项卡导航样式 - 按照Figma设计稿 */
.aee-product-tabs-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 60px;
    padding-bottom: 20px;
}

.aee-product-tabs-nav .tab-item {
    border: none;
    background: none !important;
    padding: 0;
    margin: 0 40px 0 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--aee-text-white);
    cursor: pointer;
    position: relative;
}

.aee-product-tabs-nav .tab-item:last-of-type {
    margin-right: 0;
}

.aee-product-tabs-nav .tab-item:hover,
.aee-product-tabs-nav .tab-item:focus,
.aee-product-tabs-nav .tab-item:active,
.aee-product-tabs-nav .tab-item:visited {
    color: var(--aee-primary-color);
    background: none !important;
    outline: none;
}

.aee-product-tabs-nav .tab-item.active {
    color: #d4af37;
    background: none !important;
}

.aee-product-tabs-nav .tab-item.active::after {
    content: ' ';
    position: absolute;
    bottom: -21px;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 1px;
    background-color: var(--aee-primary-color);
}

/* 更多按钮样式 - 合并重复定义 */
.aee-more-button-wrapper {
    margin-left: auto;
}

.aee-more-button,
.aee-product-tabs__more-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 400;
    color: var(--aee-text-white-60);
    text-decoration: none;
    padding: 0;
    border-radius: 0;
    border: none;
    cursor: pointer;
}

.aee-product-tabs__more-button {
    position: absolute;
    top: 50%;
    right: 0;
}

.aee-more-button:hover,
.aee-product-tabs__more-button:hover {
    color: var(--aee-primary-color);
    text-decoration: none;
}

.aee-more-button svg,
.aee-product-tabs__more-button svg {
    width: 12px;
    height: 16px;
    fill: currentColor;
}

/* 选项卡内容样式 */
.aee-product-tabs-content {
    position: relative;
}

.aee-product-tabs-content .tab-content {
    display: none;
}

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

/* 产品网格样式 - 按照Figma设计稿 */
.aee-product-tabs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(var(--aee-product-size), 100%), 1fr));
    grid-template-rows: repeat(2, var(--aee-product-size));
    gap: var(--aee-grid-gap);
    max-width: 100%;
    overflow: hidden;
}

/* 大屏幕固定4列布局 */
@media (min-width: 1200px) {
    .aee-product-tabs-grid {
        grid-template-columns: repeat(4, var(--aee-product-size));
        justify-content: center;
    }
}

/* 产品项样式 - 按照Figma设计稿 */
.aee-product-item {
    border-radius: 0;
    overflow: hidden;
    border: none;
    width: 100%;
    max-width: var(--aee-product-size);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
}

/* 产品图片样式 - 按照Figma设计稿 */
.aee-product-item .product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0;
}

.aee-product-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.aee-product-item .product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

/* 产品内容样式 - 按照Figma设计稿 */
.aee-product-item .product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* 产品标题样式 - 按照Figma设计稿 */
.aee-product-item .product-title {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--aee-text-white);
    margin: 0;
    text-align: center;
    width: 100%;
    max-width: 265px;
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aee-product-item .product-title a {
    color: inherit;
    text-decoration: none;
}

.aee-product-item .product-title a:hover {
    color: var(--aee-text-white);
    /* 保持颜色不变 */
}

/* 产品价格样式 - 按照Figma设计稿 */
.aee-product-item .product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    width: 100%;
}

.aee-product-item .product-price .current-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--aee-text-white);
    line-height: 1.2;
}

.aee-product-item .product-price .original-price {
    font-size: 16px;
    font-weight: 400;
    color: var(--aee-text-white-60);
    text-decoration: line-through;
    line-height: 1.2;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .aee-product-tabs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .aee-product-tabs-nav .tab-item {
        font-size: 16px;
        margin-right: 32px;
        background: none;
    }
}

@media (max-width: 768px) {
    .aee-product-tabs-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto; /* 移除固定行高 */
        gap: 12px;
    }
    
    /* 调整移动端产品项高度 */
    .aee-product-item {
        aspect-ratio: auto; /* 移除1:1比例限制 */
        height: auto; /* 自适应高度 */
    }
    
    /* 调整移动端产品图片高度 */
    .aee-product-item .product-image {
        aspect-ratio: 16/9; /* 设置16:9的宽高比 */
        height: auto;
    }

    .aee-product-tabs-nav {
        flex-wrap: nowrap;
        gap: 16px;
        margin-bottom: 12px;
        padding-bottom: 12px;
        overflow-x: scroll;
    }

    .aee-product-tabs-nav .tab-item {
        font-size: 14px;
        margin-right: 0 !important;
        background: none;
        flex-shrink: 0;
    }

    .aee-product-tabs-nav .tab-item.active::after {
        bottom: -10px;
    }

    .aee-more-button-wrapper {
        margin-left: 0;
        width: auto;
        margin-top: 0;
        flex-shrink: 0;
    }

    .aee-product-item .product-content {
        padding: 12px;
    }

    .aee-product-item .product-title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .aee-product-item .product-price .current-price {
        font-size: 14px;
    }

    .aee-product-item .product-price .original-price {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .aee-product-tabs-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 调整小屏幕产品项高度 */
    .aee-product-item .product-image {
        aspect-ratio: 4/3; /* 设置4:3的宽高比，更适合小屏幕 */
    }
    
    /* 调整内容区域间距，使整体更紧凑 */
    .aee-product-item .product-content {
        padding: 10px 8px;
        gap: 6px;
    }

    .aee-product-tabs-nav .tab-item {
        font-size: 13px;
        background: none;
    }
}

.aee-editor-mode .aee-product-item .product-image img {
    opacity: 0.8;
}

/* 无产品状态 */
.aee-product-tabs-grid:empty::after {
    content: '暂无产品';
    display: block;
    text-align: center;
    color: var(--aee-text-white-60);
    font-size: 16px;
    padding: 40px 20px;
    grid-column: 1 / -1;
}