/**
 * Product Detail Page Styles
 * 产品详情页专用样式
 */

/* ========================================
   1. Product Header
   ======================================== */
.product-header {
    max-width: 800px;
    margin: 0 auto;
}

.product-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.product-price {
    font-size: 1.5rem;
    font-weight: var(--font-weight-regular);
    color: var(--color-primary);
    margin-top: var(--spacing-md);
}

/* ========================================
   2. Product Showcase
   ======================================== */
.product-showcase {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: var(--spacing-lg);
    padding-bottom: 0;
    margin-top: var(--spacing-md);
    min-height: 400px;
}

.product-showcase img {
    max-width: 100%;
    max-height: 450px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

/* ========================================
   3. Highlights Grid
   ======================================== */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    max-width: 1000px;
    margin: 0 auto;
}

.highlight-item {
    text-align: center;
    padding: var(--spacing-md);
}

.highlight-item h3 {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.highlight-item p {
    font-size: 1rem;
    color: var(--color-text);
}

/* ========================================
   4. Subsection Title
   ======================================== */
.subsection-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   5. Detail Sections
   ======================================== */
.detail-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.detail-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.detail-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.detail-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
}

/* ========================================
   6. Section Image Container
   ======================================== */
.section-image-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.section-image-container img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
}

/* ========================================
   7. Hotspot Anchor（热点锚点 - 负责定位）
   ======================================== */
.hotspot-anchor {
    position: absolute;
    z-index: 10;
    /* 使用 transform 使热点圆点中心对齐到坐标点 */
    transform: translate(-50%, -50%);
    /* 初始隐藏，scroll into view 时显示 */
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Scroll into view 时显示 */
.detail-section.in-view .hotspot-anchor {
    opacity: 1;
}

/* 动画延迟 */
.detail-section.in-view .hotspot-anchor:nth-child(2) { transition-delay: 0.3s; }
.detail-section.in-view .hotspot-anchor:nth-child(3) { transition-delay: 0.5s; }
.detail-section.in-view .hotspot-anchor:nth-child(4) { transition-delay: 0.7s; }
.detail-section.in-view .hotspot-anchor:nth-child(5) { transition-delay: 0.9s; }

/* ========================================
   8. Hotspot Dot（热点圆点）
   ======================================== */
.hotspot-dot {
    display: block;
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ========================================
   9. Hotspot Label（热点标签 - 负责展开方向）
   ======================================== */
.hotspot-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* 引导线 */
.hotspot-line {
    width: 40px;
    height: 2px;
    background: var(--color-primary);
    flex-shrink: 0;
}

/* 热点文字 */
.hotspot-text {
    background: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* ========================================
   10. Direction Support（8 个方向支持 - 拼音缩写）
   方向命名：z=左, y=右, s=上, x=下
   45度组合：zs/sz=左上, ys/sy=右上, zx/xz=左下, yx/xy=右下
   ======================================== */

/* 向右展开（默认）→ y=右 */
.hotspot-label,
.hotspot-label.y {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 4px;
    flex-direction: row;
}

/* 向左展开 ← z=左 */
.hotspot-label.z {
    right: 100%;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 4px;
    flex-direction: row-reverse;
}

/* 向下展开 ↓ x=下 */
.hotspot-label.x {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    flex-direction: column;
}
.hotspot-label.x .hotspot-line {
    width: 2px;
    height: 30px;
}

/* 向上展开 ↑ s=上 */
.hotspot-label.s {
    bottom: 100%;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    flex-direction: column-reverse;
}
.hotspot-label.s .hotspot-line {
    width: 2px;
    height: 30px;
}

/* 右上展开 ↗ ys/sy=右上 */
.hotspot-label.ys,
.hotspot-label.sy {
    left: 100%;
    bottom: 100%;
    top: auto;
    transform: none;
    margin-left: 4px;
    margin-bottom: -4px;
    flex-direction: row;
}
.hotspot-label.ys .hotspot-line,
.hotspot-label.sy .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(-30deg);
    transform-origin: left center;
}

/* 右下展开 ↘ yx/xy=右下 */
.hotspot-label.yx,
.hotspot-label.xy {
    left: 100%;
    top: 100%;
    transform: none;
    margin-left: 4px;
    margin-top: -4px;
    flex-direction: row;
}
.hotspot-label.yx .hotspot-line,
.hotspot-label.xy .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(30deg);
    transform-origin: left center;
}

/* 左上展开 ↖ zs/sz=左上 */
.hotspot-label.zs,
.hotspot-label.sz {
    right: 100%;
    left: auto;
    bottom: 100%;
    top: auto;
    transform: none;
    margin-right: 4px;
    margin-bottom: -4px;
    flex-direction: row-reverse;
}
.hotspot-label.zs .hotspot-line,
.hotspot-label.sz .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(30deg);
    transform-origin: right center;
}

/* 左下展开 ↙ zx/xz=左下 */
.hotspot-label.zx,
.hotspot-label.xz {
    right: 100%;
    left: auto;
    top: 100%;
    transform: none;
    margin-right: 4px;
    margin-top: -4px;
    flex-direction: row-reverse;
}
.hotspot-label.zx .hotspot-line,
.hotspot-label.xz .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(-30deg);
    transform-origin: right center;
}

/* ========================================
   11. Compatibility Cards
   ======================================== */
.compatibility-grid {
    margin-top: -50px;
}

.compatibility-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-base);
}

.compatibility-card:hover {
    transform: translateY(-4px);
}

