/* Start custom CSS for page-settings *//* =========================================================
   CATEGORIE CASH EXPERT
   - titres masqués
   - sous-catégories compactes
   - barre de tri modernisée
   - tri aligné à droite
   - correction quand il n'y a pas d'articles
========================================================= */

/* =========================
   MASQUER LES TITRES
========================= */
body#category h1,
body#category .h1,
body#category .page-title,
body#category #js-product-list-header h1,
body#category #js-product-list-header .h1,
body#category .block-category h1,
body#category .block-category .h1{
  display:none !important;
}

body#category .subcategories h2,
body#category #subcategories h2,
body#category .subcategories-title,
body#category .subcategory-heading,
body#category .block-category + .subcategories h2,
body#category .block-category + #subcategories h2{
  display:none !important;
}

/* =========================
   BLOC SOUS-CATEGORIES
========================= */
body#category .subcategories,
body#category #subcategories,
body#category .block-category + .subcategories{
  margin:10px auto 22px !important;
  padding:0 !important;
}

body#category .subcategories ul,
body#category #subcategories ul{
  list-style:none !important;
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  gap:10px 12px !important;
  margin:0 !important;
  padding:0 !important;
}

body#category .subcategories li,
body#category #subcategories li{
  margin:0 !important;
  padding:0 !important;
  width:auto !important;
  min-width:138px !important;
  flex:0 0 auto !important;
}

body#category .subcategories li .subcategory-image,
body#category #subcategories li .subcategory-image,
body#category .subcategories li .cat_desc,
body#category #subcategories li .cat_desc,
body#category .subcategories li img,
body#category #subcategories li img{
  display:none !important;
}

body#category .subcategories li a,
body#category #subcategories li a{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:42px !important;
  padding:0 16px !important;
  border-radius:14px !important;
  background:#ffffff !important;
  border:1px solid #d8e0ea !important;
  box-shadow:0 3px 10px rgba(17,24,39,.04) !important;
  color:#111827 !important;
  font-size:14px !important;
  font-weight:800 !important;
  line-height:1 !important;
  text-align:center !important;
  text-decoration:none !important;
  letter-spacing:.01em !important;
  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    transform .2s ease,
    box-shadow .2s ease !important;
}

body#category .subcategories li a:hover,
body#category .subcategories li a:focus,
body#category #subcategories li a:hover,
body#category #subcategories li a:focus{
  background:#0aa132 !important;
  border-color:#0aa132 !important;
  color:#ffffff !important;
  transform:translateY(-1px) !important;
  box-shadow:0 8px 18px rgba(10,161,50,.18) !important;
}

body#category .subcategories li.current a,
body#category .subcategories li.current-categorie a,
body#category #subcategories li.current a,
body#category #subcategories li.current-categorie a{
  background:#0aa132 !important;
  border-color:#0aa132 !important;
  color:#ffffff !important;
}

/* =========================
   BARRE DE TRI / OUTILS
========================= */
body#category #js-product-list-top,
body#category .products-selection{
  background:#ffffff !important;
  border:1px solid #dde5ee !important;
  border-radius:16px !important;
  box-shadow:0 4px 14px rgba(17,24,39,.04) !important;
  padding:10px 14px !important;
  margin:22px 0 18px !important;
}

body#category #js-product-list-top .row,
body#category .products-selection .row{
  display:flex !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
}

body#category .products-selection .display,
body#category #js-product-list-top .display{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  margin:0 !important;
}

body#category .products-selection .display li,
body#category #js-product-list-top .display li{
  margin:0 !important;
}

body#category .products-selection .display a,
body#category #js-product-list-top .display a{
  width:38px !important;
  height:38px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  border:1px solid #d8e0ea !important;
  border-radius:10px !important;
  background:#ffffff !important;
  color:#111827 !important;
  transition:all .2s ease !important;
}

body#category .products-selection .display a:hover,
body#category #js-product-list-top .display a:hover,
body#category .products-selection .display .selected a,
body#category #js-product-list-top .display .selected a{
  background:#0aa132 !important;
  border-color:#0aa132 !important;
  color:#ffffff !important;
}

