/* ACCUEIL */
#accueil-infos p {
  font-size: 1.1em;
  margin-top: 1em;
  line-height: 1.7;
  text-align: center;
}

/* CONTENT */

.accueil-content {
  width: 100%;
  max-width: 1500px;
  box-sizing: border-box;

  background-color: var(--bcg-first-color);

  display: flex;
  justify-content: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2em;

  padding: 2.5em;
}

.accueil-content-infos {
  flex: 1 1 200px;
  min-width: 200px;
}

.accueil-content-image {
  flex: 1 1 200px;
  min-width: 200px;
}

.accueil-content-image img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.accueil-content-infos h2 {
  font-size: 2em;
  margin-bottom: 01em;
}

.accueil-content-infos p {
  font-size: 1em;
  line-height: 1.5;
  margin-bottom: 3em;
}

/* ------------------ */

/* LICENCE */

.licence-box {
  width: 80%;
  max-width: 1500px;
  display: flex;
  flex-direction: column;
}

.licence-box > a {
  width: fit-content;
}


.licence-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: stretch;
  justify-content: center;
}

.card-jeu-presentation {
  flex: 1 1 280px;

  position: relative;
  width: 100%;
  max-width: fit-content;
  height: 280px;
  overflow: hidden;

  background-color: var(--bcg-first-color);

  transition: transform 0.2s ease;
}

.card-jeu-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

  transition: transform 0.3s ease;
}

.card-jeu-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: flex-end;
  padding: 20px;

  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85),
    rgba(0, 0, 0, 0.15) 60%,
    transparent
  );
}

.card-jeu-overlay h2 {
  margin: 0;
  color: var(--bcg-second-color);

  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;

  text-shadow: 3px 3px 0 var(--font-color-2);
  letter-spacing: 2px;
}

.card-jeu-presentation:hover .card-jeu-image {
  transform: scale(1.06);
}

/* DETAILS */

.jeu-detail {
  width: 80%;
  max-width: 1500px;
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.jeu-detail-presentation {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 2em;

  width: 100%;
  box-sizing: border-box;
  background-color: var(--bcg-first-color);
  padding: 2.5em;
  height: fit-content;
}

.jeu-detail-presentation-infos {
  flex: 1 1 300px;
  min-width: 0;
  gap: 1em;
  display: flex;
  flex-direction: column;
}

.jeu-detail-presentation-infos > .btn,
.jeu-detail-catalogue > .btn {
  width: fit-content;
}

.jeu-detail-presentation-infos h1,
.jeu-detail-catalogue-infos h1 {
  font-size: 2.5rem;
}

.jeu-detail-presentation-infos p,
.jeu-detail-catalogue-infos p {
  font-size: 1.25rem;
}

.jeu-detail-presentation-infos p:nth-child(3)::before {
  content: "Édition : ";
}

.jeu-detail-presentation-image {
  flex: 1 1 200px;
  min-width: 0;
}

.jeu-detail-presentation-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jeu-detail-catalogue {
  display: flex;
  flex-direction: column;
  gap: 2em;

  width: 100%;
  box-sizing: border-box;
  background-color: var(--bcg-first-color);
  padding: 2.5em;
  height: fit-content;
}

.jeu-detail-catalogue-infos {
  gap: 1em;
  display: flex;
  flex-direction: column;
}


/* ==============================
   PAGE PANIER
   ============================== */

.page-panier {
  max-width: 1500px;
  padding: 2em 0;
  width: 80%;
  color: var(--font-color-1);
}


/* Panier vide */

.page-panier > p {
  width: 100%;
  background-color: var(--bcg-first-color);
  text-align: center;
  font-size: 1.2em;
  padding: 1em;
  margin-bottom: 2em;
}

/* Liste des produits */

.page-panier ul {
  display: flex;
  flex-direction: column;
  gap: 1em;
  list-style: none;
  padding: 0;
  margin-bottom: 1.5em;
}

.page-panier li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;

  background-color: var(--bcg-first-color);

  padding: 1.5em;
  font-size: 1.1em;
}
/* TOTAL DU PANIER */

