.product-sheet {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    width:60%;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.product-sheet form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width:100%;
}

h1 {
    text-align:center;
    margin:0;
    margin-bottom: 20px;
    padding: 0;
}

.container-image-description {
    display: flex;
    flex-direction: row;
    width:100%;
    justify-content: center;
    align-items: center;
}

.product-images {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40%;
}

.product-description {
    display: flex;
    flex-direction: column;
    width: 60%;
    padding: 0px 20px;
}

.product-description p {
    width:100%;
  
    text-align: justify;
    hyphens: auto; 
    word-break: break-word;
    overflow-wrap: break-word;
}

#whatsappBtn {
    display: flex;      
    background-color: #d6d6d6;
    color: rgb(35, 35, 35);
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    font-family: Arial, sans-serif;
    align-items: center;  
    padding: 5px 10px;         
    gap: 4px;                  
    transition: background-color 0.3s ease;
    white-space: nowrap;  
    align-self: flex-start;
}

#whatsappBtn:hover {
    background-color: #1ebe57;
}

#whatsappBtn img {
    width: 30px;      /* più piccolo */
    height: auto;
}

.product-images img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border: 1px solid rgba(128, 128, 128, 0.244);
}

.image-viewer {
    display: flex;
    flex-direction: column;
    position: relative;
    justify-content: center;
    align-items: center;
    padding:40px;
    padding-top: 0px;
    padding-bottom: 0px;
    width: 100%;
    height: 250px;
}

.image-viewer .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 18px;
    z-index: 2;
}

.image-viewer .arrow.left {
    left: 10px;
}

.image-viewer .arrow.right {
    right: 10px;
}

.edit-image {
    display:flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.product-edit-images {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40%;
    margin-left: 15px;
}

.img-edit {
    max-width: 20%;
    max-height: 20%;
    display: block;
}

.image-upload {
    margin-bottom: 20px;
    margin-left: 40px;

}

.product-table {
    margin-top: 20px;
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(128, 128, 128, 0.493);
}

.product-table thead {
    border-bottom: 1px solid grey;
}

.product-table th, .product-table td {
    text-align: left;
    padding: 10px;
}

.product-table tbody tr:nth-child(odd) {
    background-color: #00720931;
}

.product-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

/* Stile per l'overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.overlay img {
    max-width: 90%;
    max-height: 80%;
}
.overlay .close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: white;
    cursor: pointer;
}
.overlay .arrow {
    position: absolute;
    top: 50%;
    font-size: 40px;
    color: white;
    background-color: rgba(0, 0, 0, 0.267);
    padding: 10px;
    cursor: pointer;
    transform: translateY(-50%);
}
.overlay .arrow.left {
    left: 30px;
}
.overlay .arrow.right {
    right: 30px;
}

/* edit mode */
.editable-textarea, .editable-input {
    width: 100%;
    display: flex;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.editable-textarea {
   min-height: 120px;
}

.edit-codice {
    display:flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}


.save-button, .delete-button {
    padding: 5px 10px;
    cursor: pointer;
    color: white;
    border: none;
    border-radius: 3px;
    flex: 1; 
    text-align: center;
    font-size:14px;
}

.save-button {
    background-color: #4CAF50;
    margin: 10px 5px;
}

.delete-button {
    background-color: #f44336;
}

@media (max-width: 768px) {

    .product-sheet {
        width:90%;
        padding: 15px;
        margin: 10px auto;
    }

    .container-image-description {
        flex-direction: column;
        align-items: center;
        gap:10px;
    }

    .container-image-description p {
        width: 100%;
        margin: 20px auto;
        text-align: center;
    }

    .product-description {
        width:100%;
    }

    .product-images {
        width: 80%;
        margin: 0 auto;
    }

    .image-viewer {
        padding: 30px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .product-table {
        font-size: 14px;
    }

    .product-table th, .product-table td {
        padding: 8px 5px;
    }

}

@media (max-width: 480px) {


    h1 {
        font-size: 24px;
        margin: 10px 0;
    }

    .container-image-description p {
        width: 95%;
        font-size: 15px;
    }

    .product-images {
        width: 90%;
    }

    .image-viewer {
        padding: 20px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .image-viewer .arrow {
        padding: 8px;
        font-size: 16px;
    }

    .product-table {
        font-size: 13px;
    }

    .product-table th, .product-table td {
        padding: 6px 4px;
    }

    .overlay .arrow {
        font-size: 30px;
    }

    .overlay .arrow.left {
        left: 15px;
    }

    .overlay .arrow.right {
        right: 15px;
    }
}

@media (max-width: 360px) {
    .product-sheet {
        width: 90%;
    }

    h1 {
        font-size: 20px;
    }

    .product-images {
        width: 100%;
    }

    .image-viewer {
        padding: 40px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .container-image-description p {
        width: 98%;
        font-size: 14px;  
    }

    .product-table {
        font-size: 13px;
    }

    .product-table th, .product-table td {
        padding: 5px 3px;
    }
}