/* ==========================================================================
   Boutique : cards, filtres, tri, fenêtre de confirmation
   Fichier : paresseux-chanvrier-child/assets/shop-cards.css

   SOMMAIRE
   1. Variables (couleurs et réglages)
   2. Page boutique : marges et grille            (format BUREAU, par défaut)
   3. Tri et filtres
   4. Card produit : conteneur, image, sticker, titre, prix
   5. Card produit : options, total, quantité, ajout au panier
   6. Fenêtre de confirmation d'ajout
   7. Utilitaires
   8. Media query TABLETTE  (jusqu'à 1079px)
   9. Media query MOBILE    (jusqu'à 767px)

   Les sections 1 à 7 décrivent le format bureau. Les media queries 8 et 9
   ne contiennent que ce qui change pour leur format. Le mobile vient après la
   tablette : il hérite de ses réglages et les écrase si besoin.
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES
   Classes : .product (card), .pcc-modal (fenêtre), .pcc-filters (filtres)
   ========================================================================== */
.product,
.pcc-modal,
.pcc-filters {
  --pcc-accent: #2b7565;
  --pcc-border: #cdd8d3;
  --pcc-muted: #586a63;
  --pcc-olive: #c4be00;
  --pcc-olive-hover: #b37b54;
  --pcc-disabled-opacity: 0.8; /* opacité des contrôles désactivés (quantité, ajout) */
  --pcc-card-padding: 15px; /* padding de la card défini dans Elementor : sert à
                               faire toucher l'image aux bords */
}

/* ==========================================================================
   2. PAGE BOUTIQUE : MARGES ET GRILLE  (format bureau)
   Classes : .elementor-location-archive (modèle d'archive Elementor),
             .e-con.e-parent (ses conteneurs de premier niveau : titre,
             filtres/tri, grille), ul.products (grille des cards)
   ========================================================================== */

/* Marge latérale de tous les blocs de la boutique (titre, filtres, grille) :
   16px minimum, 48px maximum, 4% de la largeur de l'écran entre les deux */
.elementor-location-archive > .e-con.e-parent {
  padding-inline: clamp(16px, 4vw, 48px) !important;
}

/* Grille : nombre de colonnes fixe, cards de --pcc-card-min à --pcc-card-max,
   l'espace restant est réparti entre les colonnes (space-between), ce qui
   garde la première card alignée à gauche et la dernière à droite */
.elementor-element.elementor-wc-products ul.products {
  --pcc-cols: 3; /* nombre de colonnes */
  --pcc-card-min: 19.5rem; /* ne pas descendre : les boutons s'empileraient */
  --pcc-card-max: 22rem; /* taille MAXIMALE d'une card */
  grid-template-columns: repeat(
    var(--pcc-cols),
    minmax(var(--pcc-card-min), var(--pcc-card-max))
  ) !important;
  justify-content: space-between !important;
}

/* ==========================================================================
   3. TRI ET FILTRES
   Classes : .woocommerce-ordering (tri généré par Elementor/WooCommerce),
             .pcc-filters (conteneur des filtres), .pcc-filter (un bouton)
   ========================================================================== */
.pcc-filters {
  --pcc-filter-min: 6rem; /* largeur MINIMALE d'un bouton de filtre */
  --pcc-filter-max: 1fr; /* largeur MAXIMALE d'un bouton de filtre */
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; /* écart minimum entre les boutons */
  align-items: center;
  min-height: 43px; /* même hauteur que le tri, pour les aligner */
  margin-bottom: 25px;
}

.pcc-filters .pcc-filter {
  min-width: var(--pcc-filter-min);
  max-width: var(--pcc-filter-max);
  padding: 0.3em 1em;
  font: inherit;
  font-weight: bold;
  text-align: center;
  color: var(--pcc-accent);
  background: transparent;
  border: 1px solid var(--pcc-accent);
  border-radius: 99px;
  cursor: pointer;
}

.pcc-filters .pcc-filter:hover,
.pcc-filters .pcc-filter.is-active {
  color: #fff;
  background: var(--pcc-accent);
}

.pcc-filters .pcc-filter:focus-visible {
  outline: 2px solid var(--pcc-accent);
  outline-offset: 2px;
}

