/* Estilos para la tabla responsive de productos */
.product-table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}
.product-table td p {
    margin: 0;
    padding: 0;
}

/* Estilos para pantallas grandes */
@media (min-width: 992px) {
    .product-table {
        display: table;
    }
    
    .product-table thead {
        display: table-header-group;
    }
    
    .product-table tbody {
        display: table-row-group;
        background: #fff;
    }
    
    .product-table tr {
        display: table-row;
    }
    
    .product-table th,
    .product-table td {
        display: table-cell;
        padding: 0.75rem;
        vertical-align: middle;
        text-align: center;
        border-top: 1px solid #dee2e6;
    }
    
    .product-table thead th {
        vertical-align: bottom;
        border: 2px solid #FFFFFF;
        background-color: #23903f;
        color: #fff;
        font-weight: normal;
        text-align: center;
    }
    
    .product-table tbody + tbody {
        background: rgba(238, 238, 238, 0.4);
        border-top: 1px solid #393939;
        color: #393939;
    }

    .product-table tbody td.namepiece {
        background: #f8f9fa;
        text-align: left;
    }

    /* Ocultar etiquetas de datos en vista desktop */
    .product-table td::before {
        display: none;
    }

    .product-table .imgpieza {
        width: 100px;
    }

    .product-table .img_product {
        width: 10%;
        display: table-cell;
    }
}

/* Estilos para pantallas pequeñas */
@media (max-width: 991.98px) {
    .product-table,
    .product-table thead,
    .product-table tbody,
    .product-table tfoot,
    .product-table tr {
        display: block;
    }

    .product-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .product-table tr {
        border: 1px solid #dee2e6;
        margin-bottom: 0rem;
        background: #fff;
    }
    
    .product-table tr:nth-child(even) {
	    margin-bottom: 1rem;
	}

    .product-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        min-height: 50px;
    }

    .product-table td::before {
        content: attr(data-title);
        position: absolute;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
    }
    
    .product-table td.namepiece {
	    justify-content: center;
	    background-color: #23903f !important;
	    color: #fff;
    }

    /* Ajustes específicos para celdas con imágenes */
    .product-table th.imgpieza {
        margin: 1rem 0;
        justify-content: center;
        background-color: white;
        border: none;
        display: flex
    }

    .product-table td.imgpieza::before {
        display: none;
    }

    .product-table td.imgpieza img {
        max-width: 200px;
        height: auto;
    }
	
	product-table .img_product > div {
	    max-width: 100%;
	    display: grid;
	    grid-template-columns: repeat(4, 1fr);
	    gap: 0.3rem;
	}
/*
    .product-table td.img_product {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-table td.img_product::before {
        display: none;
    }
*/

    /* Estilos para el título del producto */
    .product-table td[colspan] {
        padding-left: 1rem;
        font-weight: bold;
        background-color: #f8f9fa;
    }

    .product-table td[colspan]::before {
        display: none;
    }
}

/* Estilos comunes */
.product-table img {
    max-width: 100%;
    height: auto;
}

.product-table .img_product > div {
    max-width: fit-content;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
}
.product-table .img_product .product-gallery .gallery-item {
    display: flex; /* Flexbox para cada celda */
    justify-content: center; /* Centra horizontalmente */
    align-items: center;   /* Centra verticalmente */
}
.product-table .img_product .product-gallery .gallery-item img {
    position: inherit;
    max-width: 50px;
    max-height: 50px;
}

.product-table .imgpieza img {
    width: auto;
    height: auto;
    max-width: 150px;
}

.product-table .img_product .gallery-item:nth-child(n+5) {
    display: none;
}

.product-table .img_product .gallery-item:nth-child(4) {
    position: relative;
}
.product-table .img_product .gallery-item:nth-child(4)::after {
    content: "+";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 128, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: normal;
}

.product-table .img_product .gallery-item:nth-child(4) img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}