/* Page produit (woocommerce/single-product.php) */

.cg-produit, .cg-barre {
  --cg-vert: #2f8249;
  --cg-vert-fonce: #246639;
  --cg-nuit: #08062f;
  --cg-gris: #5b6472;
  --cg-fond: #f3f5f8;
  --cg-trait: #dfe3e9;
}

.cg-conteneur {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* barre fil d'Ariane + recherche */
.cg-barre {
  background: var(--cg-fond);
  border-top: 1px solid var(--cg-trait);
  border-bottom: 1px solid var(--cg-trait);
}
.cg-barre-interieur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.cg-ariane {
  font-size: 14px;
  color: var(--cg-gris);
}
.cg-ariane a { color: var(--cg-gris); }
.cg-ariane a:hover { color: var(--cg-vert); }
.cg-ariane span { margin: 0 6px; }
.cg-ariane .cg-ariane-courant { margin: 0; color: var(--cg-nuit); font-weight: 600; }

.cg-recherche {
  display: flex;
  width: 320px;
  max-width: 100%;
}
.cg-recherche input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--cg-trait);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
  background: #fff;
}
.cg-recherche button {
  width: 44px;
  height: 40px;
  border: 0;
  border-radius: 0 4px 4px 0;
  background: var(--cg-vert);
  color: #fff;
}

/* haut de page : photo + infos */
.cg-produit { color: var(--cg-nuit); padding-bottom: 40px; }
.cg-haut {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  padding: 40px 0;
  align-items: start;
}
.cg-photo {
  background: var(--cg-fond);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 12px;
}
.cg-photo img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply; /* fond blanc de la photo fondu dans le gris */
}
.cg-photo-absente { color: var(--cg-gris); }

