/* ============================================
   企业产品页面专属样式
   ============================================ */

:root {
    --primary-color: #6a79d9;
    --secondary-color: #6c757d;
    --bg-light: #f8f9fa;
    --text-dark: #333333;
    --text-muted: #666666;
    --nav-font: 'AlibabaPuHuiTi', sans-serif;
}

/* Hero Section */
.products-hero {
    position: relative;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
}

.products-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.products-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.products-hero-content {
    position: relative;
    z-index: 3;
}

.products-hero h1 {
    font-family: var(--nav-font);
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.products-hero-en {
    font-size: 1.8rem;
    font-weight: 300;
    opacity: 0.85;
    margin-top: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.products-hero p {
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-weight: 400;
    letter-spacing: 1px;
}

.products-hero-sub-en {
    font-size: 1.1rem;
    opacity: 0.75;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Sticky Navigation */
.products-nav-sticky {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1040; /* Just below main navbar */
    padding: 10px 0;
    position: sticky;
    top: 90px; /* Offset for main navbar */
    transition: all 0.3s ease;
}

.products-nav-sticky.scrolled {
    padding: 5px 0;
    top: 70px; /* Reduced offset when navbar shrinks */
}

.products-nav-sticky .nav-link {
    color: var(--text-dark);
    font-weight: 600;
    padding: 10px 15px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    font-size: 0.95rem;
}

.products-nav-sticky .nav-link span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: uppercase;
}

.products-nav-sticky .nav-link:hover,
.products-nav-sticky .nav-link.active {
    color: var(--primary-color);
}

.products-nav-sticky .nav-link:hover span {
    color: var(--primary-color);
}

/* Section Common */
.product-section {
    padding: 100px 0;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.section-header {
    margin-bottom: 70px;
    position: relative;
}

.section-header:after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 25px auto 0;
    border-radius: 2px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    font-family: var(--nav-font);
}

.section-subtitle-en {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Color Card Zoom Effect */
.color-card-item {
    background: #fff;
    border-radius: 12px;
    overflow: visible; /* Changed from hidden to show zoom result */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    padding: 20px;
    position: relative;
    z-index: 10;
}

.zoom-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden; /* Lens is restricted here */
    cursor: crosshair;
    background-color: #f5f5f5;
    border-radius: 8px;
    touch-action: none;
}

.zoom-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.zoom-lens {
    position: absolute;
    border: 1px solid #ddd;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.4);
    display: none;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.zoom-result {
    position: fixed; /* Fixed to body to avoid parent overflow:hidden */
    border: 1px solid #eee;
    width: 450px;
    height: 450px;
    background-repeat: no-repeat;
    display: none;
    z-index: 9999;
    background-color: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    pointer-events: none;
    border-radius: 4px;
}

/* Mobile Image Viewer */
.mobile-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 11000; /* Higher than floatbar and everything else */
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    touch-action: none; /* Prevent scrolling while viewing */
}

.mobile-viewer.active {
    display: flex;
    opacity: 1;
}

.mobile-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mobile-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.mobile-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    z-index: 10;
}

/* For larger screens, show the zoom */
@media (min-width: 992px) {
    .zoom-container:hover .zoom-lens {
        display: block;
    }
}

.color-card-info .zh {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-dark);
}

.color-card-info .en {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Diagram Grid */
.diagram-grid {
    margin-top: 40px;
}

.diagram-item {
    background: #fff;
    border-radius: 12px;
    overflow: visible; /* For zoom result */
    transition: all 0.3s ease;
    border: 1px solid #eee;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
}

.diagram-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 15;
}

.diagram-img-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    cursor: crosshair;
    position: relative;
}

.diagram-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.diagram-info {
    padding: 15px 5px 5px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.diagram-info .zh {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.diagram-info .en {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.2;
}

/* Category Items (Alternating Layout) */
.category-item {
    padding: 120px 0;
}

.category-slider {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    background: #000;
    height: 500px; /* Fixed height for all sliders on desktop */
}

@media (max-width: 991px) {
    .category-slider {
        height: 400px;
    }
}

@media (max-width: 767px) {
    .category-slider {
        height: 300px;
    }
}

.category-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    height: 100%;
}

.category-slider img, 
.category-slider video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Ensure full visibility and adapt to div */
    display: block;
}

.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.category-info {
    padding: 20px 0;
}

.category-info h3 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.category-info .en {
    font-size: 1.3rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
    font-weight: 300;
}

.category-info .divider {
    width: 80px;
    height: 5px;
    background: var(--primary-color);
    margin-bottom: 35px;
    border-radius: 2px;
}

.category-info .description {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #555;
    text-align: justify;
}

/* Responsive */
@media (max-width: 1199px) {
    .zoom-result {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 991px) {
    .products-hero h1 {
        font-size: 2.8rem;
    }
    
    .products-nav-sticky .nav-link {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .category-item {
        padding: 80px 0;
    }
    
    .category-info {
        margin-top: 50px;
        text-align: center;
    }
    
    .category-info .divider {
        margin: 0 auto 35px;
    }
    
    .category-slider img {
        height: 400px;
    }
    
    .zoom-result, .zoom-lens {
        display: none !important;
    }

    .diagram-grid .col-md-6 {
        margin-bottom: 20px;
    }
}

@media (max-width: 767px) {
    .products-nav-sticky {
        display: none;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .category-info h3 {
        font-size: 2.2rem;
    }

    .category-info .en {
        font-size: 1.1rem;
    }

    .category-slider img {
        height: 300px;
    }
    
    .products-hero h1 {
        font-size: 2.2rem;
    }
}
