/*
 * Sagrinex — Description Styler
 * CSS puissant pour les descriptions produit WooCommerce (FR & DE)
 * Cible : .sgx-short-desc  /  .sgx-long-desc
 * Fallback natif WooCommerce inclus.
 * ──────────────────────────────────────────────────────────────────
 */

/* ═══════════════════════════════════════════════════════════════════
   VARIABLES — modifier ici pour changer l'apparence globale
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --sgx-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --sgx-color:       #2c2c2c;
  --sgx-muted:       #666;
  --sgx-heading:     #1a1a1a;
  --sgx-accent:      #2e7d32;   /* vert Sagrinex — changez selon votre charte */
  --sgx-border:      #e0e0e0;
  --sgx-table-head:  #f5f5f5;
  --sgx-table-even:  #fafafa;
  --sgx-table-hover: #f0f7ff;
  --sgx-code-bg:     #f4f4f4;
  --sgx-code-color:  #c7254e;
  --sgx-quote-left:  #2e7d32;
  --sgx-radius:      6px;
  --sgx-line-height: 1.75;
  --sgx-font-size:   15px;
}

/* ═══════════════════════════════════════════════════════════════════
   BASE — appliqué aux deux wrappers
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc,
.sgx-long-desc,
.woocommerce-product-details__short-description,
.woocommerce-Tabs-panel--description {
  font-family:    var(--sgx-font);
  font-size:      var(--sgx-font-size);
  line-height:    var(--sgx-line-height);
  color:          var(--sgx-color);
  max-width:      100%;
  word-break:     break-word;
  overflow-wrap:  break-word;
}

/* ═══════════════════════════════════════════════════════════════════
   TYPOGRAPHIE — Paragraphes
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc p,
.sgx-long-desc p,
.woocommerce-product-details__short-description p,
.woocommerce-Tabs-panel--description p {
  margin: 0 0 1em 0;
  color: var(--sgx-color);
}

.sgx-short-desc p:last-child,
.sgx-long-desc p:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   TITRES — h1 à h6
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc h1, .sgx-long-desc h1,
.woocommerce-Tabs-panel--description h1 { font-size: 1.8em;  }
.sgx-short-desc h2, .sgx-long-desc h2,
.woocommerce-Tabs-panel--description h2 { font-size: 1.5em;  }
.sgx-short-desc h3, .sgx-long-desc h3,
.woocommerce-Tabs-panel--description h3 { font-size: 1.25em; }
.sgx-short-desc h4, .sgx-long-desc h4,
.woocommerce-Tabs-panel--description h4 { font-size: 1.1em;  }
.sgx-short-desc h5, .sgx-long-desc h5,
.woocommerce-Tabs-panel--description h5 { font-size: 1em;    }
.sgx-short-desc h6, .sgx-long-desc h6,
.woocommerce-Tabs-panel--description h6 { font-size: 0.9em; color: var(--sgx-muted); }

.sgx-short-desc h1,.sgx-short-desc h2,.sgx-short-desc h3,
.sgx-short-desc h4,.sgx-short-desc h5,.sgx-short-desc h6,
.sgx-long-desc h1,.sgx-long-desc h2,.sgx-long-desc h3,
.sgx-long-desc h4,.sgx-long-desc h5,.sgx-long-desc h6,
.woocommerce-Tabs-panel--description h1,
.woocommerce-Tabs-panel--description h2,
.woocommerce-Tabs-panel--description h3 {
  font-family:   var(--sgx-font);
  font-weight:   700;
  color:         var(--sgx-heading);
  line-height:   1.3;
  margin-top:    1.4em;
  margin-bottom: 0.5em;
}

/* Trait sous les h2 — souligne visuellement les sections */
.sgx-long-desc h2,
.woocommerce-Tabs-panel--description h2 {
  border-bottom: 2px solid var(--sgx-accent);
  padding-bottom: 0.25em;
}