/* Barre "Trier / Filtrer" : créée par le JS, visible seulement sur mobile
   (voir la section 9) */
.pcc-toolbar {
  display: none;
}

/* ==========================================================================
   4. CARD PRODUIT : CONTENEUR, IMAGE, STICKER, TITRE, PRIX
   Classes : .product (une card), img.attachment-woocommerce_thumbnail (image),
             .pcc-sticker (pastille), .woocommerce-loop-product__title (titre),
             .pcc-price (prix "À partir de")
   ========================================================================== */

/* Image : touche les bords de la card (annule le padding de la card) */
.woocommerce ul.products li.product a img.attachment-woocommerce_thumbnail {
  width: calc(100% + 2 * var(--pcc-card-padding));
  max-width: none;
  margin: calc(-1 * var(--pcc-card-padding)) calc(-1 * var(--pcc-card-padding))
    16px;
  border-radius: 3px 3px 0 0;
}

/* Image : arrondi du haut et ligne sous l'image (sélecteur renforcé pour
   passer devant le CSS généré par Elementor) */
.elementor-element.elementor-wc-products
  ul.products
  li.product
  a
  img.attachment-woocommerce_thumbnail {
  border-radius: 3px 3px 0 0;
  border-bottom: 1px solid var(--pcc-border);
}

/* Sticker de sous-catégorie, en haut à gauche de l'image */
.product .pcc-sticker {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 2;
  padding: 0.2em 0.7em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: black;
  background: var(--pcc-olive);
  border-radius: 99px;
}

/* Couleur du sticker selon la sous-catégorie (classe = slug de la catégorie) */
.product .pcc-sticker--fleur {
  background: var(--pcc-olive);
  color: black;
}

.product .pcc-sticker--resine {
  background: var(--pcc-accent);
  color: #fff;
}

.product .pcc-sticker--huile {
  background: var(--pcc-olive-hover);
  color: #fff;
}

/* Titre : hauteur réservée pour 2 lignes, afin que le prix soit toujours au
   même niveau (content-box : le padding du titre s'ajoute à la hauteur) */
.product .woocommerce-loop-product__title {
  box-sizing: content-box;
  min-height: 2.4em; /* repli pour les navigateurs sans l'unité lh */
  min-height: 2lh;
}

/* Prix "À partir de X €" puis prix de l'option choisie */
.product .pcc-price {
  display: block;
  margin: 0.25rem 0 0.75rem;
  font-weight: 700;
  color: var(--pcc-olive-hover);
}

.product .pcc-price__from {
  font-size: 0.8em;
  font-weight: 400;
  color: var(--pcc-muted);
}

/* ==========================================================================
   5. CARD PRODUIT : OPTIONS, TOTAL, QUANTITÉ, AJOUT AU PANIER
   Classes : .pcc-buy (bloc d'achat), .pcc-options / .pcc-option (2g, 5g, 10g),
             .pcc-total, .pcc-actions (ligne quantité + ajout),
             .pcc-qty / .pcc-qty__btn / .pcc-qty__input, .pcc-add, .pcc-message
   ========================================================================== */
.pcc-buy {
  padding: 0;
}

/* Boutons d'options */
.product .pcc-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product .pcc-option {
  padding: 0.1em 0.9em;
  font: inherit;
  font-weight: bold;
  color: var(--pcc-accent);
  background: transparent;
  border: 1px solid var(--pcc-accent);
  border-radius: 99px;
  cursor: pointer;
}

.product .pcc-option:hover:not(:disabled) {
  border-color: var(--pcc-accent);
  background: transparent;
}

.product .pcc-option.is-active,
.product .pcc-option.is-active:hover {
  background: var(--pcc-accent);
  border-color: var(--pcc-accent);
  color: #fff;
}

.product .pcc-option:disabled {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Total (quantité × prix), masqué tant qu'aucune option n'est choisie */
.product .pcc-total {
  margin: 0 0 0.75rem;
}

.product .pcc-total[hidden] {
  display: none;
}

/* Ligne quantité + bouton d'ajout (le bouton passe dessous si la place manque) */
.product .pcc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

/* Sélecteur de quantité */
.product .pcc-qty {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--pcc-border);
  border-radius: 6px;
  overflow: hidden;
}