.page-panier .total-panier {
  display: flex;
  justify-content: flex-end;

  width: fit-content;
  /* margin: 1.5em 0 0 auto; */
  padding: 1.2em 2em;

  background-color: var(--bcg-first-color);
  color: var(--font-color-1);

  font-size: 1.3em;
}


/* ALERTE STOCK */
.alerte-stock {
  color: var(--font-color-alerte);
  background-color: var(--bcg-color-alerte);
  border: 2px solid var(--border-color-alerte);
  font-size: 0.9em;
  padding: 1em;
  font-weight: bold;
}
/* Bouton retirer */

.page-panier li button {
  background-color: var(--bcg-fourth-color);
}

/* Zone des actions */
.actions-panier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  flex-wrap: nowrap;
  width: 100%;
}

/* Total à gauche */
.actions-panier .total-panier {
  flex-shrink: 0;
}


/* Boutons du panier : <a> et <button> rendus de la même façon */
.page-panier .btn,
.page-panier .btn-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.page-panier .btn-disabled {
  cursor: not-allowed;
}

/* Les <form> générés par le composant ne doivent pas ajouter de marge */
.page-panier form {
  display: flex;
  margin: 0;
}

/* Bouton retirer */
.page-panier li form {
  flex-shrink: 0;
}

.page-panier li .btn {
  background-color: var(--bcg-fourth-color);
}

/* Zone des actions */
.actions-panier {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1em;
  width: 100%;
}

/* Total poussé à gauche, boutons à droite */
.actions-panier .total-panier {
  margin-right: auto;
  flex-shrink: 0;
}

/* Largeur uniforme pour les deux boutons (lien et formulaire) */
.actions-panier > .btn,
.actions-panier > form .btn,
.actions-panier > form .btn-disabled {
  min-width: 230px;
  height: 100%;
}

/* ALERTE PANIER */
.alerte-panier {
  color: var(--font-color-alerte);
  background-color: var(--bcg-color-alerte);
  border: 2px solid var(--border-color-alerte);
  padding: 0.8em 1em;
  margin: 1em 0;
  font-size: 0.95em;
  text-align: center;
}