/* ═══════════════════════════════════════════════════════════════════
   LISTES — ul / ol / li
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc ul,
.sgx-short-desc ol,
.sgx-long-desc ul,
.sgx-long-desc ol,
.woocommerce-product-details__short-description ul,
.woocommerce-product-details__short-description ol,
.woocommerce-Tabs-panel--description ul,
.woocommerce-Tabs-panel--description ol {
  margin:        0 0 1.1em 0;
  padding-left:  1.8em;
  color:         var(--sgx-color);
}

.sgx-short-desc ul,
.sgx-long-desc ul,
.woocommerce-product-details__short-description ul,
.woocommerce-Tabs-panel--description ul {
  list-style-type: disc;
}

.sgx-short-desc ol,
.sgx-long-desc ol,
.woocommerce-Tabs-panel--description ol {
  list-style-type: decimal;
}

.sgx-short-desc li,
.sgx-long-desc li,
.woocommerce-product-details__short-description li,
.woocommerce-Tabs-panel--description li {
  margin-bottom: 0.4em;
  line-height:   var(--sgx-line-height);
}

/* Puce personnalisée (✓ vert) pour les listes à puces de la description longue */
.sgx-long-desc ul > li,
.woocommerce-Tabs-panel--description ul > li {
  list-style: none;
  position:   relative;
  padding-left: 0.2em;
}
.sgx-long-desc ul > li::before,
.woocommerce-Tabs-panel--description ul > li::before {
  content:     '✓';
  color:       var(--sgx-accent);
  font-weight: 700;
  position:    absolute;
  left:        -1.4em;
}