.product .pcc-qty:has(.pcc-qty__input:disabled) {
  opacity: var(--pcc-disabled-opacity);
}

.product .pcc-qty__btn {
  width: 2rem;
  padding: 0;
  font: inherit;
  font-size: 1.1rem;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.product .pcc-qty__btn:hover:not(:disabled) {
  background: var(--pcc-border);
  color: inherit;
}

.product .pcc-qty__input {
  width: 2.5rem;
  padding: 0;
  font: inherit;
  text-align: center;
  color: inherit;
  background: transparent;
  border: 0;
  -moz-appearance: textfield;
}

.product .pcc-qty__input::-webkit-outer-spin-button,
.product .pcc-qty__input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.product .pcc-qty__btn:disabled,
.product .pcc-qty__input:disabled {
  cursor: not-allowed;
}

/* Bouton "Ajouter au panier" */
.product .pcc-add {
  flex: 1;
  padding: 0.4em 0.7em;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--pcc-olive);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.product .pcc-add:hover {
  background: var(--pcc-olive-hover);
}

.product .pcc-add:disabled {
  border: 1px solid var(--pcc-border);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-weight: 200;
  opacity: var(--pcc-disabled-opacity);
  cursor: not-allowed;
}

.product .pcc-add.is-loading {
  opacity: var(--pcc-disabled-opacity);
}

/* Message d'erreur sous le bouton */
.product .pcc-message {
  min-height: 1.2em;
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

/* Contour de focus (navigation au clavier) */
.product .pcc-option:focus-visible,
.product .pcc-add:focus-visible,
.product .pcc-qty__btn:focus-visible,
.product .pcc-qty__input:focus-visible,
.pcc-modal .pcc-modal__btn:focus-visible {
  outline: 2px solid var(--pcc-accent);
  outline-offset: 2px;
}

/* ==========================================================================
   6. FENÊTRE DE CONFIRMATION D'AJOUT
   Classes : .pcc-modal (la fenêtre), .pcc-modal__title, .pcc-modal__summary,
             .pcc-modal__actions, .pcc-modal__btn (+ --primary),
             .pcc-modal__close (croix)
   ========================================================================== */
.pcc-modal {
  width: min(28rem, calc(100vw - 2rem));
  padding: 1.5rem;
  color: #1f2f29;
  background: #fff;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.pcc-modal::backdrop {
  background: rgba(23, 48, 42, 0.55);
}

.pcc-modal .pcc-modal__title {
  margin: 0 0 0.5rem;
  padding-right: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.pcc-modal .pcc-modal__summary {
  margin: 0 0 1.25rem;
  color: var(--pcc-muted);
}

.pcc-modal .pcc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pcc-modal .pcc-modal__btn {
  flex: 1 1 auto;
  padding: 0.7em 1em;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--pcc-accent);
  background: transparent;
  border: 2px solid var(--pcc-accent);
  border-radius: 6px;
  cursor: pointer;
}

.pcc-modal .pcc-modal__btn--primary {
  color: #fff;
  background: var(--pcc-accent);
}

.pcc-modal .pcc-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--pcc-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.pcc-modal .pcc-modal__close:hover {
  color: #1f2f29;
  background: var(--pcc-border);
}

/* ==========================================================================
   7. UTILITAIRES
   ========================================================================== */

/* Card masquée par un filtre : le grid d'Elementor met display:flex sur les
   cards, ce qui annule l'attribut hidden */
li.product[hidden] {
  display: none !important;
}

/* ==========================================================================
   8. TABLETTE : jusqu'à 1079px
   Change : grille à 2 colonnes (cards étirées pour partager la largeur)
   ========================================================================== */
@media (max-width: 1079px) {
  .elementor-element.elementor-wc-products ul.products {
    --pcc-cols: 2;
    --pcc-card-max: 26rem; /* ou une taille fixe, ex. 26rem, pour des cards plus
                            petites (l'écart entre les colonnes grandit) */
  }
}

/* ==========================================================================
   9. MOBILE : jusqu'à 767px
   Change : 1 colonne centrée, image moins haute, tri puis filtres centrés
   ========================================================================== */
@media (max-width: 767px) {
  /* Grille : 1 colonne, card plafonnée et centrée */
  .elementor-element.elementor-wc-products ul.products {
    --pcc-cols: 1;
    --pcc-card-min: 0px;
    --pcc-card-max: 21rem;
    justify-content: center !important;
  }

  /* Image moins haute (4/3 au lieu d'un carré) */
  .elementor-element.elementor-wc-products
    ul.products
    li.product
    a
    img.attachment-woocommerce_thumbnail {
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  /* Tri (.woocommerce-ordering) puis filtres (.pcc-filters), l'un au-dessus
     de l'autre, sur toute la largeur et alignés bord à bord */
  .woocommerce form.woocommerce-ordering {
    float: none;
    width: 100%;
    margin: 0 0 1rem !important;
  }

  .woocommerce form.woocommerce-ordering select {
    width: 100%;
  }

  /* Filtres : boutons de taille normale, l'écart entre eux s'adapte */
  .pcc-filters {
    justify-content: space-between;
    width: 100%;
    min-height: 0;
    margin-bottom: 1rem;
  }

  /* Barre "Trier / Filtrer" : deux boutons côte à côte */
  .pcc-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .pcc-toolbar .pcc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5em 1em;
    font: inherit;
    font-weight: 700;
    color: var(--pcc-accent);
    background: transparent;
    border: 1px solid var(--pcc-accent);
    border-radius: 6px;
    cursor: pointer;
  }

  /* Petite flèche vers le bas, retournée quand le panneau est ouvert */
  .pcc-toggle::after {
    content: "";
    width: 0.5em;
    height: 0.5em;
    margin-top: -0.2em;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.2s;
  }

  .pcc-toggle[aria-expanded="true"]::after {
    margin-top: 0.2em;
    transform: rotate(-135deg);
  }

  /* Tri et filtres masqués tant que leur bouton n'est pas ouvert */
  .pcc-collapsible:not(.is-open) {
    display: none !important;
  }
}

/* ==========================================================================
   10. PETIT MOBILE : jusqu'à 450px
   Change : les 4 filtres s'empilent en colonne, chacun sur toute la largeur
   ========================================================================== */
@media (max-width: 450px) {
  .pcc-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .pcc-filters .pcc-filter {
    width: 100%;
    max-width: none;
  }
}


/* ==========================================================================
   10. FICHE LARGE (option B)
   S'applique seulement au widget Elementor qui porte la classe .pcc-liste.
   Les .pcc-extra (accroche, description, pastilles) sont invisibles ailleurs.
   ========================================================================== */

/* Police manuscrite : mets ici le nom de la police d'écriture de ton accueil
   (réglage Elementor > Typographie globale). */
.product,
.pcc-filters {
  --pcc-hand: "Caveat", cursive;
  /* Police du titre des fiches : doit être celle de ton titre de page
     (« Les trésors du Paresseux »). Voir la note sous ce bloc CSS. */
  --pcc-title-font: var(--e-global-typography-primary-font-family), "Nunito", sans-serif;
}

.pcc-extra {
  display: none;
}

/* Bloc du milieu : transparent partout (la boutique actuelle ne change pas) */
.pcc-info {
  display: contents;
}

/* ----- Zone des filtres (classe "pcc-zone-filtres" sur le conteneur) ----- */
.pcc-zone-filtres .pcc-filters {
  justify-content: center;
}

/* ----- Liste : une seule colonne ----- */
.elementor-element.elementor-wc-products.pcc-liste ul.products {
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}

/* ----- La fiche : 3 colonnes (photo | infos | achat), comme la maquette ----- */
.pcc-liste ul.products li.product {
  display: grid !important;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  /* 6 lignes. Colonne de droite : 1 prix | 2 poids | 3 espace libre | 4 total |
     5 quantité + bouton | 6 message. L'espace libre (ligne 3) fait 14 px au
     minimum (léger) et s'étire si la fiche est plus haute : le bouton reste
     ainsi en bas de la fiche. Photo et textes occupent les lignes 1 à 6. */
  grid-template-rows: auto auto minmax(14px, 1fr) auto auto auto;
  column-gap: 18px;
  row-gap: 0;
  align-items: center;
  padding: 16px 18px !important;
  border: 0 !important;
  border-radius: 24px !important;
  box-shadow: none !important;
  min-height: 0 !important;
  height: auto !important;
  text-align: left;
}

/* Filtres : une fiche masquée par le filtre doit vraiment disparaître
   (sans cette règle, le display: grid ci-dessus l'emporte et le filtre ne fait rien) */
.pcc-liste ul.products li.product[hidden],
.elementor-element.elementor-wc-products.pcc-liste ul.products li.product[hidden] {
  display: none !important;
}

/* Couleurs alternées : menthe, jaune pâle, pêche */
.pcc-liste ul.products li.product:nth-child(3n + 1) { background: #ddf3ee !important; }
.pcc-liste ul.products li.product:nth-child(3n + 2) { background: #f4f1c0 !important; }
.pcc-liste ul.products li.product:nth-child(3n + 3) { background: #fbe6da !important; }

/* Le lien enveloppe photo + titre + prix : on le "dissout" pour que chaque
   élément devienne une case de la grille */
.pcc-liste li.product > a.woocommerce-LoopProduct-link,
.elementor-element.elementor-wc-products.pcc-liste ul.products li.product > a.woocommerce-LoopProduct-link {
  display: contents !important;
}

/* Photo : remplit toute la hauteur de la colonne (marges de la fiche déduites) */
.pcc-liste li.product img,
.elementor-element.elementor-wc-products.pcc-liste ul.products li.product img {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
  justify-self: stretch;
  width: 100% !important;
  height: 100% !important;
  min-height: 150px;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover;
  border: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

/* Sticker : en haut à gauche, sur le coin de la photo */
.pcc-liste li.product .pcc-sticker {
  top: 24px;
  left: 26px;
}

/* Colonne du milieu : le bloc .pcc-info occupe toute la hauteur de la fiche.
   En haut : accroche + titre. En bas : étiquettes. Au milieu : la description,
   centrée entre les deux grâce à ses marges "auto" en haut et en bas. */
.pcc-liste li.product .pcc-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: stretch;
  align-items: flex-start;
  grid-column: 2;
  grid-row: 1 / -1;
  min-width: 0;
}

.pcc-liste li.product .pcc-accroche {
  display: block;
  font-family: var(--pcc-hand);
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 2px;
  color: var(--pcc-accent);
}

/* Titre : !important car Elementor impose sa propre typographie aux titres de produits */
.pcc-liste li.product .woocommerce-loop-product__title,
.elementor-element.elementor-wc-products.pcc-liste ul.products li.product .woocommerce-loop-product__title {
  min-height: 0;
  margin: 0 0 10px !important; /* 10 px minimum entre le titre et la description */
  padding: 0 !important;
  font-family: var(--pcc-title-font, inherit) !important;
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  color: #111 !important;
}

.pcc-liste li.product .pcc-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* garde-fou : au plus 3 lignes, la suite est coupée par « … » */
  overflow: hidden;
  margin: auto 0; /* "auto" en haut et en bas : la description est centrée entre le titre et les étiquettes */
  font-size: 0.8rem;
  line-height: 1.4;
  color: #3d4a4a;
}

.pcc-liste li.product .pcc-desc p {
  margin: 0;
}

.pcc-liste li.product .pcc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px; /* espace minimum au-dessus des étiquettes */
}

.pcc-liste li.product .pcc-tag {
  padding: 4px 12px;
  font-size: 0.8rem;
  line-height: 1.3;
  color: #1f2a2a;
  background: #fff;
  border-radius: 99px;
}

/* Colonne achat (à droite).
   Le bloc .pcc-buy est "dissous" (display: contents) : poids, total, quantité et
   message deviennent des cases de la grille de la fiche, placées une à une. */
.pcc-liste li.product .pcc-price {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  margin: 0 0 8px;
  text-align: right;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--pcc-accent);
}

.pcc-liste li.product .pcc-price__from {
  font-size: 0.55em;
  font-weight: 400;
}

.pcc-liste li.product .pcc-buy {
  display: contents;
}

/* Bouton par défaut de WooCommerce (« Lire la suite »), si le produit n'est pas géré */
.pcc-liste li.product > a.button {
  grid-column: 3;
  grid-row: 5;
  align-self: end;
  justify-self: end;
  margin: 0;
}

.pcc-liste .pcc-options {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  justify-content: flex-end;
  margin: 0;
  gap: 4px;
}

.pcc-liste .pcc-option {
  padding: 2px 10px;
  font-size: 0.75rem;
  background: #fff;
}

/* Total : « Total : 52,00 € » sur une seule ligne (!important : un style du thème
   ou d'Elementor empilait les deux morceaux) */
.pcc-liste .pcc-total,
.elementor-element.elementor-wc-products.pcc-liste ul.products li.product .pcc-total {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.3em;
  width: max-content !important;
  max-width: none !important;
  grid-column: 3;
  grid-row: 4;
  align-self: end;
  justify-self: end;
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-align: right;
  white-space: nowrap !important;
}

.pcc-liste .pcc-total strong,
.elementor-element.elementor-wc-products.pcc-liste ul.products li.product .pcc-total strong {
  display: inline !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

/* Le total est masqué tant qu'aucun poids n'est choisi (le hidden doit gagner) */
.pcc-liste .pcc-total[hidden],
.elementor-element.elementor-wc-products.pcc-liste ul.products li.product .pcc-total[hidden] {
  display: none !important;
}

.pcc-liste .pcc-message {
  grid-column: 3;
  grid-row: 6;
  justify-self: end;
  margin: 0;
  text-align: right;
}

.pcc-liste .pcc-message:empty {
  display: none;
}

.pcc-liste .pcc-actions {
  grid-column: 3;
  grid-row: 5;
  align-self: end;
  justify-self: end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

/* Quantité : un seul contour vert fin, même police que le bouton */
.pcc-liste .pcc-qty {
  height: 30px;
  padding: 0 12px;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--pcc-accent);
  border: 1.5px solid var(--pcc-accent);
  border-radius: 99px;
}

.pcc-liste .pcc-qty__btn {
  width: 14px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--pcc-accent);
  background: transparent;
  border: 0;
}

.pcc-liste .pcc-qty__btn:hover:not(:disabled) {
  background: transparent;
  color: var(--pcc-accent);
}

.pcc-liste .pcc-qty__input {
  width: 22px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--pcc-accent);
}

/* Bouton jaune */
.pcc-liste .pcc-add {
  flex: none;
  height: 36px;
  padding: 0 16px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #2d2d00;
  border: 0;
  border-radius: 99px;
  box-shadow: 0 3px 0 #9a9708;
}

.pcc-liste .pcc-add:hover:not(:disabled) {
  color: #2d2d00;
  background: #d4cf12;
}

/* Bouton désactivé : même forme que l'actif, mais pâle, à plat, en pointillés */
.pcc-liste .pcc-add:disabled {
  color: #9a9962;
  background: #eeedc6;
  box-shadow: none;
  border: 1.5px dashed #cfcd8c;
  font-weight: 800;
  opacity: 1;
  cursor: not-allowed;
}

/* Quantité désactivée : contour et chiffres pâles */
.pcc-liste .pcc-qty:has(.pcc-qty__input:disabled) {
  border-color: #bfe3dc;
}

.pcc-liste .pcc-qty__btn:disabled,
.pcc-liste .pcc-qty__input:disabled {
  color: #9cc9c1;
  -webkit-text-fill-color: #9cc9c1;
  opacity: 1;
}

/* Petite aide sous les boutons tant qu'aucun poids n'est choisi
   (pour la retirer : supprime ce bloc) */
.pcc-liste .pcc-buy:has(.pcc-add:disabled)::after {
  content: "Choisissez un poids";
  grid-column: 3;
  grid-row: 4;
  align-self: end;
  justify-self: end;
  margin-bottom: 10px;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--pcc-accent);
}

