/* BEM Category Page Modern - v1.0.0
   Habillage moderne et dynamique de la page catégorie racine "Accueil" (id_category 2) :
   en-tête, menu des catégories, grille de sous-catégories.
   Toutes les règles sont préfixées body.category-id-2 par sécurité.
*/
body.category-id-2 {
  --bcp-green: var(--bem-green, #65bc46);
  --bcp-green-dark: var(--bem-green-dark, #4a9433);
  --bcp-green-light: var(--bem-green-light, #eaf6e4);
  --bcp-black: var(--bem-black, #1b1f1a);
  --bcp-gray: #6b7280;
}

/* ---------- En-tête de la page ---------- */
body.category-id-2 #js-product-list-header .block-category {
  position: relative;
  overflow: hidden;
  padding: 36px 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--bcp-green-light), #fff 65%);
  border: 1px solid rgba(101, 188, 70, .18);
  box-shadow: 0 10px 26px rgba(101, 188, 70, .08);
}
body.category-id-2 #js-product-list-header .block-category::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(101, 188, 70, .16), transparent 70%);
  pointer-events: none;
}
body.category-id-2 #js-product-list-header .block-category h1.h1 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 26px;
  font-weight: 800;
  color: var(--bcp-black);
  margin: 0;
  letter-spacing: -.01em;
}
body.category-id-2 #js-product-list-header .block-category h1.h1::before {
  content: '';
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bcp-green), var(--bcp-green-dark));
  box-shadow: 0 8px 18px rgba(101, 188, 70, .32);
  -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0zIDExLjUgMTIgNGw5IDcuNSIvPjxwYXRoIGQ9Ik01IDEwdjEwaDE0VjEwIi8+PHBhdGggZD0iTTkgMjB2LTZoNnY2Ii8+PC9zdmc+");
  mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0zIDExLjUgMTIgNGw5IDcuNSIvPjxwYXRoIGQ9Ik01IDEwdjEwaDE0VjEwIi8+PHBhdGggZD0iTTkgMjB2LTZoNnY2Ii8+PC9zdmc+");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 24px;
  mask-size: 24px;
  background-color: transparent;
}
body.category-id-2 #js-product-list-header .block-category h1.h1::after {
  content: '';
  position: absolute;
  left: 60px;
  bottom: -12px;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bcp-green), var(--bcp-green-dark));
}

/* ---------- Menu des catégories (sidebar) ---------- */
body.category-id-2 .category-top-menu {
  padding: 6px 4px;
}
body.category-id-2 .category-top-menu > li > a.text-uppercase.h6 {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: .03em;
  color: var(--bcp-black);
  background: var(--bcp-green-light);
}
body.category-id-2 .category-sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
body.category-id-2 .category-sub-menu .category-sub-menu {
  padding-left: 14px;
  margin-top: 2px;
  margin-bottom: 6px;
  border-left: 2px solid var(--bcp-green-light);
}
body.category-id-2 .category-sub-menu li {
  position: relative;
}
body.category-id-2 a.category-sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--bcp-gray);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .2s ease, color .2s ease, padding-left .2s ease, border-color .2s ease;
}
body.category-id-2 a.category-sub-link::before {
  content: '';
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bcp-green);
  opacity: .55;
  transition: opacity .2s ease, transform .2s ease;
}
body.category-id-2 a.category-sub-link:hover {
  background: var(--bcp-green-light);
  color: var(--bcp-green-dark);
  padding-left: 16px;
  border-left-color: var(--bcp-green);
}
body.category-id-2 a.category-sub-link:hover::before {
  opacity: 1;
  transform: scale(1.3);
}
body.category-id-2 .navbar-toggler.collapse-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin-right: 4px;
  transition: background .2s ease;
}
body.category-id-2 .navbar-toggler.collapse-icons:hover {
  background: var(--bcp-green-light);
}
body.category-id-2 .navbar-toggler.collapse-icons i {
  font-size: 18px;
  color: var(--bcp-green-dark);
}

/* ---------- Grille de sous-catégories ---------- */
/* Neutralise le bug d'affichage existant (opacity bloquée à 0 par l'ancien
   script de reveal au scroll, qui ne se déclenche pas sur cette page) et
   restyle la liste en grille de cartes modernes. */
body.category-id-2 #subcategories.bem-reveal {
  opacity: 1 !important;
  transform: none !important;
}
body.category-id-2 #subcategories {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-top: 8px;
}
body.category-id-2 .subcategory-heading {
  font-size: 20px;
  font-weight: 800;
  color: var(--bcp-black);
  margin: 0 0 22px;
  position: relative;
  padding-bottom: 12px;
}
body.category-id-2 .subcategory-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bcp-green), var(--bcp-green-dark));
}
body.category-id-2 .subcategories-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)) !important;
  gap: 18px !important;
}
body.category-id-2 .subcategories-list > li {
  height: auto !important;
  width: auto !important;
  flex: none !important;
  margin: 0 !important;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
body.category-id-2 .subcategories-list > li.bem-cat-in {
  opacity: 1;
  transform: translateY(0);
}
body.category-id-2 .subcategory-image {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(27, 31, 26, .07);
  box-shadow: 0 2px 8px rgba(27, 31, 26, .05);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  margin: 0;
}
body.category-id-2 .subcategories-list > li:hover .subcategory-image {
  transform: translateY(-6px);
  box-shadow: 0 16px 28px rgba(101, 188, 70, .18);
  border-color: rgba(101, 188, 70, .3);
}
body.category-id-2 .subcategory-image a.img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bcp-green-light);
}
body.category-id-2 .subcategory-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
body.category-id-2 .subcategories-list > li:hover .subcategory-image img {
  transform: scale(1.08);
}
/* Catégories sans photo réelle (logo générique par défaut) : icône neutre à la place */
body.category-id-2 .subcategory-image.bem-no-photo img {
  display: none;
}
body.category-id-2 .subcategory-image.bem-no-photo a.img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bcp-green-light), #fff);
}
body.category-id-2 .subcategory-image.bem-no-photo a.img::before {
  content: '';
  width: 40%;
  height: 40%;
  max-width: 52px;
  max-height: 52px;
  background: linear-gradient(135deg, var(--bcp-green), var(--bcp-green-dark));
  -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yMSA4IDEyIDMgMyA4bDkgNSA5LTV6Ii8+PHBhdGggZD0iTTMgOHY4bDkgNSA5LTVWOCIvPjxwYXRoIGQ9Ik0xMiAxM3Y4Ii8+PC9zdmc+");
  mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik0yMSA4IDEyIDMgMyA4bDkgNSA5LTV6Ii8+PHBhdGggZD0iTTMgOHY4bDkgNSA5LTVWOCIvPjxwYXRoIGQ9Ik0xMiAxM3Y4Ii8+PC9zdmc+");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
body.category-id-2 .subcategories-list > li > h5 {
  margin: 0;
  padding: 12px 8px 0;
  text-align: center;
}
body.category-id-2 .subcategories-list > li > h5 a.subcategory-name {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--bcp-black);
  transition: color .2s ease;
}
body.category-id-2 .subcategories-list > li:hover .subcategory-name {
  color: var(--bcp-green-dark);
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  body.category-id-2 .subcategories-list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  body.category-id-2 #js-product-list-header .block-category {
    padding: 24px 20px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body.category-id-2 .subcategories-list > li {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