.cg-pastille {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--cg-vert);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cg-titre {
  margin: 14px 0 6px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--cg-nuit);
}
.cg-titre-dim {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
  color: var(--cg-vert);
}
.cg-ref { margin: 0 0 22px; color: var(--cg-gris); font-size: 15px; }
.cg-presentation { margin: -8px 0 22px; font-size: 16px; line-height: 1.65; color: #3d4452; }
.cg-ref strong { color: var(--cg-nuit); }
/* « Fabriqué dans notre usine » : produits de l'usine Congost seulement (12/10/2026) */
.cg-fabrique { display: inline-flex; align-items: center; gap: 8px; margin: -12px 0 22px; padding: 6px 12px; border-radius: 20px; background: #edf6ef; color: var(--cg-vert); font-size: 14px; font-weight: 700; }

.cg-cles {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cg-cles li {
  border: 1px solid var(--cg-trait);
  border-radius: 6px;
  padding: 12px 14px;
}
.cg-cle-libelle {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cg-gris);
}
.cg-cle-valeur { display: block; margin-top: 2px; font-size: 16px; font-weight: 700; }
.cg-couleurs { margin: 0 0 22px; display: flex; align-items: center; gap: 10px; }
.cg-couleurs .cg-cle-libelle { display: inline; }

/* bloc devis : bouton YITH restylé */
.cg-devis {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}
.cg-devis-bouton .yith-ywraq-add-to-quote,
.cg-devis-bouton .yith-ywraq-add-button {
  display: flex !important;
  align-items: stretch;
  gap: 8px;
}
.cg-devis-bouton .raq-input-qty {
  width: 72px;
  height: 52px;
  border: 1px solid var(--cg-trait);
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
}
.cg-devis-bouton .yith-ywraq-add-button a,
.cg-devis-bouton .yith_ywraq_add_item_browse_message a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  border-radius: 6px;
  background: var(--cg-vert);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.cg-devis-bouton .yith-ywraq-add-button a:hover { background: var(--cg-vert-fonce); }
.cg-devis-bouton .yith-ywraq-add-button a::after { content: "Ajouter à ma demande de devis"; }
.cg-devis-bouton .yith_ywraq_add_item_browse_message a::after { content: "Voir ma demande de devis"; }
.cg-devis-bouton .ajax-loading { display: none; }
.cg-appel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px;
  border: 2px solid var(--cg-nuit);
  border-radius: 6px;
  color: var(--cg-nuit);
  font-weight: 700;
  white-space: nowrap;
}
.cg-appel:hover { background: var(--cg-nuit); color: #fff; text-decoration: none; }
.cg-devis-aide { margin: 10px 0 20px; font-size: 13px; color: var(--cg-gris); }

.cg-fiche {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--cg-trait);
  border-radius: 6px;
  color: var(--cg-nuit);
  margin-bottom: 20px;
}
.cg-fiche i { font-size: 26px; color: #c0392b; }
.cg-fiche span { font-weight: 700; }
.cg-fiche small { display: block; font-weight: 400; color: var(--cg-gris); }
.cg-fiche:hover { border-color: var(--cg-vert); text-decoration: none; color: var(--cg-nuit); }


/* sections */
.cg-section { padding: 32px 0 0; border-top: 1px solid var(--cg-trait); }
.cg-section h2 { font-size: 22px; font-weight: 700; margin: 0 0 18px; color: var(--cg-nuit); }
.cg-tableau {
  width: 100%;
  max-width: 760px;
  border-collapse: collapse;
  font-size: 15px;
}
.cg-tableau th, .cg-tableau td { padding: 11px 14px; border-bottom: 1px solid var(--cg-trait); vertical-align: top; }
.cg-tableau th { width: 40%; font-weight: 600; color: var(--cg-gris); }
.cg-tableau tr:nth-child(odd) { background: var(--cg-fond); }
.cg-gamme { margin-top: 32px; max-width: 100%; overflow-x: auto; }

/* page produit équilibrée (validée par Sophie le 09/10/2026) : caractéristiques sous la photo, cadre photo fixe */
.cg-haut-v2 {
  grid-template-areas: "photo infos" "tech infos";
  grid-template-rows: auto 1fr;
  row-gap: 32px;
  align-items: start;
}
.cg-haut-v2 .cg-photo { grid-area: photo; position: relative; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; }   /* cadre photo de même taille pour tous les produits */
.cg-haut-v2 .cg-photo img { position: absolute; top: 20px; left: 20px; width: calc(100% - 40px); height: calc(100% - 40px); object-fit: contain; }
.cg-haut-v2 .cg-infos { grid-area: infos; }
.cg-haut-v2 .cg-tech { grid-area: tech; }
.cg-tech h2 { font-size: 20px; font-weight: 700; margin: 0 0 14px; color: var(--cg-nuit); }
.cg-tech .cg-tableau { max-width: none; }
.cg-produit { overflow-x: hidden; }

.cg-barre-mobile { display: none; }

/* tablette et mobile */
@media (max-width: 991px) {
  .cg-haut { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 0; }
  .cg-haut-v2 { grid-template-areas: "photo" "infos" "tech"; grid-template-rows: auto; }
  .cg-recherche { width: 100%; }
}
@media (max-width: 575px) {
  .cg-conteneur { padding: 0 16px; }
  .cg-titre { font-size: 24px; }
  .cg-titre-dim { font-size: 18px; }
  .cg-photo { padding: 8px; min-height: 0; }
  .cg-devis, .cg-devis-bouton, .cg-devis-bouton .yith-ywraq-add-button { width: 100%; }
  .cg-devis-bouton .yith-ywraq-add-button a { flex: 1; justify-content: center; padding: 0 12px; white-space: normal; text-align: center; }
  .cg-appel { width: 100%; justify-content: center; }
  .cg-tableau th { width: 45%; }
  .cg-gamme { overflow-x: auto; }
  .cg-produit { padding-bottom: 90px; }
  body:has(.cg-barre-mobile) .cg-pied { padding-bottom: 72px; }   /* le pied de page reste lisible au-dessus de la barre fixe */
  .cg-barre-mobile {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,.12);
  }
  .cg-barre-mobile-devis {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    height: 48px;
    border-radius: 6px;
    background: var(--cg-vert);
    color: #fff !important;
    font-weight: 700;
  }
  .cg-barre-mobile-appel {
    width: 56px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--cg-nuit);
    border-radius: 6px;
    color: var(--cg-nuit);
    font-size: 18px;
  }
}
