/* Fiche produit : chargée seulement sur ces pages, après pages.css. */

/* Pas d'ouverture plein écran : l'en-tête est plein, le bandeau de la famille dessous. */
body.nsa-page--produit .header { margin-bottom: 0; }
body.nsa-page--produit .heritage { padding-block: clamp(1rem, 2.5vw, 1.75rem); }

/* ---------- Haut de fiche ---------- */
body.nsa-page .fiche { padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3.5rem, 7vw, 5.5rem); }
body.nsa-page .fiche__grille { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }

/* Galerie : grande photo, vignettes dessous ; un clic agrandit (visionneuse des pages). */
body.nsa-page .fiche__galerie { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; align-self: start; }
body.nsa-page .fiche__photo { display: block; padding: 0; border: 1px solid var(--filet); background: linear-gradient(180deg, #fffefc, var(--fond-2)); cursor: zoom-in; overflow: hidden; }
body.nsa-page .fiche__photo img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform 900ms var(--ease-doux); }
body.nsa-page .fiche__photo--principale { grid-column: 1 / -1; aspect-ratio: 1 / 1; }
body.nsa-page .fiche__photo:not(.fiche__photo--principale) { aspect-ratio: 1 / 1; }
@media (hover: hover) { body.nsa-page .fiche__photo:hover img { transform: scale(1.04); } }
body.nsa-page .fiche__photo:focus-visible { outline: 2px solid var(--cuivre); outline-offset: 3px; }
body.nsa-page .fiche__galerie > .pastille { position: absolute; top: 1rem; left: 1rem; translate: none; z-index: 2; }
@media (min-width: 961px) { body.nsa-page .fiche__galerie { position: sticky; top: 110px; } }

/* Colonne d'achat */
body.nsa-page .fiche__fil { margin: 0 0 1rem; font-family: var(--sans); font-size: .6875rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--cuivre-texte); }
body.nsa-page .fiche__fil a { color: inherit; text-decoration: none; }
body.nsa-page .fiche__fil a:hover { text-decoration: underline; }
body.nsa-page .fiche__fil span[aria-hidden] { margin: 0 .4rem; opacity: .6; }
body.nsa-page .fiche__titre { margin: 0; font-family: var(--titre); font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 400; line-height: 1.12; color: var(--encre); text-wrap: balance; }
body.nsa-page .fiche__cepages { margin: .9rem 0 0; font-family: var(--sans); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-doux); }

/* Le résumé de WooCommerce et des greffons : le bloc d'achat juste après le
   prix, comme le voulait netsolution-mobile-ordre-achat.php. */
body.nsa-page .fiche__resume { display: flex; flex-direction: column; margin-top: 1.5rem; }
body.nsa-page .fiche__resume > * { order: 5; }
body.nsa-page .fiche__resume > .woocommerce-product-rating { order: 1; }
body.nsa-page .fiche__resume > .price { order: 2; }
body.nsa-page .fiche__resume > .wc-stripe-bnpl-product-message { order: 2; }
body.nsa-page .fiche__resume > form.cart,
body.nsa-page .fiche__resume > .nis-langues-non-livrees,
body.nsa-page .fiche__resume > .stock { order: 3; }
body.nsa-page .fiche__resume > .woocommerce-product-details__short-description { order: 4; }

body.nsa-page .fiche__resume .price { margin: 0; font-family: var(--sans); font-size: 1.625rem; font-weight: 600; letter-spacing: .04em; color: var(--encre); }
body.nsa-page .fiche__resume .price del { margin-right: .5rem; font-size: 1.125rem; font-weight: 500; opacity: .5; }
body.nsa-page .fiche__resume .price ins { text-decoration: none; color: var(--rouge); }
body.nsa-page .fiche__resume .stock { margin: .5rem 0 0; font-size: .875rem; }
body.nsa-page .fiche__resume .stock.out-of-stock { color: var(--rouge); }