/* ----- Mobile : tout s'empile, centré ----- */
@media (max-width: 767px) {
  .pcc-liste ul.products li.product {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    row-gap: 10px;
    justify-items: center;
    text-align: center;
    min-height: 0 !important;
  }

  .pcc-liste li.product img,
  .pcc-liste li.product .pcc-info,
  .pcc-liste li.product .pcc-price,
  .pcc-liste li.product .pcc-buy,
  .pcc-liste li.product > a.button {
    grid-column: 1;
    grid-row: auto;
    align-self: auto;
    justify-self: center;
  }

  .pcc-liste li.product img {
    justify-self: stretch;
    height: 200px !important;
  }

  .pcc-liste li.product .pcc-info {
    align-items: center;
  }

  .pcc-liste li.product .pcc-price {
    margin: 0;
  }

  .pcc-liste li.product .pcc-tags,
  .pcc-liste .pcc-options {
    justify-content: center;
  }

  .pcc-liste li.product .pcc-buy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .pcc-liste .pcc-total {
    margin: 0;
    justify-content: center;
  }

  .pcc-liste li.product .pcc-sticker {
    position: static;
    justify-self: center;
  }
}


/* ==========================================================================
   11. BLOC ACHAT DU MODÈLE ELEMENTOR (shortcode [pcc_achat])
   Indépendant de .pcc-liste et de li.product : tout est sous .pcc-achat.
   Classe à mettre sur le conteneur de la colonne de droite : pcc-achat-col
   ========================================================================== */