body#category .products-sort-order,
body#category .sort-by-row,
body#category .products-selection .sort-by-row,
body#category #js-product-list-top .products-sort-order{
  margin-left:auto !important;
}

body#category .products-selection > .row > div:last-child,
body#category #js-product-list-top > .row > div:last-child{
  margin-left:auto !important;
}

body#category .products-selection .sort-by,
body#category #js-product-list-top .sort-by{
  color:#5b6472 !important;
  font-size:14px !important;
  font-weight:700 !important;
  margin-right:10px !important;
  white-space:nowrap !important;
}

body#category .products-selection .select-title,
body#category #js-product-list-top .select-title,
body#category .products-selection .dropdown-toggle,
body#category #js-product-list-top .dropdown-toggle,
body#category .products-selection select,
body#category #js-product-list-top select{
  min-height:42px !important;
  border-radius:12px !important;
  border:1px solid #d8e0ea !important;
  background:#f8fafc !important;
  color:#111827 !important;
  font-size:14px !important;
  font-weight:700 !important;
  box-shadow:none !important;
}

body#category .products-selection .dropdown-toggle,
body#category #js-product-list-top .dropdown-toggle{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  padding:0 14px !important;
  min-width:220px !important;
}

body#category .products-selection .dropdown-menu,
body#category #js-product-list-top .dropdown-menu{
  border:1px solid #dde5ee !important;
  border-radius:12px !important;
  box-shadow:0 10px 24px rgba(17,24,39,.08) !important;
  overflow:hidden !important;
}

body#category .products-selection .dropdown-menu a,
body#category #js-product-list-top .dropdown-menu a{
  font-size:14px !important;
  font-weight:600 !important;
  color:#111827 !important;
  padding:10px 14px !important;
}

body#category .products-selection .dropdown-menu a:hover,
body#category #js-product-list-top .dropdown-menu a:hover{
  background:#f0fdf4 !important;
  color:#0aa132 !important;
}

/* =========================
   CORRECTION SANS PRODUITS
========================= */

/* masque complètement la barre vide quand aucun produit */
body#category .js-product-list-top:empty,
body#category #js-product-list-top:empty,
body#category .products-selection:empty{
  display:none !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  box-shadow:none !important;
}

/* si la catégorie contient le message "aucun produit", on supprime la barre du haut */
body#category #js-product-list:has(.alert-warning) #js-product-list-top,
body#category #js-product-list:has(.products-not-found) #js-product-list-top,
body#category #js-product-list:has(.no-products) #js-product-list-top{
  display:none !important;
}

/* remonte les sous-catégories si la barre disparaît */
body#category #js-product-list-top + .subcategories,
body#category #js-product-list-top + #subcategories{
  margin-top:10px !important;
}

/* nettoie le bloc message */
body#category .alert-warning,
body#category .notification-warning,
body#category .products-not-found,
body#category .no-products{
  margin-top:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
}

/* sécurité */
body#category .products:empty,
body#category #js-product-list .products:empty{
  display:none !important;
}

/* =========================
   MOBILE
========================= */
@media (max-width:991px){
  body#category .subcategories ul,
  body#category #subcategories ul{
    gap:8px !important;
  }

  body#category .subcategories li,
  body#category #subcategories li{
    min-width:calc(50% - 4px) !important;
  }

  body#category .subcategories li a,
  body#category #subcategories li a{
    min-height:40px !important;
    font-size:13px !important;
    padding:0 12px !important;
    border-radius:12px !important;
  }

  body#category #js-product-list-top,
  body#category .products-selection{
    padding:10px !important;
    border-radius:14px !important;
  }

  body#category .products-selection .dropdown-toggle,
  body#category #js-product-list-top .dropdown-toggle{
    min-width:180px !important;
  }
}

@media (max-width:575px){
  body#category .subcategories li,
  body#category #subcategories li{
    min-width:calc(50% - 4px) !important;
  }

  body#category .products-selection .sort-by,
  body#category #js-product-list-top .sort-by{
    font-size:13px !important;
  }

  body#category .products-selection .dropdown-toggle,
  body#category #js-product-list-top .dropdown-toggle{
    min-width:150px !important;
  }
}/* End custom CSS */