#popup_canva.container_canva {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    max-width: 1600px;
    width: 90%;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 99999;
}

#popup_canva .header {
    background-color: #f8f9fa;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    border-radius: 5px;
    margin-bottom: 5px;
    position: relative;
}

#popup_canva .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: transparent;
    color: #000000;
    border: none;
    border-color: transparent;
    cursor: pointer;
    font-size: 15px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
}

#popup_canva .close-btn:hover {
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
}

/* Bảng và cấu trúc các hàng/cột */
#popup_canva .table-responsive {
    overflow: hidden;
    /* max-height: 450px; */
    flex: 1;
    /* margin-bottom: 20px; */
}

#popup_canva table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#popup_canva thead {
    background-color: #f2f2f2;
}

#popup_canva th,
#popup_canva td {
    padding: 10px;
    text-align: center;
    /* Căn giữa theo chiều ngang */
    vertical-align: middle;
    /* Căn giữa theo chiều dọc */
    border-bottom: 1px solid #ddd;
}

/* Định nghĩa chiều rộng cột */
#popup_canva th:nth-child(1),
#popup_canva td:nth-child(1) {
    /* Image column */
    min-width: unset;
    max-width: unset;
    text-align: center;
    /* padding: 8px; */
    width: 7%;
    max-width: 80px;
    text-align: center;
}

#popup_canva .product-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

#popup_canva td {
    height: 60px;
    vertical-align: middle;
}

#popup_canva th:nth-child(2),
#popup_canva td:nth-child(2) {
    /* Product Name column */
    width: 15%;
}

#popup_canva th:nth-child(3),
#popup_canva td:nth-child(3) {
    /* Brand column */
    width: 10%;
}

#popup_canva th:nth-child(4),
#popup_canva td:nth-child(4) {
    /* Size column */
    width: 10%;
}

#popup_canva th:nth-child(5),
#popup_canva td:nth-child(5) {
    /* Prices column */
    width: 10%;
}

#popup_canva th:nth-child(6),
#popup_canva td:nth-child(6) {
    /* Material column */
    width: 10%;
}

#popup_canva th:nth-child(7),
#popup_canva td:nth-child(7) {
    /* Color column */
    width: 20%;
}

#popup_canva th:nth-child(8),
#popup_canva td:nth-child(8) {
    /* Description column */
    width: 15%;
}

#popup_canva .name-column {
    text-align: left;
    font-weight: 500;
    font-size: 16px;
    word-break: break-word;
}

#popup_canva .brand-column,
#popup_canva .material-column,
#popup_canva .description-column,
#popup_canva .size-column,
#popup_canva .price-column,
#popup_canva .colors-column {
    text-align: center;
    vertical-align: middle;
    font-size: 15px;
    word-break: break-word;
}

#popup_canva .colors-column {
    max-width: 120px;
    overflow-x: auto;
    white-space: normal;
    word-break: break-word;
    padding: 0;
}

#popup_canva .colors-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 0;
}

#popup_canva .item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

#popup_canva .item-info img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#popup_canva .item-info div p {
    font-size: 12px;
    color: #555;
    margin-top: 5px;
}

/* Door Style/Color color samples */
#popup_canva .color-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
}

#popup_canva .color-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

#popup_canva .color-samples .color {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background-size: 100%;
}

#popup_canva .color-samples .color:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#popup_canva .color-samples .color.active {
    border: 3px solid #1976d2;
    box-shadow: 0 0 10px rgba(25, 118, 210, 0.5);
    transform: scale(1.05);
}

#popup_canva .color-samples .color.active::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #1976d2;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

#popup_canva .product-name {
    max-width: 300px;
    word-wrap: break-word;
    margin-bottom: 10px;
}

/* Button hiển thị thêm */
#popup_canva .show-more-btn {
    background-color: #d4b87c;
    color: white;
    border: none;
    padding: 7px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-right: 8px;
    display: inline-block;
}

#popup_canva .show-more-btn:last-child {
    margin-right: 0;
}

#popup_canva .show-more-btn:hover {
    opacity: 0.9;
}

/* Container cho 2 nút */
#popup_canva .button-container {
    text-align: center;
    margin-top: 10px;
}

/* Highlight selected item */
#popup_canva tr.popup-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#popup_canva tr.popup-item:hover {
    background-color: #f5f5f5;
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#popup_canva tr.popup-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #1976d2;
}

#popup_canva tr.popup-item.selected:hover {
    background-color: #bbdefb;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

#popup_canva tr.popup-item.active {
    background-color: #e3f2fd;
    border-left: 4px solid #1976d2;
}

#popup_canva tr.popup-item.active:hover {
    background-color: #bbdefb;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

#popup_canva tr.popup-item:hover .item-info {
    transform: scale(1.02);
}

#popup_canva tr.popup-item:hover .item-info img {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

#popup_canva .product-title h6 {
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
}

#popup_canva tr.popup-item:hover .product-title h6 {
    color: #1976d2;
}

#popup_canva .description-column .description-content {
    max-width: 1600px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5em;
    max-height: calc(1.5em * 3);
}

/* Tooltip content */
#popup_canva .tooltip-wrapper {
    position: relative;
}

#popup_canva .description-column .custom-tooltip {
    position: absolute;
    bottom: 120%;
    /* Đẩy lên phía trên */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: normal;
    max-width: 300px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
}

#popup_canva .description-column .custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

/* Show tooltip when hover td */
#popup_canva .tooltip-wrapper:hover .custom-tooltip {
    opacity: 1;
    pointer-events: auto;
}


#popup_canva .color-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 70px;
}

#popup_canva .color-name {
    font-size: 12px;
    color: #555;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

.table-responsive {
    position: relative;
}

.table-responsive table {
    width: 100%;
}

.table-responsive thead tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}


.table-responsive tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* Scrollbar styling */
.table-responsive tbody::-webkit-scrollbar {
    width: 8px;
}

.table-responsive tbody::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-responsive tbody::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive tbody::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.table-sticky-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    /* border-bottom: 2px solid #ddd; */
}

.table-responsive tbody {
    display: block;
    max-height: 75vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#popup_canva .popup-footer-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 0 10px;
}

#popup_canva .confirm-selection-btn {
    padding: 10px 20px;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#popup_canva .confirm-selection-btn:hover {
    background-color: #1565c0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1199px) {
    #popup_canva .header {
        margin-bottom: 0;
    }

    #popup_canva.container_canva {
        width: 100%;
        padding: 0 0 10px 0;
    }

    #popup_canva.container_canva tbody .product-title h6 {
        font-size: 12px;
        margin-top: 5px;
    }

    #popup_canva th:nth-child(1),
    #popup_canva td:nth-child(1) {
        /* Image column */
        width: 14%;
    }

    #popup_canva .product-image {
        width: 60px;
        height: 60px;
        border-radius: 4px;
        display: block;
        margin: 0 auto;
    }

    #popup_canva .color-samples .color {
        width: 30px;
        height: 30px;
    }

    #popup_canva .color-samples .color.active::after {
        width: 15px;
        height: 15px;
    }

    #popup_canva th:nth-child(2),
    #popup_canva td:nth-child(2) {
        font-size: 12px;
    }

    #popup_canva .color-name {
        font-size: 10px;
    }
}