/*
 Theme Name:   Astra child
 Theme URI:    https://tonsite.com/
 Description:  Thème enfant de Twenty Twenty-Five
 Author:       Ton nom
 Author URI:   https://tonsite.com/
 Template:     astra
 Version:      1.0.0
*/

/* Ici tu pourras ajouter ton CSS personnalisé */


.dl-cat-icons{display:flex;flex-wrap:wrap;gap:.5rem;margin:.75rem 0;padding:0;list-style:none}
.dl-cat-icon{border-radius:6px;display:block}
.dl-cat-icon__link{display:inline-block;line-height:0}
.dl-cat-icon__name{display:block;font-size:.8rem;margin-top:.25rem;text-align:center}





/* ===== Sous-catégories WooCommerce (Elementor) ===== */
/* Classe à mettre sur le widget : dl-subcats */

/* Grille : neutralise les styles par défaut */
.dl-subcats .woocommerce ul.products{
  list-style:none !important;
  margin:0 !important;
  padding:0 !important;
  display:grid !important;
  gap:30px !important;
  grid-template-columns: 1fr !important; /* mobile par défaut */
}
.dl-subcats .woocommerce ul.products li.product-category{
  width:auto !important;
  float:none !important;
  margin:0 !important;
  padding:0 !important;
  position:relative;
  overflow:hidden;
  border-radius:15px;
  box-shadow:0 8px 25px rgba(0,0,0,0.08);
  transition:all .4s cubic-bezier(.25,.46,.45,.94);
  background:#fff;
  border:1px solid rgba(0,0,0,.05);
}

/* Grille responsive : 2 / 3 / 4 / 5 colonnes */
@media (min-width: 480px){
  .dl-subcats .woocommerce ul.products{
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (min-width: 768px){
  .dl-subcats .woocommerce ul.products{
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (min-width: 1024px){
  .dl-subcats .woocommerce ul.products{
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
@media (min-width: 1200px){
  .dl-subcats .woocommerce ul.products{
    grid-template-columns: repeat(5, 1fr) !important; /* 5 colonnes desktop */
  }
}

/* Carte */
.dl-subcats .product-category:hover{
  transform:translateY(-8px);
  box-shadow:0 20px 40px rgba(0,0,0,0.15);
  border-color:rgba(0,123,255,0.2);
}
.dl-subcats .product-category a{
  display:block !important;
  text-decoration:none;
  color:inherit;
  position:relative;
  height:100%;
  min-height:180px !important; /* compact */
  overflow:hidden;
}

/* Image (hauteur réduite) */
.dl-subcats .product-category img{
  width:100% !important;
  height: auto !important;               /* plus de hauteur fixe */
  aspect-ratio: 1300 / 870;             /* ratio exact de vos images */
  object-fit: contain !important;
  object-position:center !important;
  transition:transform .4s ease;
  border-radius:15px 15px 0 0;
  display:block !important;
  max-width:none !important;
  background: #fff;
}
.dl-subcats .product-category:hover img{ transform:scale(1.05); }

/* Titre (police réduite + zone compacte) */
.dl-subcats .woocommerce ul.products li.product-category .woocommerce-loop-category__title{
  position:absolute;
  bottom:0; left:0; right:0;
  margin:0;
  padding:12px 14px;
  background:rgba(255,255,255,0.95);
  backdrop-filter:blur(10px);
  border-top:1px solid rgba(255,255,255,0.2);
  font-size:13px !important;   /* taille du titre */
  line-height:1.2 !important;
  font-weight:600;
  color:#2c3e50;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:.4px;
}

/* Badge décoratif */
.dl-subcats .product-category::before{
  content:'';
  position:absolute; top:15px; right:15px;
  width:8px; height:8px;
  background:#5F9868;
  border-radius:50%;
  z-index:2;
  box-shadow:0 0 10px rgba(95,152,104,0.3);
  transition:all .3s ease;
}
.dl-subcats .product-category:hover::before{
  transform:scale(1.5);
  box-shadow:0 0 20px rgba(95,152,104,0.6);
}

/* Responsive (police et hauteurs adaptées) */
@media (max-width: 768px){
  .dl-subcats .product-category a{ min-height:170px !important; }
  .dl-subcats .product-category img{ height:100px !important; }
  .dl-subcats .woocommerce ul.products li.product-category .woocommerce-loop-category__title{
    font-size:12.5px !important;
    padding:10px 12px;
  }
}
@media (max-width: 480px){
  .dl-subcats .product-category a{ min-height:160px !important; }
  .dl-subcats .product-category img{ height:90px !important; }
}

/* Animation d'apparition */
@keyframes fadeInUp{
  from{ opacity:0; transform:translateY(30px); }
  to{ opacity:1; transform:translateY(0); }
}
.dl-subcats .product-category{
  animation:fadeInUp .6s ease-out;
  animation-fill-mode:both;
}
.dl-subcats .product-category:nth-child(1){ animation-delay:.1s; }
.dl-subcats .product-category:nth-child(2){ animation-delay:.2s; }
.dl-subcats .product-category:nth-child(3){ animation-delay:.3s; }
.dl-subcats .product-category:nth-child(4){ animation-delay:.4s; }

/* Variante overlay (optionnelle) : ajoute la classe overlay-style au widget */
.dl-subcats.overlay-style .product-category::after{
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(135deg, rgba(0,123,255,.8) 0%, rgba(40,167,69,.8) 100%);
  opacity:0; transition:opacity .3s ease;
  border-radius:15px;
}
.dl-subcats.overlay-style .product-category:hover::after{ opacity:1; }
.dl-subcats.overlay-style .product-category:hover .woocommerce ul.products li.product-category .woocommerce-loop-category__title{
  background:transparent; z-index:3; position:relative;
}





/* Design les normes sur fiche produits */
.acf-normes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.acf-norme-tag {
    background-color: #5F9769;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.acf-norme-tag:hover {
    background-color: #518259;
}



/* Cacher les boutons si l'ACF est vide (pas de href ou href vide) */
a#telecharger_brochure:not([href]),
a#telecharger_brochure[href=""],
a#visualiser_utilisation:not([href]),
a#visualiser_utilisation[href=""],
/* sécurité si un # ou du js est inséré par un widget */
a#telecharger_brochure[href="#"],
a#visualiser_utilisation[href="#"],
a#telecharger_brochure[href^="javascript"],
a#visualiser_utilisation[href^="javascript"]{
  display: none !important;
}




/* Images page categ */
.rtsb-product-img figure {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rtsb-product-img figure img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  background: #fff;
}