/* Formulaire d'ajout au panier */
body.nsa-page .fiche__resume form.cart { display: flex; flex-wrap: wrap; align-items: stretch; gap: .75rem; margin: 1.5rem 0 1.75rem; padding: 1.25rem; border: 1px solid var(--filet); background: var(--blanc, #fffefc); }
body.nsa-page .fiche__resume form.cart .quantity { display: flex; }
body.nsa-page .fiche__resume form.cart .quantity input.qty { width: 5.5rem; min-height: 54px; padding: 0 .5rem; border: 1px solid #ddd2c6; border-radius: 0; background: #fffefc; font-family: var(--sans); font-size: 1rem; text-align: center; color: var(--encre); }
body.nsa-page .fiche__resume form.cart .quantity input.qty:focus-visible { outline: 2px solid var(--cuivre); outline-offset: 1px; }
body.nsa-page .fiche__resume .single_add_to_cart_button { flex: 1 1 12rem; min-height: 54px; padding: 0 1.75rem; border: 0; border-radius: 0; background: var(--cuivre); color: #fffefc; font-family: var(--sans); font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; transition: background-color 300ms var(--ease), transform 150ms var(--ease); }
body.nsa-page .fiche__resume .single_add_to_cart_button:hover { background: var(--rouge); }
body.nsa-page .fiche__resume .single_add_to_cart_button:active { transform: scale(.98); }
body.nsa-page .fiche__resume .single_add_to_cart_button:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
body.nsa-page .fiche__resume .single_add_to_cart_button.loading { opacity: .65; pointer-events: none; }
body.nsa-page .fiche__resume form.cart > p,
body.nsa-page .fiche__resume form.cart > div:not(.quantity) { flex: 1 1 100%; margin: 0; }

/* Description courte et blocs des greffons */
body.nsa-page .fiche__resume .woocommerce-product-details__short-description { margin-bottom: 1.5rem; color: var(--texte); }
body.nsa-page .fiche__resume .woocommerce-product-details__short-description h2 { display: none; } /* répète le titre du produit */
body.nsa-page .fiche__resume .woocommerce-product-details__short-description ul { margin: 0; padding-left: 1.1rem; }
body.nsa-page .fiche__resume .woocommerce-product-details__short-description li + li { margin-top: .4rem; }
body.nsa-page .fiche__resume .nis-essentiel { margin: 0 0 1.5rem !important; padding: 1.25rem 1.5rem !important; border: 1px solid var(--filet) !important; border-radius: 0 !important; background: var(--fond-2) !important; }
body.nsa-page .fiche__resume .nis-essentiel h2 { margin: 0 0 .9rem !important; font-family: var(--titre) !important; font-size: 1.375rem !important; font-weight: 400 !important; color: var(--encre) !important; }
body.nsa-page .fiche__resume .nis-essentiel dt { font-family: var(--sans) !important; font-size: .6875rem !important; letter-spacing: .14em !important; text-transform: uppercase !important; color: var(--cuivre-texte) !important; }
body.nsa-page .fiche__resume #nis-rec-fiche,
body.nsa-page .fiche__resume #nis-livraison-direct { margin-bottom: 1.25rem !important; }
body.nsa-page .fiche__resume .nis-mentions-alcool { margin: 0 0 1.25rem; font-size: .8125rem; color: var(--texte-doux); }

/* ---------- Description et caractéristiques ---------- */
body.nsa-page .fiche-detail { background: var(--fond-2); }
body.nsa-page .fiche-detail__grille { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
body.nsa-page .fiche-detail__prose { margin-top: 1.5rem; max-width: 70ch; }
body.nsa-page .fiche-detail__prose > h2:first-child { display: none; } /* « Description » ou le nom du vin, déjà affichés */
body.nsa-page .fiche-detail__prose h2, body.nsa-page .fiche-detail__prose h3 { margin: 1.75rem 0 .75rem; font-family: var(--titre); font-weight: 400; font-size: 1.5rem; line-height: 1.25; color: var(--encre); }
body.nsa-page .fiche-detail__prose p { margin: 0 0 1rem; }
body.nsa-page .fiche-detail__prose table { width: 100%; margin: 1rem 0; border-collapse: collapse; }
body.nsa-page .fiche-detail__prose th, body.nsa-page .fiche-detail__prose td { padding: .8rem 1rem .8rem 0; border-bottom: 1px solid var(--filet); text-align: left; vertical-align: top; }
body.nsa-page .fiche-detail__prose th, body.nsa-page .fiche-detail__prose td:first-child:not(:has(img)) { width: 32%; font-family: var(--sans); font-size: .6875rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--cuivre-texte); }
/* Descriptions saisies avec des styles en dur (olive #54562b, Georgia, centrage) :
   on les ramène à la charte sans toucher au contenu en base. */
body.nsa-page .fiche-detail__prose [style*="color"] { color: var(--texte) !important; }
body.nsa-page .fiche-detail__prose [style*="font-family"] { font-family: inherit !important; }
body.nsa-page .fiche-detail__prose [style*="font-size"]:not(h2):not(h3) { font-size: inherit !important; line-height: inherit !important; }
body.nsa-page .fiche-detail__prose :is(p, h2, h3, td:not(:has(img)))[style*="text-align"] { text-align: left !important; }
body.nsa-page .fiche-detail__prose strong { color: var(--encre); font-weight: 600; }
body.nsa-page .fiche-detail__prose td:has(img) { width: 3.5rem; padding-right: 1.25rem; text-align: center; vertical-align: top; }
body.nsa-page .fiche-detail__prose td img { width: 34px; height: 34px; object-fit: contain; opacity: .78; }
body.nsa-page .fiche-detail__prose td :is(h2, h3) { margin: .15rem 0 .45rem; font-family: var(--sans) !important; font-size: .6875rem !important; font-weight: 600; line-height: 1.4; letter-spacing: .16em; text-transform: uppercase; color: var(--cuivre-texte) !important; }
body.nsa-page .fiche-detail__prose td p { margin: 0; }
body.nsa-page .fiche-detail__prose tr:last-child td { border-bottom: 0; }
body.nsa-page .fiche-detail__carac { position: sticky; top: 110px; padding: clamp(1.5rem, 3vw, 2.25rem); border: 1px solid var(--filet); background: var(--fond); }
body.nsa-page .fiche-detail__carac-titre { margin: 0 0 1rem; font-family: var(--titre); font-size: 1.375rem; font-weight: 400; color: var(--encre); }
body.nsa-page .fiche-detail__carac table { width: 100%; border-collapse: collapse; }
body.nsa-page .fiche-detail__carac th, body.nsa-page .fiche-detail__carac td { padding: .7rem 0; border-bottom: 1px solid var(--filet); text-align: left; vertical-align: top; font-size: .9375rem; }
body.nsa-page .fiche-detail__carac th { width: 45%; padding-right: 1rem; font-family: var(--sans); font-size: .6875rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--cuivre-texte); }
body.nsa-page .fiche-detail__carac td p { margin: 0; }

/* ---------- Avis produit WooCommerce ---------- */
body.nsa-page .fiche-avis .commentlist { margin: 0; padding: 0; list-style: none; }
body.nsa-page .fiche-avis .comment_container { padding: 1.25rem 0; border-bottom: 1px solid var(--filet); }

/* ---------- Cartes « Complétez votre carton » et « Vous aimerez aussi » ---------- */
body.nsa-page .produits--fiche { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
body.nsa-page .produits--fiche:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 60rem; margin-inline: auto; }
body.nsa-page .produits--fiche .produit__visuel--photo img { height: 250px; width: auto; max-width: 100%; object-fit: contain; mix-blend-mode: multiply; filter: none; }
body.nsa-page .produits--fiche .produit__nom { font-size: 1.125rem; text-wrap: balance; }
body.nsa-page .pastille--promo { background: var(--rouge); color: var(--blanc); }
body.nsa-page .fiche-voisins { background: var(--fond-2); }

/* ---------- Avis Google ---------- */
body.nsa-page .avis-boutique .nis-avis { margin: 0; }
body.nsa-page .avis-boutique .nis-avis > h2 { margin: 0 0 1.5rem; font-family: var(--titre); font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 400; text-align: center; }
body.nsa-page .avis-boutique .nis-avis-lien { display: block; width: fit-content; margin: 1.25rem auto 0; font-family: var(--sans); font-size: .8125rem; color: var(--rouge); }

@media (max-width: 1100px) {
  body.nsa-page .produits--fiche { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.nsa-page .produits--fiche:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  body.nsa-page .fiche__grille, body.nsa-page .fiche-detail__grille { grid-template-columns: minmax(0, 1fr); }
  body.nsa-page .fiche-detail__carac { position: static; }
  body.nsa-page .fiche__galerie { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body.nsa-page .fiche { padding-top: 1.5rem; }
  body.nsa-page .fiche__photo--principale { aspect-ratio: 4 / 5; }
  body.nsa-page .fiche__resume form.cart { padding: 1rem; }
  body.nsa-page .produits--fiche,
  body.nsa-page .produits--fiche:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  body.nsa-page .produits--fiche .produit__lien { padding: 0 .75rem 1rem; }
  body.nsa-page .produits--fiche .produit__visuel { height: 210px; }
  body.nsa-page .produits--fiche .produit__visuel img { height: 175px; }
  body.nsa-page .produits--fiche .produit__nom { font-size: 1rem; }
  body.nsa-page .produits--fiche .produit__cepages { display: none; }
  body.nsa-page .produits--fiche .pastille { font-size: .5625rem; padding-inline: .5rem; }
  body.nsa-page .produits--fiche .produit__ajout { font-size: .625rem; letter-spacing: .12em; }
}
