/* ==========================================================================
   School of Cool - grille des archives produit
   Corrige le chevauchement du bloc d'action sur le titre, aligne les cartes
   et rend la grille lisible sur mobile. Charte : angles droits, panneau
   #1A202C, filet #2D3748, encre secondaire #A0AEC0.
   Cree le 2026-09-08.
   ========================================================================== */

.soc-grille ul.products {
  display: grid;
  gap: 22px 18px;
  align-items: stretch;
}

/* ---------- La carte ---------- */
.soc-grille ul.products li.product {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #1A202C;
  border: 1px solid #2D3748;
  border-radius: 0;
  box-shadow: none;
  transition: border-color .25s ease, transform .25s ease;
}
.soc-grille ul.products li.product:hover {
  border-color: #F15A1A;
  transform: translateY(-3px);
}

/* ---------- Le visuel ---------- */
.soc-grille ul.products li.product > a.woocommerce-loop-image-link {
  display: block;
  position: relative;
  margin: 0;
  background: #FFFFFF;
}
.soc-grille ul.products li.product .product-image,
.soc-grille ul.products li.product > a.woocommerce-loop-image-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  background: #FFFFFF;
  border-radius: 0;
  transition: transform .5s ease;
}
.soc-grille ul.products li.product:hover > a.woocommerce-loop-image-link img {
  transform: scale(1.04);
}

/* ---------- Le bloc texte ----------
   Kadence remonte ce bloc de 60 px sur l'image : on annule, sinon le titre
   passe sur la photo et la hauteur des cartes devient impossible a aligner. */
.soc-grille ul.products li.product .product-details {
  position: static;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  margin: 0 !important;
  padding: 14px 14px 16px;
  background: #1A202C;
  border-radius: 0;
  box-shadow: none;
}

/* ---------- Le titre : deux lignes, hauteur constante ---------- */
.soc-grille ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  padding: 0;
  min-height: 4.05em;
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  color: #FFFFFF;
}
.soc-grille ul.products li.product .woocommerce-loop-product__title a {
  color: inherit;
  text-decoration: none;
}
.soc-grille ul.products li.product:hover .woocommerce-loop-product__title {
  color: #F15A1A;
}

