﻿/* 塑膠材料表格樣式 - 整合粘性標題功能 */

/* 容器樣式 */
.container {
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* 粘性容器 */
.sticky-wrapper {
    position: relative;
}


/* 響應式設計 */
@media (max-width: 1200px) {
    .container {
        padding: 30px 15px;
    }

    .productTB th,
    .productTB td {
        padding: 10px 6px;
    }

    .w3ls_head {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px 10px;
    }

    .sticky-wrapper {
        padding-top: 60px;
    }

    .w3ls_head {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .productTB {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        overflow-y: scroll;
    }

        .productTB .tr-sticky {
            top: 0;
        }

        .productTB th,
        .productTB td {
            padding: 8px 4px;
            min-width: 80px;
        }

            .productTB td:first-child {
                min-width: 100px;
                position: sticky;
                left: 0;
                z-index: 1;
                background: #f8f9fa !important;
                border-right: 2px solid #e67e22;
            }

        .productTB tr:nth-child(even) td:first-child {
            background: #ecf0f1 !important;
        }

        .productTB tr:hover td:first-child {
            background: #d5e8f5 !important;
        }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 5px;
    }

    .sticky-wrapper {
        padding-top: 50px;
    }

    .w3ls_head {
        font-size: 1.3rem;
        text-align: center;
    }

    .productTB th,
    .productTB td {
        padding: 6px 3px;
        min-width: 70px;
    }

        .productTB td:first-child {
            min-width: 80px;
            padding-left: 8px;
        }
}

/* 如果有固定導航列，調整粘性位置 */
@media (min-width: 769px) {
    .productTB .tr-sticky {
        top: 70px; /* 調整為導航列高度 */
    }
}

/* 打印樣式 */
@media print {
    .container {
        background: white;
        padding: 20px;
    }

    .productTB {
        box-shadow: none;
        border: 2px solid #2A2E33;
    }

        .productTB tr:hover {
            background-color: transparent;
            transform: none;
            box-shadow: none;
        }

        .productTB th a {
            color: white !important;
            text-decoration: none;
        }
}

/* 滾動條樣式 */
.productTB::-webkit-scrollbar {
    height: 8px;
}

.productTB::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.productTB::-webkit-scrollbar-thumb {
    background: #e67e22;
    border-radius: 4px;
}

    .productTB::-webkit-scrollbar-thumb:hover {
        background: #d35400;
    }

/* 加載動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.productTB {
    animation: fadeIn 0.6s ease-out;
}

    /* 特殊數值高亮 */
    .productTB td:not(:first-child):not(:empty) {
        position: relative;
    }

        .productTB td:not(:first-child):not(:empty):hover::after {
            content: attr(title);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: #2A2E33;
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            white-space: nowrap;
            z-index: 1000;
            margin-bottom: 5px;
        }