/* La colonne de droite pousse le bloc sur toute sa hauteur */
.pcc-achat-col {
  display: flex;
  flex-direction: column;
}

.pcc-achat-col > .e-con-inner,
.pcc-achat-col .elementor-widget-shortcode,
.pcc-achat-col .elementor-widget-shortcode .elementor-widget-container,
.pcc-achat-col .elementor-shortcode {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
}

.pcc-achat {
  --pcc-accent: #2b7565;
  --pcc-muted: #586a63;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  text-align: right;
}

.pcc-achat .pcc-price {
  display: block;
  margin: 0 0 16px;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--pcc-accent);
}

.pcc-achat .pcc-price__from {
  font-size: 0.55em;
  font-weight: 400;
  color: var(--pcc-muted);
}

.pcc-achat .pcc-buy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  padding: 0;
}

.pcc-achat .pcc-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
}

.pcc-achat .pcc-option {
  padding: 2px 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pcc-accent);
  background: #fff;
  border: 1px solid var(--pcc-accent);
  border-radius: 99px;
  cursor: pointer;
}

.pcc-achat .pcc-option:hover:not(:disabled) {
  color: var(--pcc-accent);
  background: #fff;
  border-color: var(--pcc-accent);
}

.pcc-achat .pcc-option.is-active,
.pcc-achat .pcc-option.is-active:hover {
  color: #fff;
  background: var(--pcc-accent);
  border-color: var(--pcc-accent);
}

