
body {
    margin:0;
    padding: 0;
    box-sizing: border-box;
    
}

.products_container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;


    
} 
.product {
    display: flex;
    flex-direction: row; /* Default: side-by-side */
    padding: 20px;
    margin: 50px auto;
    background-color: rgba(255, 255, 255, 0.667);
    border-radius: 10px;
    flex-wrap: wrap;
    max-width: 70%; /* Allows shrinking on smaller screens */
    width: fit-content; /* Adapts to content width */
    height: auto; /* Adapts to content height */
    box-shadow: 2px 2px 25px 5px black;
    align-items: stretch;
}
.prodid{
    position: absolute;
    top:17px;
    left:17px;
    background-color: rgba(0, 0, 0, 0.357);
    padding: 2px;
    border-radius: 5px;
    color:rgb(229, 229, 229);
    font-size: smaller;
}

.product > div {
    min-width: 300px;
}

.left_part {
    position: relative;
    /* border: 2px solid black; */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 10px;
    /* margin:10px; */
    width: 50%;
    /* height: 100%; */
    max-width: 450px;
    max-height: 450px;
    object-fit: contain;
    overflow: hidden;
    object-position: center;

}
#img {
    
    width: 500px;
    height: 350px;          /* or adjust to your preferred aspect ratio */
    border-radius: 5px;
    object-fit: contain;
    object-position: center;
    display: block;
    background-color: #000000;
}



.right_part {
    max-width: 400px;
    max-height: 450px;
    display: flex;
    justify-content: space-around;
    /* align-items: center; */
    flex-direction: column;
    padding:10px;
    width: 50%;


    /* background-color: bisque; */
}

.right_part > div {
    padding:15px;
    background-color: white;
    width: 100%;
    border-radius: 5px;
    box-shadow: 1px 1px 6px 1px grey;
}
.right_part {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
}
.title {
    position:relative;
    text-align: center;
    vertical-align:middle;
    height: 20%;
    padding-left:15px;
    font-size: 2em;
    font-weight: 800;
    color:white;
    background-image: url('images/lambriu.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    z-index:9;
    
}

.blur {
    border-radius:5px;
    position:absolute;
    top:0;
    left:0;
    z-index:10;
    height: 100%;
    width: 100%;
    backdrop-filter: blur(2px);
    background-color: rgba(60, 13, 13, 0.854);
    
}

.heading {
    font-family: "Rye", serif;
    font-size: 23px;
    border-radius:5px;
    z-index:11;
    word-wrap: break-word;     /* Legacy support */
    overflow-wrap: anywhere;   /* Forces breaking anywhere if needed */
    white-space: normal; 
}


.descr {
    overflow: auto;
    display: flex;
    flex-wrap: wrap;
    min-height: 220px;
    max-height: 50%;
    margin: 15px 0px;

    /* Add these: */
    word-wrap: break-word;     /* Legacy support */
    overflow-wrap: anywhere;   /* Forces breaking anywhere if needed */
    white-space: normal;
    font-size: .8em;
}
.descritere {
    min-height: 80px;
    max-height: 140px;
}
.utils {
    min-height: 26%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    max-height: fit-content;
}

.utils > div {
    padding:5px;
    width: 50%;
    border:2px black solid;
    margin:5px;
    border-radius: 5px;
}



.qty div {
    border-radius: 2px solid black;
}
.qty {
    padding:0px;
    min-width: 60%;
    max-width: 70%;
    
}
.price {
    min-width: 30%;
    max-width: 35%;
    flex-wrap: wrap;
    font-weight: 800;
    font-size: larger;
}

.frm {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    /* flex-wrap: wrap; */
    font-size: larger;

}

.h_trei {
    color:red;
}
.sub {
    padding:5px;
    min-width:fit-content;
}

.left_part, .right_part {
    flex: 1 1 300px; /* allow smaller shrink size */
    min-width: 280px; /* enough for mobile, you can go lower if needed */
    max-width: 100%;
    box-sizing: border-box; /* ensures padding is included in width */
}

.dets {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ruler {
    display: block;

    width: 50px;
    height: 40px;
    background-image: url('images/ruler.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    margin:0px 10px 0px 0px;


}

.personaliza {
    width: 45%;
    height: 50px;
    background-color: rgba(172, 255, 47, 0.69);
    padding:2px 5px;
    border-radius: 5px;
    box-shadow: 2px 2px 5px 2px grey;
}

.thumbnail-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  max-width: 100%;
}

.thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: border 0.3s;
}

.thumb:hover,
.thumb.active {
  border: 2px solid #444;
}

.personaliza-button-container {
    text-align: center;
    margin-top: 20px;
}



.wood-button:hover {
    background-color: #a37e5c;
}

/* Styles for the modal popup */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    padding-top: 60px;
}

.modal-content {
    
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    animation: animatetop 0.4s;
}

@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.personalize-form textarea {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 10px;
    resize: vertical;
}
#personalize-btn{
    width: 100%;
}
.modal-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    
    text-align: center;
    margin-top: 20px;
}

@media (max-width: 650px) {
    .products_container, body{
        height: fit-content;
    }
    .product {
        flex-direction: column;
        padding: 5px;
        max-width: 90vw;
        align-items: center;
        margin:50px 10px;
        height: auto;
        overflow: visible;
    }
    #personalize-btn {
        color:white;
        font-size: 1.2em;
    }
    .left_part {
        margin:5px;
        /* height: max-content; */
        max-height: none;
    }

    #img, .right_part > div {
        margin:5px;
        min-width: 300px;
        max-width: 380px;
        border-radius: 5px;
        object-fit: cover;
      
    }

    .right_part > div {
        max-width: max-content;
        max-width: 380px;
    }
    .right_part {
    max-width: 400px;
    max-height: none;
    display: flex;
    flex-direction: column;
    padding: 10px;
    width: 50%;
    }

    .sub {
        color: white;
    }

    .desc {
        max-height: fit-content;
    }
    .utils *{
        max-height: fit-content;
        max-width: 100%;
    }
    .utils {
        min-height: fit-content;
    }
    .qty {
        max-height: none;
        max-width: 100%;

    }
    .frm {
            flex-direction: column;
            max-height: fit-content;
            width: 100%;
    }
    .frm * {
        padding: 2px;
    }   
    .sub {
        padding: 5px;
        border-radius: 5px;
    }
    .thumbnail-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    max-width: 100%;
    padding: 10px;
    overflow-x: auto; /* allows horizontal scroll if needed */
    box-sizing: border-box;
    height: 60px;
    overflow:hidden;
    }
    #img {
    width: 350px;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    object-fit: contain;
    object-position: center;
    display: block;
    background-color: #f5f5f5;
    }
   .thumb {
    width: 50px;
    height: 45px;
   }

}