/* Add comments to explain structure, layout, and responsive behavior */

#contianer_buy{
    width: 100%;
    height:auto;
    margin-top: 18vh; /* space from top */
    position: relative;
    overflow: hidden;
}
#container_item{
    width: 100%;
    height:100%;
    display: flex; /* layout for recap + images */
}
.qte{
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 15px;
  font-weight: bold; /* quantity badge */
}
#item_recap{
    width: 45%;
    height: 80%; /* left side recap */
}
#recp_titre{
    width: 100%;
    padding-left: 20px;
    margin-top: 10px;
}
#container_img{
    width: 100%;
    display: grid; /* grid of items */
    gap: 20px;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    padding: 20px;
    cursor: pointer;
}
.rect {
    background: #e9e2d6;
    border-radius: 14px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.233);
    position: relative;
    user-select: none;
    flex-direction: column;
    row-gap: 10px; /* product cards */
}
.del{
    font-size: clamp(12px, 1vw, 30px);
    transition: transform 0.5s ease;
}
.del:hover{
    transform: scale(1.1)
}
.icone_del:hover{
    transform: scale(1.3);
}
.img_recap{
    object-fit: contain;
    width: 100%;
    height:70%;
    user-select: none;
    transition: transform 0.5s ease; /* image animation */
}
.img_recap:hover{
    transform: scale(1.1);
}
#total{
    margin-left: 20px;
    display: flex;
    justify-content: center;
    padding-right: 20px;
    margin-top: 20px; /* desktop total */
}
#tota_resp{
  display: none; /* responsive total */
  width: 100%;
  text-align: center;
  margin-top: 20px;
}
#recap{
    width: 40%;
    min-width: 40%;
    height:100%;
    position: relative;
    user-select: none;
}

#img_pani{
    height:80%;
    width: auto;
}

#container_titre{
  width: 100%;
}


#pay_section{
  width: 20%;
  height: 100%;
  padding: 10px;
  padding-top: 13.2vh; /* payment module */
}
#pay_section_resp{
  width: 20%;
  height: 100%;
  display: none; /* mobile version of pay section */
}




.sec_btn{
    margin-top: 10px;
}
.btn_buy{
    width: 80%;
    border-radius: 12px;
    margin-left: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffce12; /* CTA button */
    cursor: pointer;
    padding: 5px;
    transition: border 0.5s ease;
    border: 1px solid transparent;
    user-select: none;
    text-align: center;
}
.btn_buy:hover{
    border: 1px solid rgba(0, 0, 0, 0.212);
}
#info_send{ 
    height:100%; 
    min-height: 500px; 
    width: 40%; 
    padding: 5px; 
    padding-left: 30px;  /* form section */
} 
.green_bg{
  background-color: #b8c496;
}
#panier_btn{
  margin-top: 30px;
}

#container_pictures {
  display: flex;
  width: 100%;
  padding: 5px;
  gap: 3%;
  height: auto;
  position: relative;
}
#other_picture {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 150px;
  padding: 5px;
  position: relative; /* side thumbnails */
}
.container_other {
  width: 100px;
  height: 9vh;
  background-color: #e2d8c5;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  border: 1px solid white;
  padding: 5px;
}
.container_other:hover .other_pict {
  transform: scale(1.15);
}
.other_pict {
  width: auto;
  height: 95%;
  cursor: pointer;
  transition: transform 0.5s ease; /* hover on small pictures */
}


/* product fiche section */
#product_fiche {
  position: relative;
  height: 80vh;
  display: flex;
  justify-content: center;
  z-index: 2;
  opacity: 0; /* hidden initial */
  width: 100%;
}
#pict_center {
  width: auto;
  height: 85%;
  transition: opacity 0.5s ease;
  margin: auto;
  max-width: 100%; /* main picture */
}



#info_product{
  width: 200px;
  height: 100%;
}
#see_fiche{
  position: absolute;
  width: 200px;
  bottom: 30%;
  z-index: 2;
  margin: 0;
}
#identifiant{
  opacity: 0;
  width: 0;
}


/* ----------- RESPONSIVE ----------- */
@media (max-width: 1366px){
  .rect{
    height: 120px;
  }
  .container_other{
    width: 100%;
    height: 9vh;
  }
  #recap{
    width: 35%;
  }
  #other_picture{
    width: 100px;
  }
}

@media (max-width: 1280px) and (max-height: 1024px){
  #pict_center{
    height:60%; /* photo smaller */
  }
  .del{
    font-size: clamp(14px, 1vw, 30px);
  }
}
@media (max-width: 1280px) and (max-height: 960px){
  #pict_center{
    height:70%;
  }
}
@media (max-width: 1280px) and (max-height: 720px){
  #pict_center{
    height:80%;
  }
  .del{
    font-size: clamp(12px, 1vw, 30px);
  }
}
@media (max-width: 1024px){
  #pict_center{
    height:70%;
  }
}
@media (max-width: 1150px){
  #recap{
    display: none; /* hide recap on tablet */
  }
  #pay_section{
    position: absolute;
    right: 0%;
    width: 35%;
    max-width: 250px;
  }
  #total{
    display: none;
  }
  #tota_resp{
    display: block;
  }
  #item_recap{
    width: 68%;
  }
  #container_img{
    grid-template-columns: repeat(auto-fit, minmax(15%, 1fr));
  }
}
@media (max-width: 900px){
  #container_img{
    grid-template-columns: repeat(auto-fit, minmax(25%, 1fr));
  }
}

@media (max-width: 650px){
  #item_recap{
    width: 100%;
  }
  #pay_section{
    width: 250px;
    position: absolute;
    top:0;
    padding-top: 0;
    display: none; /* hide desktop pay */
  }
  #recp_titre{
    display: flex;
  }
  #container_titre{
    width: 50%;
  }
  #pay_section_resp{
    width: 50%;
    display: block; /* mobile pay */
  }
}