.compatibility-card img {
    width: 100%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: bottom center;
    margin-bottom: var(--spacing-xs);
    border-radius: var(--radius-md);
    background: white;
}

.compatibility-card span {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
}

/* ========================================
   12. Responsive
   ======================================== */
@media (max-width: 768px) {
    .product-title {
        font-size: 1.75rem;
    }
    
    .product-showcase {
        padding: var(--spacing-sm);
    }
    
    .product-showcase img {
        max-height: 300px;
    }
    
    .detail-sections {
        gap: var(--spacing-lg);
    }
    
    .detail-section h2 {
        font-size: 1.25rem;
    }
    
    .highlights-grid {
        grid-template-columns: 1fr;
    }
    
    /* 热点缩小 */
    .hotspot-dot {
        width: 10px;
        height: 10px;
        border-width: 2px;
    }
    
    .hotspot-line {
        width: 15px;
    }
    
    .hotspot-text {
        padding: 4px 8px;
        font-size: 8.5px;
        /* 移除 max-width 限制，保持单行显示 */
        white-space: nowrap;
    }
    
    .hotspot-label {
        gap: 3px;
    }
    
    /* 斜向引导线缩短 */
    .hotspot-label.ys .hotspot-line,
    .hotspot-label.sy .hotspot-line,
    .hotspot-label.yx .hotspot-line,
    .hotspot-label.xy .hotspot-line,
    .hotspot-label.zs .hotspot-line,
    .hotspot-label.sz .hotspot-line,
    .hotspot-label.zx .hotspot-line,
    .hotspot-label.xz .hotspot-line {
        width: 12px;
    }
    
    /* 垂直方向引导线缩短 */
    .hotspot-label.s .hotspot-line,
    .hotspot-label.x .hotspot-line {
        height: 15px;
    }
}

/* 中等屏幕 */
@media (max-width: 1024px) and (min-width: 769px) {
    .hotspot-line {
        width: 25px;
    }
    
    .hotspot-text {
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .hotspot-dot {
        width: 12px;
        height: 12px;
    }
}

/* 带警告内容的 tagline */
.hotspot-text .warning {
    color: var(--color-warning);
    font-weight: var(--font-weight-semibold);
    font-size:0.9em;
}

/* ========================================
   13. Product Combo Showcase (产品组合展示)
   ======================================== */
.product-combo-showcase {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-md);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.combo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    max-width: 350px;
}

.combo-item-base {
    background: transparent;
}

.combo-item-base .combo-image {
    min-height: auto;
    padding: 0;
    margin-bottom: var(--spacing-md);
    background: transparent;
}

.combo-item-module {
    background: var(--color-bg-secondary);
    padding: var(--spacing-xl) var(--spacing-md);
    border-radius: var(--radius-lg);
}

.combo-item-module .combo-image {
    background: white;
    border-radius: 20px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    min-height: auto;
    margin-bottom: var(--spacing-sm);
}

.combo-image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combo-image img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
}

.combo-label {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    text-align: center;
}

.combo-plus {
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 var(--spacing-xs);
}

.combo-plus svg {
    width: 60px;
    height: 60px;
}

/* 响应式：中等屏幕 (平板) - 保持横向，但缩小尺寸 */
@media (max-width: 768px) {
    .product-combo-showcase {
        gap: var(--spacing-sm);
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .combo-item {
        max-width: 280px;
    }

    .combo-image {
        min-height: 200px;
        padding: var(--spacing-sm);
    }

    .combo-image img {
        max-height: 180px;
    }

    .combo-plus svg {
        width: 36px;
        height: 36px;
    }

    .combo-label {
        font-size: 0.875rem;
    }
}

/* 响应式：手机横屏 - 继续保持横向，进一步缩小 */
@media (max-width: 600px) {
    .product-combo-showcase {
        gap: var(--spacing-xs);
        padding: var(--spacing-md) var(--spacing-xs);
    }

    .combo-item {
        max-width: 160px;
        gap: var(--spacing-xs);
    }

    .combo-image {
        min-height: 140px;
        padding: var(--spacing-xs);
        border-radius: var(--radius-md);
    }

    .combo-image img {
        max-height: 120px;
    }

    .combo-plus {
        margin: 0;
    }

    .combo-plus svg {
        width: 28px;
        height: 28px;
    }

    .combo-label {
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

/* 响应式：极小屏幕 (< 400px) - 切换为纵向 */
@media (max-width: 400px) {
    .product-combo-showcase {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .combo-item {
        max-width: 100%;
        width: 100%;
    }

    .combo-image {
        min-height: 200px;
        padding: var(--spacing-md);
    }

    .combo-image img {
        max-height: 180px;
    }

    .combo-plus {
        transform: rotate(90deg);
        margin: var(--spacing-xs) 0;
    }

    .combo-plus svg {
        width: 40px;
        height: 40px;
    }

    .combo-label {
        font-size: 1rem;
    }
}

/* ========================================
   14. Featured Module Card（特展模块卡片）
   ======================================== */
.featured-module-row {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--spacing-md));
    margin-bottom: var(--spacing-lg);
}

.featured-module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    background: var(--color-bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    width: 280px;
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.featured-module-card:hover {
    transform: translateY(-4px);
}

.featured-module-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: var(--spacing-sm);
}

.featured-module-card span {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

@media (max-width: 900px) {
    .featured-module-card {
        width: 200px;
    }
    .featured-module-card img {
        max-height: 140px;
    }
}

@media (max-width: 600px) {
    .featured-module-row {
        flex-direction: column;
        align-items: center;
    }
    .featured-module-card {
        width: 90vw;
    }
}