.pcc-achat .pcc-option:disabled {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Total et aide : même emplacement, juste au-dessus du bouton.
   Le premier des deux pousse tout vers le bas (margin-top: auto). */
.pcc-achat .pcc-total {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.3em;
  order: 2;
  margin: auto 0 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.pcc-achat .pcc-total strong {
  display: inline;
  margin: 0;
}

.pcc-achat .pcc-total[hidden] {
  display: none;
}

.pcc-achat .pcc-buy:has(.pcc-add:disabled)::after {
  content: "Choisissez un poids";
  order: 2;
  margin: auto 0 10px;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--pcc-accent);
}

.pcc-achat .pcc-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  order: 3;
  margin-top: 0;
}

.pcc-achat .pcc-message {
  order: 4;
  margin: 4px 0 0;
  font-size: 0.8rem;
}

.pcc-achat .pcc-message:empty {
  display: none;
}

.pcc-achat .pcc-qty {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--pcc-accent);
  background: transparent;
  border: 1.5px solid var(--pcc-accent);
  border-radius: 99px;
  overflow: visible;
}

.pcc-achat .pcc-qty__btn {
  width: 14px;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--pcc-accent);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.pcc-achat .pcc-qty__btn:hover:not(:disabled) {
  color: var(--pcc-accent);
  background: transparent;
}