/* Adaptation mobile */
@media (max-width: 700px) {
  .page-panier {
    width: 95%;
    padding: 1em;
  }

  .page-panier li {
    flex-direction: column;
    align-items: stretch;
  }

  .page-panier li form,
  .page-panier li .btn {
    width: 100%;
  }

  .actions-panier {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-panier .total-panier {
    margin-right: 0;
    width: 100%;
    justify-content: center;
  }

  .actions-panier > .btn,
  .actions-panier > form,
  .actions-panier > form .btn,
  .actions-panier > form .btn-disabled {
    width: 100%;
    min-width: 0;
  }
}


/* CATALOGUE */

.catalogue-produits {
  width: 80%;
  max-width: 1500px;
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.catalogue-produits-box {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: stretch;
  justify-content: center;
}

.carte-produit {
  flex: 1 1 280px;
  max-width: 480px;
  min-width: 350px;

  position: relative;

  display: flex;
  flex-direction: column;

  padding: 1.5em 2.5em;
  box-sizing: border-box;

  background-color: var(--bcg-first-color);
}

.carte-produit-lien{
    position: absolute;
    top: 0.25em;
    right: 0.5em;
    font-size: 2rem;
    color: var(--font-color-1);
    text-decoration: none;
    cursor: url("../img/pointer.png") 16 16, pointer;
    transform: scale(1);
    transform-origin: bottom left;
    transition: transform 0.25s ease;
}

.carte-produit-lien:hover {
    transform: scale(1.25);
}

.carte-produit-image {
  width: 100%;
  aspect-ratio: 1 / 1;          /* zone carrée identique pour toutes les cartes */
  max-height: 260px;            /* taille max */
  margin-bottom: 1em;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;
}

.carte-produit-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;          /* l'image entière est visible, sans déformation */
  display: block;
}

.carte-produit h2 {
  font-weight: 600;
  font-size: 1.6rem;
  padding-bottom: 0.5em;
}

.carte-produit p {
  text-align: justify;
  margin-bottom: 1.5em;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  overflow: hidden;
  text-overflow: ellipsis;
}

.carte-produit-achat {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    margin-top: auto;
}

.carte-produit-prix {
  font-weight: 600;
  font-size: 1.2rem;
}

.carte-produit-prix:hover {
  text-decoration: underline;
}

/* DETAILS PRODUIT */
.produit-detail {
    width: 80%;
    max-width: 1500px;
    display: flex;
    flex-direction: column;
    gap: 2em;
}

/* Box principale */
.produit-detail-presentation {
    display: flex;
    flex-direction: column;
    gap: 2em;

    width: 100%;
    box-sizing: border-box;

    background-color: var(--bcg-first-color);
    padding: 2.5em;
    height: fit-content;

    justify-content: center;
    align-content: center;
}

.produit-detail-presentation > div {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2.5em;
}

.produit-detail-presentation-image {
  flex: 0 1 400px;              /* largeur idéale 400px, peut rétrécir */
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.produit-detail-presentation-image img {
  width: 100%;
  max-height: 400px;            /* évite les images surdimensionnées */
  height: auto;
  object-fit: contain;
  display: block;
}



.produit-detail-presentation-infos {
  flex: 1 1 300px;
  min-width: 0;
  gap: 1.5em;
  display: flex;
  flex-direction: column;
}

/* Titres et textes */
.produit-detail-presentation-infos h1 {
    font-size: 2.5rem;
}

.produit-detail-presentation-infos p {
    font-size: 1.25rem;
    text-align: justify;
}

.produit-detail-presentation-infos p:first-of-type:before {
    content: "Description : ";
    display: block;
    text-decoration: underline;
    font-size: 1.60rem;
    margin-bottom: 0.25em;
}

.produit-detail-presentation-infos p:last-of-type {
    font-size: 1.60rem;
    font-weight: bold;
}

/* Boutons : restent en dessous */
.produit-detail-informations {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}


@media (max-width: 800px) {
  .produit-detail-presentation > div {
    flex-direction: column-reverse; /* image au-dessus, infos en dessous */
  }

  .produit-detail-presentation-image {
    flex: none;
    width: 100%;
    max-width: 300px;
  }

  .produit-detail-informations {
    flex-direction: column;
    gap: 1em;
  }
}



/* HISTORIQUE DES COMMANDES */

.historique-commandes {
  width: 90%;
  max-width: 1100px;
  margin: 40px auto;
}

.historique-commandes > h1 {
  text-align: center;
  margin-bottom: 35px;
  font-size: 2.5rem;
  color: var(--bcg-third-color);
}

.liste-commandes {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.carte-commande {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;

  padding: 25px;
  background-color: var(--bcg-first-color);

}

.infos-commande h2 {
  margin: 0 0 12px;
  color: var(--font-color-1);
}

.date-commande {
  margin: 0;
  color: var(--font-color-1);
}


.historique-vide {
  text-align: center;
  padding: 35px;
  background-color: var(--bcg-first-color);
  color: var(--font-color-1);
}

/* RESPONSIVE */

@media screen and (max-width: 600px) {
  .historique-commandes {
    width: 92%;
  }

  .historique-commandes > h1 {
    font-size: 2rem;
  }

  .carte-commande {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }

  .actions-commande {
    width: 100%;
  }

}

/* DETAIL DE COMMANDE */

.detail-commande {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
}

/* EN-TETE */

.titre-detail-commande {
    text-align: center;
}

.date-detail-commande {
  margin-top: 0.5em;
    font-size: 1.1rem;
}

/* BLOC DES PRODUITS */

.bloc-produits-commande {
    background-color: var(--bcg-fourth-color);
    padding: 25px;
    margin-bottom: 30px;
}

.bloc-produits-commande > h2,
.bloc-produits-commande > p {
    text-align: center;
    color: var(--font-color-2);
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 25px;
}

/* LISTE DES PRODUITS */

.liste-produits-commande {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* CARTE PRODUIT */

.carte-produit-commande {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background-color: white;
    color: var(--bcg-third-color);
    padding: 18px 20px;
}

.infos-produit-commande h3,
.prix-produit-commande {
    color: var(--bcg-third-color);
}

.infos-produit-commande h3 {
    margin: 0;
}

.prix-produit-commande {
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* TOTAL DE LA COMMANDE */

.total-detail-commande {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background-color: var(--bcg-first-color);
    color: var(--font-color-1);
    padding: 22px 25px;
    margin-bottom: 30px;
}

.total-detail-commande span {
    font-size: 1.2rem;
    font-weight: bold;
}

.total-detail-commande strong {
    font-size: 1.6rem;
}

/* BOUTON RETOUR */

.retour-historique-commande {
    justify-self: center;
    display: flex;
}
/* RESPONSIVE */

@media screen and (max-width: 600px) {

    .detail-commande {
        width: 92%;
    }

    .titre-detail-commande h1 {
        font-size: 2rem;
    }

    .bloc-produits-commande {
        padding: 15px;
    }

    .carte-produit-commande {
        padding: 15px;
        gap: 10px;
    }

    .total-detail-commande {
        padding: 18px;
    }

    .total-detail-commande span {
        font-size: 1rem;
    }

    .total-detail-commande strong {
        font-size: 1.3rem;
    }
}



/* UTILISATEUR COMPTE */

.compte-infos {
  padding: 2em;
  width: 100%;
  background-color: var(--bcg-first-color);
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.compte-infos li {
  padding: 1.2em 1.5em;
  font-size: 1.1rem;
  font-weight: 700;
  background-color: var(--bcg-fourth-color);
  color: var(--font-color-2);
}

/* Boutons */
.compte-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1em;
  width: 100%;
  margin-top: 3em;
}



/* PAGE ADMIN */

.admin-page-items {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2em;
}

.carte-admin {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2em;
  padding: 2em;
  background-color: var(--bcg-first-color);
}

.carte-admin-texte {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.carte-admin h2 {
  font-size: 1.6rem;
  font-weight: 800;
}

.carte-admin p {
  font-size: 1rem;
  opacity: 0.85;
}

/* Le bouton prend toute la largeur de la carte */
.carte-admin form,
.carte-admin .btn {
  width: 100%;
}


/* LISTE PRODUITS ADMIN */


.liste-produit-admin-infos {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.liste-produit-admin-infos > .btn {
  margin-bottom: 2em;
  align-self: flex-start;
}

.table-admin-wrapper {
  width: 100%;
  overflow-x: auto;
  background-color: var(--bcg-first-color);
}

.table-admin {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.table-admin th {
  padding: 1em;
  text-align: left;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--font-color-2);
  background-color: var(--bcg-fourth-color);
  border-bottom: 4px solid var(--box-border-1);
}

.table-admin td {
  padding: 1em;
  vertical-align: middle;
  font-weight: 600;
  border-bottom: 3px dashed var(--box-border-1);
}

.table-admin tbody tr:last-child td {
  border-bottom: none;
}

.table-admin tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

.table-admin tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Miniature */
.miniature {
  display: block;
  max-width: 64px;
  max-height: 64px;
  object-fit: cover;
  border: 3px solid var(--box-border-1);
  box-shadow: 2px 2px var(--box-border-1);
}

.etat {
  display: inline-block;
  padding: 0.3em 0.7em;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--font-color-2);
  border: 3px solid var(--box-border-1);
}

.etat-ok {
  background-color: var(--bcg-fourth-color);
}

.etat-off {
  background-color: var(--bcg-fifth-color);
}

/* Actions */
.actions-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
}

.btn-mini {
  display: inline-block;
  padding: 0.5em 0.8em;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: bold;
  white-space: nowrap;
  color: var(--font-color-2);
  background-color: var(--bcg-fourth-color);
}

.btn-mini-danger {
  background-color: var(--bcg-color-alerte);
}


/* CATEGORIE LIST ADMIN */

#categorie-liste-admin > .btn {
  align-self: flex-start;
  margin-bottom: 2em;
}

#categorie-liste-admin > ul {
  width: 100%;
  background-color: var(--bcg-first-color);
  padding: 2em;
  gap: 0.75em;
  display: flex;
  flex-direction: column;
}

#categorie-liste-admin > ul > li {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 1em;
  font-size: 1.1rem;
  font-weight: 700;
  background-color: var(--bcg-fourth-color);
  color: var(--font-color-2);
    flex-wrap: wrap;

}


/* Le 1er bouton pousse les deux boutons à droite */
#categorie-liste-admin > ul > li > .btn:first-of-type {
  margin-left: auto;
}

#categorie-liste-admin > ul .btn {
  padding: 0.5em 0.9em;
  font-size: 1rem;
}