/* Sous-listes : puce simple */
.sgx-long-desc ul ul > li::before,
.woocommerce-Tabs-panel--description ul ul > li::before {
  content: '–';
  color:   var(--sgx-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   TABLEAUX — table, th, td, tr
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc table,
.sgx-long-desc table,
.woocommerce-Tabs-panel--description table {
  width:           100%;
  border-collapse: collapse;
  margin:          0 0 1.2em 0;
  font-size:       0.93em;
  border-radius:   var(--sgx-radius);
  overflow:        hidden;   /* pour que le border-radius fonctionne */
  box-shadow:      0 1px 4px rgba(0,0,0,.08);
}

.sgx-short-desc th,
.sgx-long-desc th,
.woocommerce-Tabs-panel--description th {
  background:    var(--sgx-table-head);
  color:         var(--sgx-heading);
  font-weight:   700;
  text-align:    left;
  padding:       10px 14px;
  border:        1px solid var(--sgx-border);
  border-bottom: 2px solid var(--sgx-accent);
  font-size:     0.9em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sgx-short-desc td,
.sgx-long-desc td,
.woocommerce-Tabs-panel--description td {
  padding:       9px 14px;
  border:        1px solid var(--sgx-border);
  color:         var(--sgx-color);
  vertical-align: top;
  line-height:   1.5;
}

/* Lignes alternées */
.sgx-short-desc tr:nth-child(even) td,
.sgx-long-desc tr:nth-child(even) td,
.woocommerce-Tabs-panel--description tr:nth-child(even) td {
  background: var(--sgx-table-even);
}

/* Survol de ligne */
.sgx-short-desc tbody tr:hover td,
.sgx-long-desc tbody tr:hover td,
.woocommerce-Tabs-panel--description tbody tr:hover td {
  background: var(--sgx-table-hover);
  transition: background .15s ease;
}

/* Tableaux responsives sur mobile */
@media (max-width: 640px) {
  .sgx-short-desc table,
  .sgx-long-desc table,
  .woocommerce-Tabs-panel--description table {
    display:    block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   EMPHASE — strong, em, u, s
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc strong,
.sgx-long-desc strong,
.woocommerce-product-details__short-description strong,
.woocommerce-Tabs-panel--description strong {
  font-weight: 700;
  color: var(--sgx-heading);
}

.sgx-short-desc em,
.sgx-long-desc em,
.woocommerce-Tabs-panel--description em {
  font-style: italic;
  color: var(--sgx-muted);
}

.sgx-short-desc u, .sgx-long-desc u { text-decoration: underline; }

.sgx-short-desc s, .sgx-long-desc s,
.sgx-short-desc del, .sgx-long-desc del {
  text-decoration: line-through;
  color: var(--sgx-muted);
  opacity: .75;
}

/* ═══════════════════════════════════════════════════════════════════
   LIENS
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc a,
.sgx-long-desc a,
.woocommerce-Tabs-panel--description a {
  color:           var(--sgx-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition:      color .15s, opacity .15s;
}
.sgx-short-desc a:hover,
.sgx-long-desc a:hover {
  opacity: .75;
}

/* ═══════════════════════════════════════════════════════════════════
   IMAGES
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc img,
.sgx-long-desc img,
.woocommerce-Tabs-panel--description img {
  max-width:    100%;
  height:       auto;
  display:      block;
  margin:       0.75em auto;
  border-radius: var(--sgx-radius);
  box-shadow:   0 2px 8px rgba(0,0,0,.12);
}

.sgx-long-desc figure,
.woocommerce-Tabs-panel--description figure {
  margin: 0 0 1.2em 0;
  text-align: center;
}
.sgx-long-desc figcaption,
.woocommerce-Tabs-panel--description figcaption {
  font-size: 0.8em;
  color: var(--sgx-muted);
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════════
   CITATION
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc blockquote,
.sgx-long-desc blockquote,
.woocommerce-Tabs-panel--description blockquote {
  border-left:  4px solid var(--sgx-accent);
  margin:       0 0 1.2em 0;
  padding:      10px 18px;
  background:   #f9fef9;
  color:        var(--sgx-muted);
  font-style:   italic;
  border-radius: 0 var(--sgx-radius) var(--sgx-radius) 0;
}

/* ═══════════════════════════════════════════════════════════════════
   CODE / PRE
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc code,
.sgx-long-desc code,
.woocommerce-Tabs-panel--description code {
  background:    var(--sgx-code-bg);
  color:         var(--sgx-code-color);
  padding:       2px 6px;
  border-radius: 4px;
  font-family:   'Consolas', 'Fira Code', 'Courier New', monospace;
  font-size:     0.88em;
}

.sgx-long-desc pre,
.woocommerce-Tabs-panel--description pre {
  background:   var(--sgx-code-bg);
  color:        #333;
  padding:      14px 18px;
  border-radius: var(--sgx-radius);
  overflow-x:   auto;
  font-size:    0.85em;
  line-height:  1.5;
  margin-bottom: 1.2em;
}
.sgx-long-desc pre code { background: none; padding: 0; color: inherit; }

/* ═══════════════════════════════════════════════════════════════════
   SÉPARATEUR
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc hr,
.sgx-long-desc hr,
.woocommerce-Tabs-panel--description hr {
  border:     none;
  border-top: 2px solid var(--sgx-border);
  margin:     1.8em 0;
}

/* ═══════════════════════════════════════════════════════════════════
   DIVERS — mark, abbr, sub, sup, small
   ═══════════════════════════════════════════════════════════════════ */
.sgx-long-desc mark { background: #fff176; color: #333; padding: 0 3px; border-radius: 3px; }
.sgx-long-desc abbr[title] { text-decoration: underline dotted; cursor: help; }
.sgx-long-desc sub { font-size: 0.75em; vertical-align: sub; }
.sgx-long-desc sup { font-size: 0.75em; vertical-align: super; }
.sgx-long-desc small { font-size: 0.85em; color: var(--sgx-muted); }

/* ═══════════════════════════════════════════════════════════════════
   BOÎTES D'INFO (si quelqu'un utilise des classes WP comme .wp-block-*)
   ═══════════════════════════════════════════════════════════════════ */
.sgx-long-desc .wp-block-quote,
.woocommerce-Tabs-panel--description .wp-block-quote {
  border-left:  4px solid var(--sgx-accent);
  padding:      12px 20px;
  background:   #f9fef9;
  margin:       0 0 1.2em 0;
  border-radius: 0 var(--sgx-radius) var(--sgx-radius) 0;
}

.sgx-long-desc .wp-block-columns,
.woocommerce-Tabs-panel--description .wp-block-columns {
  display: flex;
  gap: 1.5em;
  flex-wrap: wrap;
  margin-bottom: 1.2em;
}
.sgx-long-desc .wp-block-column,
.woocommerce-Tabs-panel--description .wp-block-column {
  flex: 1 1 200px;
}

/* ═══════════════════════════════════════════════════════════════════
   SHORT DESCRIPTION — style spécifique (plus compact)
   ═══════════════════════════════════════════════════════════════════ */
.sgx-short-desc,
.woocommerce-product-details__short-description {
  font-size: 14.5px;
  color: #444;
  margin-bottom: 1.5em;
}

/* Puce ✓ désactivée dans la short desc (trop petite zone) */
.sgx-short-desc ul > li::before,
.woocommerce-product-details__short-description ul > li::before {
  content: '→';
  color:   var(--sgx-accent);
  font-weight: 700;
  position: absolute;
  left: -1.4em;
}