.pcc-achat .pcc-qty__input {
  width: 22px;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  color: var(--pcc-accent);
  background: transparent;
  border: 0;
  -moz-appearance: textfield;
}

.pcc-achat .pcc-qty__input::-webkit-outer-spin-button,
.pcc-achat .pcc-qty__input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.pcc-achat .pcc-add {
  flex: none;
  height: 36px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  color: #2d2d00;
  background: #c6c20e;
  border: 0;
  border-radius: 99px;
  box-shadow: 0 3px 0 #9a9708;
  cursor: pointer;
}

.pcc-achat .pcc-add:hover:not(:disabled) {
  color: #2d2d00;
  background: #d4cf12;
}

/* Bouton désactivé : gris-vert, toujours la même couleur quel que soit le fond.
   Sélecteur renforcé + !important pour passer devant les autres règles. */
.pcc-achat .pcc-buy .pcc-actions .pcc-add:disabled {
  color: #5f7068 !important;
  background: #e6ebe7 !important;
  border: 1.5px dashed #a9b8b1 !important;
  border-radius: 99px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

.pcc-achat .pcc-add.is-loading {
  opacity: 0.7;
}

.pcc-achat .pcc-qty:has(.pcc-qty__input:disabled) {
  border-color: #bfe3dc;
}

.pcc-achat .pcc-qty__btn:disabled,
.pcc-achat .pcc-qty__input:disabled {
  color: #9cc9c1;
  -webkit-text-fill-color: #9cc9c1;
  opacity: 1;
  cursor: not-allowed;
}

.pcc-achat .pcc-option:focus-visible,
.pcc-achat .pcc-add:focus-visible,
.pcc-achat .pcc-qty__btn:focus-visible,
.pcc-achat .pcc-qty__input:focus-visible {
  outline: 2px solid var(--pcc-accent);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .pcc-achat,
  .pcc-achat .pcc-buy {
    align-items: center;
    text-align: center;
  }

  .pcc-achat .pcc-options,
  .pcc-achat .pcc-total {
    justify-content: center;
  }
}

/* Filtre du thème avec la grille de boucle : une carte masquée disparaît */
.e-loop-item[hidden] {
  display: none !important;
}

/* ==========================================================================
   12. FENÊTRE DE CONFIRMATION : version "bandeau teal"
   Couleur du bandeau : --pcc-header-bg (mets ici celle de ton header)
   ========================================================================== */
.pcc-modal {
  --pcc-header-bg: #23b2a0;
  --pcc-green: #0f6e63;
  width: min(26rem, calc(100vw - 2rem));
  padding: 0;
  overflow: hidden;
  color: #1f2a2a;
  background: #fbf6e9;
  border: 0;
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.pcc-modal::backdrop {
  background: rgba(23, 60, 54, 0.55);
}

.pcc-modal .pcc-modal__head {
  padding: 24px 56px 18px 26px;
  background: var(--pcc-header-bg);
}

.pcc-modal .pcc-modal__hand {
  margin: 0;
  font-family: "Caveat", cursive;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: #f4ef8a;
}

.pcc-modal .pcc-modal__title {
  margin: 2px 0 0;
  padding: 0;
  font-family: "Fredoka", sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
}

.pcc-modal .pcc-modal__close {
  top: 14px;
  right: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.pcc-modal .pcc-modal__close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.pcc-modal .pcc-modal__body {
  padding: 20px 26px 24px;
}

.pcc-modal .pcc-modal__recap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 3px 10px rgba(15, 110, 99, 0.08);
}

.pcc-modal .pcc-modal__thumb {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: #22af9c;
  background: #ddf3ee;
  border-radius: 14px;
}

.pcc-modal .pcc-modal__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pcc-modal .pcc-modal__name {
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #111;
}

.pcc-modal .pcc-modal__detail {
  font-size: 0.85rem;
  color: #4a5a58;
}

.pcc-modal .pcc-modal__total {
  margin-left: auto;
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
  color: var(--pcc-green);
}

.pcc-modal .pcc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pcc-modal .pcc-modal__btn {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--pcc-green);
  background: transparent;
  border: 1.5px solid var(--pcc-green);
  border-radius: 99px;
  box-shadow: none;
  cursor: pointer;
}

.pcc-modal .pcc-modal__btn:hover {
  color: #fff;
  background: var(--pcc-green);
}

.pcc-modal .pcc-modal__btn--primary,
.pcc-modal .pcc-modal__btn--primary:visited {
  color: #2d2d00;
  background: #c6c20e;
  border: 0;
  box-shadow: 0 3px 0 #9a9708;
}

.pcc-modal .pcc-modal__btn--primary:hover {
  color: #2d2d00;
  background: #d4cf12;
}