/* UTILISATEUR LIST ADMIN */

#utilisateur-liste-admin > ul {
  width: 100%;
  background-color: var(--bcg-first-color);
  padding: 2em;
  gap: 1em;
  display: flex;
  flex-direction: column;
}

#utilisateur-liste-admin > ul > li {
  background-color: var(--bcg-fourth-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1em;
  padding: 1em 1.5em;
  font-size: 1rem;
  font-weight: 600;
  transition: 0.2s;
  color: var(--font-color-2);
}


#utilisateur-liste-admin > ul .btn {
  padding: 0.5em 0.9em;
  font-size: 1rem;
  white-space: nowrap;
}

#utilisateur-liste-admin > ul > li > div {
  display: flex;
  flex-direction: row;
  gap: 1em;
  flex-wrap: wrap;
}

#utilisateur-liste-admin > ul > li > div {
  margin-left: auto;
}


/* ACHATS LIST ADMIN */

.achats-filtres {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5em;
  align-items: end;
  padding: 1.5em;
  background-color: var(--bcg-first-color);
}

.achats-champ {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.achats-champ label {
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.achats-champ select,
.achats-champ input {
  width: 100%;
  padding: 0.7em;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--font-color-2);
  background-color: rgba(255, 255, 255, 0.05);
  border: 3px solid var(--box-border-1);
  border-radius: 0;
}

.achats-champ select:focus,
.achats-champ input:focus {
  outline: none;
}

.achats-filtres-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.achats-filtres-actions .btn {
  display: inline-block;
  font-family: inherit;
  cursor: url("../img/pointer.png") 16 16, pointer;
}

.achats-note {
  align-self: flex-start;
  margin: 1em 0 2em;
  font-size: 0.9rem;
  opacity: 0.75;
}

.achats-vide {
  width: 100%;
  padding: 2em;
  text-align: center;
  font-weight: 700;
  background-color: var(--bcg-first-color);
}

.table-achats-wrapper {
  width: 100%;
  overflow-x: auto;
  background-color: var(--bcg-first-color);
}

.table-achats {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.table-achats th {
  padding: 1em;
  text-align: left;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--font-color-2);
  background-color: var(--bcg-fourth-color);
  border-bottom: 4px solid var(--box-border-1);
}

.table-achats td {
  padding: 0.8em 1em;
  vertical-align: middle;
  font-weight: 600;
  border-bottom: 3px dashed var(--box-border-1);
}

.table-achats tbody tr:last-child td {
  border-bottom: none;
}

.table-achats tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

.table-achats tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.table-achats .btn {
  padding: 0.4em 0.8em;
  font-size: 0.85rem;
  white-space: nowrap;
}

.compte-supprime {
  font-style: italic;
  opacity: 0.7;
}

.achats-total {
  align-self: flex-end;
  margin-top: 2em;
  padding: 1em 1.5em;
  font-size: 1.1rem;
  background-color: var(--bcg-first-color);
}

@media (max-width: 600px) {
  #achats-liste-admin {
    width: 95%;
  }

  .achats-filtres {
    padding: 1em;
  }

  .achats-filtres-actions .btn {
    flex: 1;
    text-align: center;
  }

  .achats-total {
    align-self: stretch;
    text-align: center;
  }
}


/* ERREUR PAGE */
#erreur-page > p {
  margin-top: 2em;
  text-align: center;
}
