/* ==========================================================================
   STRUCTURE GLOBALE & PANIER (Conservée mais sécurisée)
   ========================================================================== */
   div#panier {
    width: 1200px;
    height: auto;
    min-height: calc(100vh - 150px);
    margin: 100px auto 0;
    box-sizing: border-box;
}

div#panier h2 {
    text-align: center;
    color: #333;
    height: 100px;
    line-height: 100px;
    margin: 0;
    padding: 0;
}

div#panier div.panier {
    width: 800px;
    float: left;
    padding: 10px 20px; 
    border-radius: 20px;
    border: solid 1px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

/* ==========================================================================
   LIGNES ARTICLES (Modernisées en Flexbox pour éviter les chevauchements)
   ========================================================================== */
div#panier div.panier div.article {
    width: 100%;
    height: 100px;
    margin: 10px 0;
    padding: 5px; 
    border-radius: 25px;
    border: solid 1px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    
    /* Flexbox aligne tout horizontalement sur une seule ligne sans float */
    display: flex;
    align-items: center;
    gap: 15px;
}

div#panier div.panier div.article div.image {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    border: solid 1px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    flex-shrink: 0; /* Empêche l'image de rétrécir */
}

div#panier div.panier div.article div.image div {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
}

div#panier div.panier div.article div.item {
    flex: 1; /* Prend dynamiquement tout l'espace central disponible */
    min-width: 0;
    padding: 0;
}

div#panier div.panier div.article div.item a {
    width: 100%;
    height: 30px;
    line-height: 30px;
    overflow: hidden;
    display: block;
    color: #6eb7c5;
    text-decoration: none;
    font-weight: 600;
}

div#panier div.panier div.article div.item span {
    width: 100%;
    height: 20px;
    line-height: 20px;
    overflow: hidden;
    display: block;
    color: #666;
}

div#panier div.panier div.article div.qte {
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

div#panier div.panier div.article div.qte a {
    width: 30px;
    height: 30px;
    line-height: 28px;
    display: inline-block;
    border: solid 1px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-size: 0.8em;
    box-sizing: border-box;
}

div#panier div.panier div.article div.qte input {
    width: 50px;
    height: 30px;
    line-height: 30px;
    display: inline-block;
    border: 0;
    text-align: center;
    color: #333;
    font-size: 0.8em;
    margin: 0; 
    padding: 0;
}

div#panier div.panier div.article div.prix {
    width: 130px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    flex-shrink: 0;
}

div#panier div.panier div.article div.actions {
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

div#panier div.panier div.article div.actions a {
    display: block;
    font-size: 1.2em;
    color: #82716b;
    text-decoration: none;
}

/* ==========================================================================
   BLOC RÉSUMÉ
   ========================================================================== */
div.resume {
    width: 390px;
    float: left;
    padding: 15px 30px; 
    border-radius: 25px;
    background: rgba(0, 0, 100, 0.05);
    margin-left: 10px;
    box-sizing: border-box;
}

div.resume h3 {
    font-size: 1.1em;
    display: none;
    text-align: center;
    margin: 0;
    padding: 0;
    color: rgba(0, 0, 0, 0.5);
}

div.resume select {
    width: 100%;
    background: transparent;
    height: 50px;
    border-radius: 25px;
    margin: 10px 0;
    padding: 0 25px;
}

div.resume div.prix {
    width: 100%;
    height: auto;
    overflow: hidden;
    float: none;
    clear: both;
}

div.resume div.total {
    border-top: solid 1px rgba(0, 0, 0, 0.1);
}

div.resume div.prix span {
    color: rgba(0, 0, 0, 0.35);
    height: auto;
    line-height: 30px;
    width: 50%; 
    display: block;
    float: left;
}

div.resume div.prix span label {
    display: inline-block;
    margin-left: 5px;
}

div.resume div.prix em {
    display: block;
    float: none;
    clear: both;
    color: rgba(0, 0, 0, 0.15);
    width: 100%;
    text-align: left;
    height: 20px;
    line-height: 20px;
}

div.resume div.prix strong {
    color: #333;
    height: 30px;
    line-height: 30px;
    width: calc(50% - 4px); 
    text-align: right;
    display: block;
    float: left;
}

/* Bouton "Passer à la commande" */
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding: 0 30px;
    margin: 30px 0 10px 0;

    background: #6eb7c5;
    color: #ffffff;
    border: none;
    border-radius: 999px;

    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;

    transition: 
        transform 0.3s ease, 
        box-shadow 0.3s ease, 
        background-color 0.3s ease;
}

/* Effet au survol (:hover) */
button.btn:hover {
    background-color: #5aa9b8;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(110, 183, 197, 0.3);
}

/* Effet au clic (:active) pour une bonne expérience utilisateur */
button.btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(110, 183, 197, 0.2);
}

/* Système d'input */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* ==========================================================================
   MEDIA QUERIES (Ajustements Responsive Clean)
   ========================================================================== */

@media screen and (max-width: 1240px) {
    div#panier {
        width: 100%;
        padding: 0 15px;
    }
    div#panier div.panier {
        width: calc(100% - 410px); /* S'adapte dynamiquement à côté du résumé */
    }
}

@media screen and (max-width: 1024px) {
    div#panier div.panier {
        width: 100%;
        float: none;
        margin-bottom: 30px; /* Ajoute la marge sous le panier avant le résumé */
    }
    div.resume {
        width: 100%;
        float: none;
        margin-left: 0;
        margin-bottom: 40px;
    }
}

@media screen and (max-width: 768px) {
    div#panier div.panier div.article {
        height: auto;
        padding: 10px;
        gap: 10px;
    }
    div#panier div.panier div.article div.image {
        width: 70px;
        height: 70px;
    }
    div#panier div.panier div.article div.prix {
        width: 90px;
        font-size: 1.1em;
    }
}

@media screen and (max-width: 600px) {
    /* Optimisation mobile : transformation de la ligne en mini-grille */
    div#panier div.panier div.article {
        display: grid;
        grid-template-columns: 70px 1fr 30px;
        align-items: start;
    }
    div#panier div.panier div.article div.image {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
    div#panier div.panier div.article div.item {
        grid-column: 2;
        grid-row: 1;
    }
    div#panier div.panier div.article div.actions {
        grid-column: 3;
        grid-row: 1;
    }
    div#panier div.panier div.article div.qte {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
        width: auto;
    }
    div#panier div.panier div.article div.prix {
        grid-column: 2 / span 2;
        grid-row: 2;
        text-align: right;
        width: auto;
        padding-top: 5px;
    }
}