/* ---------- Le prix, cale en bas du bloc texte ---------- */
.soc-grille ul.products li.product .price {
  margin: auto 0 0;
  padding: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
  color: #F15A1A;
}
.soc-grille ul.products li.product .price del { color: #A0AEC0; font-weight: 400; font-size: .85em; }
.soc-grille ul.products li.product .price ins { text-decoration: none; }
.soc-grille ul.products li.product .woocommerce-price-suffix {
  display: block;
  margin-top: 2px;
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #A0AEC0;
}
/* ---------- Le bloc d'action ----------
   Il etait en position absolue par-dessus le titre et le prix, revele au
   survol : sur ordinateur le texte devenait illisible, sur mobile le bouton
   n'apparaissait jamais. On le remet dans le flux, toujours visible. */
.soc-grille ul.products li.product .product-action-wrap {
  position: static !important;
  inset: auto !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: auto;
  margin: 10px 0 0;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  background: none;
  pointer-events: auto;
}

/* Le message de fidelite n'a pas sa place dans une vignette : il repasse sur
   la fiche produit, ou il est lisible. */
.soc-grille ul.products li.product .wlr-product-message,
.soc-grille ul.products li.product .wlr_product_message,
.soc-grille ul.products li.product .wlr-earn-message {
  display: none !important;
}

.soc-grille ul.products li.product .button,
.soc-grille ul.products li.product .added_to_cart {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 12px;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
  border-radius: 0;
  box-shadow: none;
  transition: background-color .2s ease;
}
.soc-grille ul.products li.product .added_to_cart {
  margin-top: 6px;
  background: transparent;
  border: 1px solid #2D3748;
  color: #A0AEC0;
}
.soc-grille ul.products li.product .added_to_cart:hover {
  border-color: #F15A1A;
  color: #FFFFFF;
}
.soc-grille ul.products li.product .button.loading { opacity: .7; }

/* Badges promo et rupture : au-dessus du visuel, jamais sur le texte */
.soc-grille ul.products li.product .onsale,
.soc-grille ul.products li.product .kadence-sale-flash {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  margin: 0;
  padding: 4px 9px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 0;
  background: #F15A1A;
  color: #FFFFFF;
}

/* ---------- Vignettes de sous-categorie ----------
   Le theme sert des miniatures 250x250 avec object-fit: fill, ce qui etire les
   visuels non carres et donne des tuiles de 167 a 211 px de haut. On impose un
   cadre carre, un recadrage sans deformation et une hauteur commune. */
.soc-grille ul.products li.product-category > a {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.soc-grille ul.products li.product-category img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover !important;
  object-position: center;
  background: #0F1115;
  border-radius: 0;
  transition: transform .5s ease;
}
.soc-grille ul.products li.product-category:hover img { transform: scale(1.04); }
.soc-grille ul.products li.product-category .product-details {
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  min-height: 76px;
}
.soc-grille ul.products li.product-category h2,
.soc-grille ul.products li.product-category .woocommerce-loop-category__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
  color: #FFFFFF;
}
.soc-grille ul.products li.product-category .count {
  display: block;
  margin-top: 4px;
  padding: 0;
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #A0AEC0;
  background: none;
}
/* ---------- Colonnes ----------
   Le nombre de colonnes reste celui configure dans Elementor par le site :
   on ne le surcharge pas au-dessus de 768 px. Seul le palier telephone est
   impose, car la regle d'origine descendait a une seule colonne. */

/* ---------- Telephones ---------- */
@media (max-width: 767px) {
  .soc-grille .elementor-widget-wc-archive-products ul.products,
  .soc-grille ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .soc-grille ul.products li.product .product-details {
    padding: 10px 10px 12px;
    gap: 6px;
  }
  .soc-grille ul.products li.product .woocommerce-loop-product__title {
    font-size: .82rem;
    line-height: 1.3;
    min-height: 3.9em;
    -webkit-line-clamp: 3;
  }
  .soc-grille ul.products li.product .price { font-size: .92rem; }
  .soc-grille ul.products li.product .woocommerce-price-suffix { font-size: .62rem; }
  .soc-grille ul.products li.product .button,
  .soc-grille ul.products li.product .added_to_cart {
    /* 44 px minimum : cible tactile confortable au pouce */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: .72rem;
    letter-spacing: .04em;
  }
  .soc-grille ul.products li.product:hover { transform: none; }
  .soc-grille ul.products li.product:hover > a.woocommerce-loop-image-link img { transform: none; }
}

@media (max-width: 380px) {
  .soc-grille ul.products { gap: 12px 8px; }
  .soc-grille ul.products li.product .woocommerce-loop-product__title { font-size: .78rem; }
  .soc-grille ul.products li.product .button { font-size: .68rem; padding: 8px 5px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .soc-grille ul.products li.product,
  .soc-grille ul.products li.product img,
  .soc-grille ul.products li.product .button { transition: none !important; }
  .soc-grille ul.products li.product:hover { transform: none; }
  .soc-grille ul.products li.product:hover > a.woocommerce-loop-image-link img { transform: none; }
}
/* ---------- soc-vignette-fix : la tuile de sous-categorie occupe toute la cellule ----------
   Le lien etait dimensionne par la largeur intrinseque de la miniature (250 px)
   dans une cellule de 270 px : image decalee, titres non alignes, hauteurs inegales. */
.soc-grille ul.products li.product-category {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.soc-grille ul.products li.product-category > a {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto;
}
.soc-grille ul.products li.product-category img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover !important;
}
.soc-grille ul.products li.product-category .product-details {
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
}
