/* ===== BASE ===== */

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

section {
  display: flex;
  flex-direction: column; /* vertical */
  align-items: center;    /* centre horizontalement */
  margin-bottom: 2em;
}

/* ===== HEADER ===== */

#top {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;          /* important */
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  box-sizing: border-box;
  z-index: 1000; /* assure que #top est au-dessus de tout */
}

#top_left,
#top_middle,
#top_right {
  padding: 0.5em;
  box-sizing: border-box;
}

#top_middle { text-align: left; font-size: 0.8em; }
#top_right  { text-align: right; }
#top_left   { flex: 4; }
#top_middle { flex: 3; }
#top_right  { flex: 3; }

/* ===== FOOTER ===== */

.footer {
  width: 100%;
  background : linear-gradient(90deg, #f2f2f2, #fff);
  color: #fff;
  
  display: flex;              /* flex horizontal */
  justify-content: center;    /* centré horizontalement */
  align-items: center;        /* centré verticalement */
  gap: 1em;                   /* espace entre les éléments */
  
  padding: 0.8em 1em;
  box-sizing: border-box;
  flex-wrap: nowrap;          /* empêche l’empilement */
}

.footer a.links,
.footer span {
  display: inline-flex;       /* tous les enfants sur la même ligne */
  align-items: center;        /* aligne verticalement image et texte */
  color: #000000;
  text-decoration: none;
  font-weight: bold;
}

.footer a.links:hover {
  color: #DB5FE1;
}

.footer img {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.2em;        /* petit espace après l'image si nécessaire */
}

@media (max-width: 480px) {
  .footer {
    flex-direction: column; /* empile les éléments sur mobile */
    gap: 0.5em;
  }
}

/* ===== BURGER ===== */

.burger {
  display: none;
  position: fixed;
  top: 4.5em;
  width: 100%;
  background: linear-gradient(90deg, #2a9d8f, #22427c);
  color: #fff;
  font-size: 1.6em;
  padding: 0.5em;
  cursor: pointer;
  z-index: 999;
}

/* ===== NAV ===== */

nav {
  position: fixed;
  top: 4.5em;
  width: 100%;
  background: linear-gradient(90deg,  #2a9d8f, #22427c);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

nav li {
  position: relative;
}

nav a {
  display: block;
  padding: 1em;
  color: #fff;
  text-decoration: none;
}

nav li:hover > a {
  background: #e8eaea;
  color: #000;
}

/* Sous-menus desktop */
.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 12em;
}

.sub-menu a {
  color: #353C8A;
}

nav li:hover .sub-menu {
  display: block;
}

/* ===== CONTENU ===== */

main {
  margin-top: 8em;
  display: flex;
  gap: 1em;
}
section {
  margin: 0;
  padding: 0;
}

#corps_left {
  flex: 1;
  padding: 1em;
}

#corps_right {
  width: 220px;
  padding: 1em;
  background: #f2f2f2;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {

  .burger {
    display: block;
  }

  nav {
    top: 10.5em;
  }

  nav ul {
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  nav.active ul {
    max-height: 100vh;
  }

  nav li:hover .sub-menu {
    display: none;
  }

  nav li.open > .sub-menu {
    display: block;
    position: relative;
  }

  main {
    flex-direction: column;
	margin-top: 11em;
  }

  #corps_right {
    width: 100%;
  }
}

/* ===== IMAGES ===== */

.img_top{
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 0.5em; 
}
.img_fdb{
	display: block;
	max-width: 25%;
	height: auto;
}
video{
	display: block;
	max-width: 100%;
	height: auto;
}
@media (max-width: 480px) {
.img_top {	border-radius: 3px; }

}
/* ===== LIENS ===== */

A.links{color: #353C8A; text-decoration: none; font-weight: bold; font-size: 0.9em;}
A.links:hover {color: #DB5FE1; text-decoration: none; font-weight: bold; font-size: 0.9em;}
A.polymeca{color: #353C8A; text-decoration: none; font-weight: bold; font-size: 0.9em;}
A.polymeca:hover {color: #DB5FE1; text-decoration: none; font-weight: bold; font-size: 0.9em;}
A.mailpoly {color: #353C8A; text-decoration: none; font-weight: bold;}
A.mailpoly:hover {color: #DB5FE1; text-decoration: none; font-weight: bold;}
A.navpge {color: #000000; text-decoration: none; font-weight: bold; font-size: 0.9em;}
A.navpge:hover {color: #000000; text-decoration: none; font-weight: bold; font-size: 0.9em;}
A.retour {color: #FFFFFF; text-decoration: none; font-weight: bold; font-size: 0.9em;}
A.retour:hover {color: #000000; text-decoration: none; font-weight: bold; font-size: 0.9em;}

/* ===== BOUTONS ===== */

#triangle {
	position: absolute;
	margin: 0.2em;
    width: 0;
    height: 0;
    border-top: 0.8em solid white;
    border-bottom: 0.3em solid transparent;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5em;
  margin: 1em 0;
  flex-wrap: wrap; /* permet aux boutons de revenir à la ligne si écran étroit */
}


.rondr, .rondv {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 2px grey;
}

.rondr {
  background: radial-gradient(#fff, #FF0000);
  border: 1px solid #FF0000;
  color: #FF0000;
}

.rondv {
  background: radial-gradient(#fff, #01DF01);
  border: 1px solid #01DF01;
  color: #01DF01;
}

.rondv:hover {
  background: radial-gradient(#01DF01, #fff);
  color: #fff;
}

/* ===== TEXTE ===== */

h1 {
  border: 1px solid #000080;
  border-radius: 5px 5px 0 5px;
  background: linear-gradient(90deg, #2a9d8f, #22427c);
  width: 100%;
  color: #fff;
  font-size: 1.2em;
  text-align: center;
  padding: 0.4em 0;
  margin: 0 0 0.1em 0;  /* petit espace sous H1 */
  line-height: 1.2em;
}

h2 {
  border: 1px solid #22427c;
  border-radius: 5px 5px 0 5px;
  width: 100%;
  font-size: 1em;
  text-align: center;
  padding: 0.3em 0;
  margin: 0 0 0.2em 0;  /* espace sous H2 (ajustable) */
  line-height: 1.2em;
}

figure {
	max-width: 95%;
	margin: 0 auto;
	min-width: 0;
	margin: 0 0 1em 0;  /* espace sous H2 (ajustable) */
}
figcaption	{
	font-size: 1em;
	text-align: center;
}
#texte_report {
  width: 100%;
  margin-top: 1em;
  text-align: center;
  clear: both; /* force le texte à apparaître sous les éléments flottants ou flex */
}
/* ===== DOCUMENTS ===== */

.docs-grid {
	display: grid;
	/* auto-fit permet de remplir toutes les colonnes possibles selon la largeur */
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1.5rem;
	max-width: 1200px;  /* limite la largeur totale sur desktop */
	margin: 2rem auto;
	padding: 0 1rem;
}

.doc {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 0.75rem;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
}

.doc img {
	/*width: 100%;*/
	max-width: 100%;  /* limite la taille de l'image */
	height: auto;
	margin-bottom: 0.5rem;
}

.doc span {
	font-size: 0.9rem;
	line-height: 1.3;
	word-break: break-word;
}
@media (max-width: 480px) {
	.docs-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ===== TABLEAUX ===== */

TABLE {
	width: 95%;
	margin: 0 auto;
}
.titre {border:1px solid #000080; border-radius: 5px 5px 0 5px; background-color: #22427c; width: 95%; color: #FFFFFF;}
.tblgood {
	border-collapse: separate;
	border-spacing: 0.2em;
}
.tblgood col{
	width: 16%;
	height: auto;
}

TABLE.listref {border: 1px solid #22427c; width: 95%; align: center;}
TR.titlelistref {border: 1px solid #22427c; background-color: #22427c; height: 2em; }
TD.titlelistref {color: #FFFFFF; text-decoration: none; font-weight: bold; font-size: 1em; }	
TD.listeref {font-size: 1em; color: #FFFFFF; font-weight: bold;}
.listrefPg {height: 2em;}
.navpge{width: 95%;}
.copyright{font-size: 0.9em; font-weight: bold; align: center;}

/* ===== POLYMECA ===== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
}

.product-card img {
  width: 100%;
  max-width: 70px;
  height: auto;
  margin-bottom: 0.5rem;
}

.product-info a {
  display: block;
  font-size: 0.8rem;
  color: inherit;
  text-decoration: none;
  word-break: break-word;
}
.product-info a:hover {
  font-size: 0.8rem;

}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.product-detail {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-title {
    text-align: center;
    background-color: #000;
    color: #fff;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-radius: 4px;
}

.product-main {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.product-image {
    flex: 1 1 300px;
    text-align: center;
}

.product-image img {
    width: 100%;
    max-width: 450px;
    height: auto;
    border: 1px solid #E9E9E9;
    border-radius: 4px;
}

.product-info {
    flex: 1 1 300px;
}

.product-name {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.product-price {
    margin-bottom: 1rem;
}

.product-order input[type="number"] {
    width: 50px;
    margin: 0 0.5rem;
}

.product-order button {
    padding: 0.4rem 0.8rem;
    cursor: pointer;
}

.retour {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #ddd;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
}

.retour:hover {
    background-color: #ccc;
}

/* Mobile */
@media (max-width: 768px) {
    .product-main {
        flex-direction: column;
        align-items: center;
    }

    .product-info {
        text-align: center;
    }
}

/* ===== PANIER ===== */

/* ===== PANIER ===== */

.panier-link {
  display: flex;
  justify-content: center;
  align-items: center;
}

.panier-icon {
  position: relative;
  display: inline-block;
  width: 24px;      /* 🔒 verrouillage */
  height: 24px;
}

.panier-icon img.img_panier {
  width: 24px !important;   /* 🔥 écrase IMG { max-width:100% } */
  height: 24px !important;
  max-width: none;          /* IMPORTANT */
  display: block;
}

/* Badge rond */
.panier-badge {
  position: absolute;
  top: -5px;
  right: -6px;

  width: 18px;
  height: 18px;

  background-color: #e63946;
  color: #fff;
  font-size: 0.75em;
  font-weight: bold;

  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  pointer-events: none;
}
/*.panier-icon {
  position: relative;     /* 🔥 le badge s’accroche ici 
  display: inline-block;
}*/

@media (max-width: 768px) {
  .panier-icon {
    width: 28px;
    height: 28px;
  }

  .panier-icon img.img_panier {
    width: 28px !important;
    height: 28px !important;
  }

  .panier-badge {
    top: -6px;
    right: -8px;
  }
}
/* ======= VISU PANIER ======== */

/* ===== Formulaire coordonnées ===== */
.form-coord {
  max-width: 600px;
  margin: 1em auto;
  padding: 1em;
  border: 1px solid #22427c;
  border-radius: 5px;
  background: #f4f4f4;
}

.form-coord legend {
  font-weight: bold;
  color: #22427c;
  padding: 0 0.5em;
}

.form-coord .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 0.7em;
}

.form-coord label {
  width: 100%;
  font-size: 0.9em;
  margin-bottom: 0.2em;
}

.form-coord input, 
.form-coord select, 
.form-coord textarea, 
.form-coord button {
  flex: 1 1 auto;
  padding: 0.4em;
  font-size: 0.9em;
  box-sizing: border-box;
}

.form-coord button {
  background-color: #22427c;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.form-coord button:hover {
  background-color: #2a9d8f;
}

/* ===== Panier responsive ===== */
/* ===== Panier responsive corrigé ===== */
.listref-container {
  width: 100%;
  overflow-x: auto; /* permet le scroll horizontal sur mobile */
}

.listref {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  table-layout: fixed; /* important pour éviter que le tableau s'étire trop */
}

.listref th, .listref td {
  border: 1px solid #22427c;
  padding: 0.3em;
  font-size: 0.9em;
  text-align: center;
  word-wrap: break-word; /* casse le texte trop long */
}

.listref th {
  background: #22427c;
  color: #fff;
}

.listref td.listrefP {
  text-align: left;
}

.listref input[type="number"] {
  width: 60px;
  padding: 0.2em;
  text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .listref input[type="number"] {
    width: 50px;
  }
}

/* ===== Message confirmation ===== */
.message-confirmation {
  font-size: 1em;
  color: #2a9d8f;
  font-weight: bold;
  margin: 1em auto;
  text-align: center;
}

/* ===== Panier badge (icône dans menu) ===== */
.panier-link {
  display: flex;
  justify-content: center;
  align-items: center;
}

.panier-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
}

.panier-icon img.img_top {
  width: 24px !important;
  height: 24px !important;
  max-width: none;
  display: block;
}

.panier-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  width: 18px;
  height: 18px;
  background-color: #e63946;
  color: #fff;
  font-size: 0.75em;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ===== Media Queries ===== */
@media (max-width: 768px) {
  .form-coord .form-row {
    flex-direction: column;
  }

  .listref th, .listref td {
    font-size: 0.8em;
    padding: 0.2em;
  }

  .listref input[type="number"] {
    width: 50px;
  }

  .panier-icon {
    width: 28px;
    height: 28px;
  }

  .panier-icon img.img_top {
    width: 28px !important;
    height: 28px !important;
  }

  .panier-badge {
    top: -6px;
    right: -8px;
  }
}

@media (max-width: 480px) {
  body { font-size: 0.95em; }
}
