*,
*::before,
*::after {
  box-sizing: border-box;
}

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

:root {
  --cat-gap: 6px;
}

body {
  font-family: Arial, sans-serif;
  margin: 20px;
  line-height: 1.4;
}

#app {
  margin-top: 12px;
}

.logo {
  height: 120px;
  width: auto;
  flex-shrink: 0;
  margin-bottom: 25px;
}

/* ======================
   GRILLE PRODUITS
====================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 260px);
  gap: 10px;
  justify-content: center;
  align-items: start;
}

/* mobile : une colonne */
@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

figure {
  margin: 0;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.thumb {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

figcaption {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: #f2f2f2;
  width: 100%;
  padding: 6px;
  margin: 0 0 6px 0;
  border-radius: 8px;

  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

/* ======================
   TEXTE / ÉTATS
====================== */

.muted {
  color: #666;
  font-size: 13px;
}

.missing {
  font-size: 12px;
  color: #c00;
  margin-top: 8px;
}

.stock {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ======================
   TAILLES
====================== */

.size {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.size select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 12px;
}

/* ======================
   PRIX
====================== */

.price {
  margin-top: auto;
  padding: 6px 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.price-label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
}

.price-amount {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-weight: 800;
  color: #333;
}

.price-amount .int {
  font-size: 26px;
}

.price-amount .dec {
  font-size: 13px;
  position: relative;
  top: 2px;
}

.price-amount .eur {
  font-size: 13px;
  font-weight: 700;
  color: #444;
  position: relative;
  top: 10px;
}

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

header.top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 25px;
}

/* ======================
   NAV / CATÉGORIES
====================== */

/* Conteneur des boutons (scroll horizontal) */
.catButtons {
  display: flex;
  gap: var(--cat-gap);
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 14px 0;
  width: 100%;

  border-top: 1px solid rgba(198, 160, 74, 0.25);
  border-bottom: 1px solid rgba(158, 124, 50, 0.45);
}

/* Bouton catégorie */
.catBtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 14px;
  min-height: 130px;

  background: transparent;
  border: none;
  border-radius: 0;

  cursor: pointer;
  flex: 0 0 auto;
}

/* Icône ronde */
.catBtn .catIcon {
  width: 72px;
  height: 72px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border-radius: 50%;

  background: #f6f6f6;
  border: 1.5px solid #c6a04a;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.70) inset,
    0 1px 2px rgba(255, 255, 255, 0.35),
    0 1px 4px rgba(158, 124, 50, 0.55);
}

.catBtn .catIcon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  background: #fff;
  border-radius: 50%;
  display: block;
}

.catBtn:hover .catIcon {
  border-color: #d4b05c;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.70) inset,
    0 2px 6px rgba(158, 124, 50, 0.75);
}

.catBtn span {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: #222;
  margin-top: 2px;
}

.catBtn.active .catIcon {
  border-color: #9e7c32;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.70) inset,
    0 2px 8px rgba(158, 124, 50, 0.9);
}

.catBtn.active span {
  color: #000;
}

/* Groupes de catégories (si utilisés) */
.catGroup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.catGroupTitle {
  font-size: 13px;
  font-weight: 800;
  color: #9e7c32;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.catGroupRow {
  display: flex;
  gap: 22px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

/* séparation visuelle entre groupes */
.catGroup+.catGroup {
  border-left: 1px solid rgba(158, 124, 50, 0.35);
  padding-left: 18px;
  margin-left: 18px;
}

/* ======================
   SELECT MOBILE
====================== */

.catSelect {
  display: none;
  width: 100%;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

/* ======================
   BANDEAU : boutons + nuancier
   (version finale : GRID)
====================== */

.nav-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  /* gauche = menu, droite = reste */
  align-items: center;
  column-gap: 16px;
  width: 100%;
}

/* Attention : #catButtons est l’ID du conteneur des boutons (dans ton HTML) */
#catButtons {
  width: auto !important;
  /* écrase un width:100% éventuel */
  min-width: 0;
}

/* nuancier centré dans la colonne droite */
.nuancier-mini {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;
}

.nuancier-mini>div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 420px;
}

.nuancier-mini img {
  width: 100%;
  max-width: 360px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.nuancier-mini p {
  font-size: 11px;
  color: #666;
  margin: 4px 0 0;
  line-height: 1.2;
}

/* ======================
   LIEN TITRE / MODAL
====================== */

.titleLink {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.titleLink:hover {
  text-decoration: underline;
  cursor: pointer;
}

/* ======================
   LOGOS SPÉCIFIQUES
====================== */

/* Cecil : logo rectangulaire => on évite le crop */
.catBtn[data-cat="cecil"] .catIcon img {
  object-fit: contain;
  padding: 10px;
  background: #fff;
  border-radius: 50%;
}

.catBtn[data-cat="motip"] .catIcon img {
  object-fit: contain;
  padding: 1px;
  background: #fff;
  border-radius: 50%;
}

/* Hammerite : logo complet visible */
.catBtn[data-cat="hammerite"] .catIcon img {
  object-fit: contain;
  padding: 1px;
  background: #fff;
}

/* ======================
   BADGE PDF
====================== */

.pdfTag {
  font-size: 9px;
  font-weight: 700;
  background: #e9ecef;
  color: #555;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

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

@media (max-width: 700px),
(pointer: coarse) {
  body {
    margin: 12px;
  }

  .logo {
    height: 70px;
  }

  .catButtons {
    display: none;
  }

  .catSelect {
    display: block;
  }

  /* Optionnel : images un peu plus grandes */
  .thumb {
    height: 120px;
  }

  .price-amount .int {
    font-size: 32px;
  }
}

/* ======================
   MODAL DESCRIPTIF
====================== */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.modal[aria-hidden="false"] {
  display: block;
}

.modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modalPanel {
  position: relative;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  margin: 6vh auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  padding: 18px 18px 16px;
}

.modalClose {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.modalTitle {
  font-weight: 700;
  font-size: 18px;
  padding-right: 34px;
}

.modalBody {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.modalBody ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.modalBody li {
  margin: 4px 0;
}

.subCatButtons {
  display: flex;
  justify-content: flex-start;
  width: min(var(--max), 100% - 32px);
  margin: 0 auto;
  padding: 10px 0 4px;
}

.subCatBtn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #c6a04a;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
}

.subCatBtn:hover {
  background: #f5f0e3;
}

.subCatBtn.active {
  background: #c6a04a;
  color: #fff;
}

.modalImage {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.modalImage img {
  width: auto;
  max-width: 420px;
  max-height: 38vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  background: #fff;
}