/* Product Specifications Tab Styles */
.product-specifications {
    margin: 20px 0;
    overflow-x: auto; /* Cho phép scroll ngang nếu cần */
    max-width: 100%;
    overflow-y: visible; /* Đảm bảo không cắt theo chiều dọc */
}

.specifications-content {
    line-height: 1.6;
    color: #333;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible; /* Đảm bảo không cắt theo chiều dọc */
}

.specifications-content h1,
.specifications-content h2,
.specifications-content h3,
.specifications-content h4,
.specifications-content h5,
.specifications-content h6 {
    margin: 20px 0 10px 0;
    color: #2c3e50;
    font-weight: 600;
}

.specifications-content h1 { font-size: 24px; }
.specifications-content h2 { font-size: 22px; }
.specifications-content h3 { font-size: 20px; }
.specifications-content h4 { font-size: 18px; }
.specifications-content h5 { font-size: 16px; }
.specifications-content h6 { font-size: 14px; }

/* Bảng thông số */
.specifications-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    overflow: visible; /* Thay đổi từ hidden sang visible */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: table;
    table-layout: fixed; /* Cố định layout để tránh tràn */
}

.specifications-content table thead th {
    background: #f8f9fa; /* Xám nhạt thay vì xanh đậm */
    color: #2c3e50; /* Chữ đen thay vì trắng */
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
    font-size: 15px;
    border-bottom: 2px solid #e1e5e9;
}

.specifications-content table tbody tr {
    border-bottom: 1px solid #e1e5e9;
    transition: background 0.2s ease;
}

.specifications-content table tbody tr:last-child {
    border-bottom: none;
}

.specifications-content table tbody tr:hover {
    background: #f8f9fa;
}

.specifications-content table tbody td {
    padding: 12px 16px;
    vertical-align: top;
    word-wrap: break-word; /* Tự động xuống dòng khi text dài */
    overflow-wrap: break-word;
    white-space: normal; /* Đảm bảo text có thể xuống dòng */
    height: auto; /* Chiều cao tự động theo nội dung */
    min-height: auto; /* Không giới hạn chiều cao tối thiểu */
}

.specifications-content table tbody td:first-child {
    background: #f8f9fa; /* Xám nhạt cho tiêu đề */
    font-weight: 600;
    color: #2c3e50;
    width: 30%;
    min-width: 150px;
    border-right: 1px solid #e1e5e9;
}

.specifications-content table tbody td:last-child {
    color: #555;
    width: 70%;
}

.specifications-content table th,
.specifications-content table td {
    font-size: 14px;
    line-height: 1.6;
    height: auto; /* Chiều cao tự động theo nội dung */
    min-height: auto; /* Không giới hạn chiều cao tối thiểu */
}

/* Strong text trong bảng */
.specifications-content table strong {
    color: #007bff;
    font-weight: 600;
}

/* Danh sách */
.specifications-content ul,
.specifications-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.specifications-content li {
    margin: 8px 0;
    line-height: 1.5;
}

/* Đoạn văn */
.specifications-content p {
    margin: 15px 0;
    line-height: 1.6;
}

/* In đậm và nghiêng */
.specifications-content strong,
.specifications-content b {
    font-weight: 600;
    color: #2c3e50;
}

.specifications-content em,
.specifications-content i {
    font-style: italic;
    color: #666;
}

/* Ghi chú */
.specifications-note {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

.specifications-note p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Shortcode version */
.product-specifications-shortcode {
    margin: 20px 0;
}

.specifications-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* WooCommerce Tabs */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    margin: 0 0 1em 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid #e1e5e9;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
    display: inline-block;
    margin: 0;
    position: relative;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li:hover a {
    color: #007bff;
    border-bottom-color: #007bff;
}

.woocommerce div.product .woocommerce-tabs .panel {
    margin: 20px 0 0 0;
    padding: 0;
    overflow: visible; /* Đảm bảo panel không cắt nội dung */
    min-height: auto; /* Chiều cao tự động theo nội dung */
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .specifications-content h1 { font-size: 20px; }
    .specifications-content h2 { font-size: 18px; }
    .specifications-content h3 { font-size: 16px; }
    
    /* Chuyển bảng sang dạng card trên tablet/mobile */
    .specifications-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    
    .specifications-content table thead {
        display: none; /* Ẩn header trên mobile */
    }
    
    .specifications-content table tbody {
        display: block;
    }
    
    .specifications-content table tbody tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 15px;
        border: 1px solid #e1e5e9;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
    }
    
    .specifications-content table tbody tr:last-child {
        margin-bottom: 0;
    }
    
    .specifications-content table tbody td {
        display: block;
        width: 100% !important;
        padding: 12px 16px;
        border: none !important;
    }
    
    .specifications-content table tbody td:first-child {
        background: #f8f9fa; /* Xám nhạt thay vì xanh đậm */
        color: #2c3e50; /* Chữ đen thay vì trắng */
        font-weight: 600;
        font-size: 14px;
        padding: 10px 16px;
        min-width: 100%;
        border-right: none !important;
    }
    
    .specifications-content table tbody td:last-child {
        background: #fff;
        color: #555;
        font-size: 14px;
        padding: 12px 16px;
        width: 100%;
        line-height: 1.6;
    }
    
    .specifications-content table tbody tr:hover {
        background: #fff;
    }
    
    .specifications-content table tbody tr:hover td:first-child {
        background: #e9ecef; /* Xám đậm hơn khi hover */
    }
}

@media (max-width: 480px) {
    .woocommerce div.product .woocommerce-tabs ul.tabs {
        display: flex;
        flex-wrap: wrap;
        border-bottom: 1px solid #e1e5e9;
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs li {
        flex: 1;
        min-width: 0;
    }
    
    .woocommerce div.product .woocommerce-tabs ul.tabs li a {
        padding: 10px 8px;
        font-size: 13px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .specifications-content table tbody td:first-child {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .specifications-content table tbody td:last-child {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .specifications-content table tbody tr {
        margin-bottom: 12px;
    }
    
    .specifications-note {
        padding: 12px;
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .specifications-content {
        color: #e1e5e9;
    }
    
    .specifications-content h1,
    .specifications-content h2,
    .specifications-content h3,
    .specifications-content h4,
    .specifications-content h5,
    .specifications-content h6 {
        color: #f8f9fa;
    }
    
    .specifications-content table {
        background: #2c3e50;
        color: #e1e5e9;
    }
    
    .specifications-content table th {
        background: #34495e;
        color: #f8f9fa;
    }
    
    .specifications-content table td {
        color: #bdc3c7;
    }
    
    .specifications-content table tr:hover {
        background: #34495e;
    }
    
    .specifications-note {
        background: #34495e;
        border-left-color: #3498db;
    }
    
    .specifications-note p {
        color: #bdc3c7;
    }
}

