/* ====== Container principal de la page d'achat ====== */
#contianer_buy{
    width: 100%;
    margin-top: 20vh;
    position: relative;
    padding-bottom: 50px;
    overflow:hidden; /* empêche un débordement visuel */
}

/* ====== Layout global : zone image + zone paiement ====== */
#container_item{
    width: 100%;
    display: flex; /* desktop : affichage en ligne */
}

/* ====== Bloc récap des produits ====== */
#item_recap{
    width: 40%;
    margin-left: 5%;
    position: relative;
}

#recp_titre{
    width: 100%;
    padding-left: 20px;
}

/* Grille des images (miniatures) du panier */
#container_img{
    width: 100%;
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(4, 1fr);
    padding: 20px;
}

/* Mini-rectangle contenant une miniature produit */
.rect {
    background: #e9e2d6;
    border-radius: 14px;
    height: 17vh;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.233);
    position: relative;
}

/* Quantité affichée en bas du rectangle */
.qte{
    position: absolute;
    font-size: clamp(14px, 1vw, 25px);
    right: 5px;
    bottom: 2px;
}

/* Miniature produit */
.img_recap{
    object-fit: contain;
    width: 100%;
    height:100%;
}

/* ====== Formulaire paiement / livraison ====== */
#promo{
    margin-top: 20px;
    margin-left: 20px;
    width: 95%;
}

#paiement{
    margin-left: 25%;
    width: 70%;
    height:auto;
}

#livraison{
    height:40%;
    margin-top: 40px;
    margin-left: 20px;
    width: 100%;
}

/* Zone info carte bancaire */
#info{
    width: 50%;
    height: 100%;
    padding: 5px;
}

#logo_card{
    display: flex;
    margin-top: 10px;
    height:20px;
}

.are_info_card{
    border-radius: 15px;
    background-color: #bac59f;
    height:5vh;
    min-height:40px;
    padding: 5px 0 5px 10px;
    display: flex;
    align-items: center;
}

/* Inputs stylés */
input{
    border: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color:inherit;
}

/* Champs carte */
#card_number{
    width: 100%;
    margin-top: 20px;
}

.other_info{
    display: flex;
    gap: 3%;
    margin-top: 20px;
}

#expi, #cvc{
    width: 48.5%;
}

.info_user{
    margin-top: 20px;
    width: 100%;
}

/* Bouton payer */
#pay{
    width: 100%;
    position: relative;
    margin-top: 20px;
}

#btn_pay{
    border-radius: 12px;
    padding: 10px;
    background-color: #ffce12;
    width: fit-content;
    float: right;
    cursor: pointer;
}

/* Affichage responsive */
#container_bottom_livraison_resp{
    display: none;
}

/* ====== MEDIA QUERIES ====== */

/* Ajustements pour écrans moyens */
@media (max-width: 1280px) and (max-height: 1024px){
  .rect{
    height: 12vh;
    padding: 5px;
  }
}

@media (max-width: 1280px) and (max-height: 960px){
    .rect{
        height:15vh;
    }
}

@media (max-width: 1280px) and (max-height: 768px){
    .rect{
      padding: 10px;
    }
}

/* Tablettes */
@media (max-width: 1152px){
    .rect{
      padding: 5px;
    }
    #item_recap{
        width: 45%;
    }
    #paiement{
        margin-left: 15%;
    }
}

/* Passage en colonne sur mobile */
@media (max-width: 950px){
    #container_item{
        flex-direction: column;
    }

    #item_recap{
        padding-bottom: 20px;
        padding-left: 10px;
        width: 100%;
        margin-left: 0;
    }

    #container_img{
        grid-template-columns: repeat(auto-fit, minmax(15%, 1fr));
        width: 80%;
        margin-left: 10%;
    }

    .are_info_card{
        min-height: 30px;
    }

    #recp_titre{
        text-align: center;
    }

    #promo{
        width: 40%;
        margin-left: 0;
    }

    #info{
        padding: 0;
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
    }

    #paiement{
        margin-left: 0;
        width: 60%;
    }

    #container_bottom_livraison{
        text-align: center;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        display: none;
    }

    #container_bottom_livraison_resp{
        display: block;
    }

    #livraison{
        text-align: left;
        padding-left: 0;
        margin-left: 0;
    }

    #logo_card{
        display: flex;
        justify-content: center;
    }

    .stars{
        width: 18px;
    }
}

/* Mobile petit */
@media (max-width: 700px){
    #paiement{
        width: 80%;
    }
}

/* Mobile très petit */
@media (max-width: 600px){
    #container_img{
        grid-template-columns: repeat(auto-fit, minmax(20%, 1fr));
        width: 90%;
        margin-left: 5%;
        padding: 10px;
    }

    .rect{
        padding: 5px;
    }

    #promo{
        width: 60%;
    }
}

@media (max-width: 400px){
    #paiement{
        width: 90%;
    }
}
