/* Allani UI hotfix layer - loaded after allani-final.css */

/* --- Product image reliability --- */
article.js-product-miniature,
.ajax_block_product,
.product-miniature {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  float: none !important;
}

article.js-product-miniature .product-container,
.ajax_block_product .product-container,
.product-miniature .product-container {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

article.js-product-miniature .left-block,
article.js-product-miniature .right-block,
.ajax_block_product .left-block,
.ajax_block_product .right-block {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}

article.js-product-miniature .product-image-container,
article.js-product-miniature .thumbnail-container,
.ajax_block_product .product-image-container,
.product-miniature .product-image-container,
.product-miniature .thumbnail-container {
  min-height: 250px !important;
  height: 250px !important;
  max-height: 250px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  background: #fff !important;
}

article.js-product-miniature .product-image-container > a,
article.js-product-miniature .thumbnail-container > a,
.ajax_block_product .product-image-container > a,
.product-miniature .product-image-container > a {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

article.js-product-miniature img,
.ajax_block_product img,
.product-miniature img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* --- Home blocks: Selection du mois + Meilleures ventes --- */
body#index #dorTopProductCategory .product_list,
body#index #dorTopProductCategory2 .product_list,
body#index #dor-tab-product-category .product_list,
body#index #dor-tab-product-category .content-data-lists > .product_list,
body#index #dorTopProductCategory .allani-flat-carousel,
body#index #dorTopProductCategory2 .allani-flat-carousel,
body#index #dor-tab-product-category .allani-flat-carousel {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 22px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  transform: none !important;
  left: auto !important;
}

body#index #dorTopProductCategory .product_list > *,
body#index #dorTopProductCategory2 .product_list > *,
body#index #dor-tab-product-category .product_list > *,
body#index #dorTopProductCategory .allani-flat-carousel > *,
body#index #dorTopProductCategory2 .allani-flat-carousel > *,
body#index #dor-tab-product-category .allani-flat-carousel > * {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

body#index #dorTopProductCategory .owl-stage-outer,
body#index #dorTopProductCategory2 .owl-stage-outer,
body#index #dor-tab-product-category .owl-stage-outer,
body#index #dorTopProductCategory .owl-wrapper-outer,
body#index #dorTopProductCategory2 .owl-wrapper-outer,
body#index #dor-tab-product-category .owl-wrapper-outer,
body#index #dorTopProductCategory .owl-controls,
body#index #dorTopProductCategory2 .owl-controls,
body#index #dor-tab-product-category .owl-controls,
body#index #dorTopProductCategory .owl-nav,
body#index #dorTopProductCategory2 .owl-nav,
body#index #dor-tab-product-category .owl-nav,
body#index #dorTopProductCategory .owl-dots,
body#index #dorTopProductCategory2 .owl-dots,
body#index #dor-tab-product-category .owl-dots {
  display: none !important;
}

/* --- Product page: Related sections should never be one card per line --- */
body#product .featured-products .products,
body#product .featured-products .product_list,
body#product .allani-hook-related-products .products,
body#product .allani-hook-related-products .product_list,
body#product .allani-hook-related-brand .products,
body#product .allani-hook-related-brand .product_list,
body#product .allani-hook-block .products,
body#product .allani-hook-block .product_list,
body#product .allani-hook-block .allani-flat-carousel,
body#product .blockproductscategory .products,
body#product .blockproductscategory .product_list,
body#product .blockproductscategory .allani-flat-carousel {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 22px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  transform: none !important;
  left: auto !important;
}

body#product .featured-products .products > *,
body#product .featured-products .product_list > *,
body#product .allani-hook-related-products .products > *,
body#product .allani-hook-related-products .product_list > *,
body#product .allani-hook-related-brand .products > *,
body#product .allani-hook-related-brand .product_list > *,
body#product .allani-hook-block .products > *,
body#product .allani-hook-block .product_list > *,
body#product .allani-hook-block .allani-flat-carousel > *,
body#product .blockproductscategory .products > *,
body#product .blockproductscategory .product_list > *,
body#product .blockproductscategory .allani-flat-carousel > * {
  width: auto !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body#product .featured-products > h2,
body#product .allani-hook-related-products > h2,
body#product .allani-hook-related-brand > h2,
body#product .allani-hook-block > h2,
body#product .products-SameCategory {
  display: block !important;
  font-size: 30px !important;
  font-weight: 800 !important;
  color: #1f2c41 !important;
  margin: 0 0 16px !important;
}

/* --- Home SEO text block cleanup --- */
#dor-home-surily .allani-seo-block {
  max-width: 1280px !important;
  margin: 24px auto !important;
  padding: 24px 28px !important;
  border-radius: 16px !important;
  border: 1px solid #e5d8bf !important;
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(20, 44, 77, 0.12) !important;
}

#dor-home-surily .allani-seo-block,
#dor-home-surily .allani-seo-block p,
#dor-home-surily .allani-seo-block span,
#dor-home-surily .allani-seo-block div {
  color: #263954 !important;
  font-size: 18px !important;
  line-height: 1.7 !important;
  font-weight: 500 !important;
}

#dor-home-surily .allani-seo-block [style*="red"],
#dor-home-surily .allani-seo-block font[color="red"] {
  color: #b58a2f !important;
  font-weight: 700 !important;
}

/* --- Blog home card cleanup (remove fake/demo metadata look) --- */
#smartblog-latest-news .sds_post_author,
#smartblog-latest-news .author-name-blog-home,
#smartblog-latest-news .author-name,
#smartblog-latest-news .sds_post_content,
#smartblog-latest-news .smartblog-desc,
#smartblog-latest-news .desc,
#smartblog-latest-news .post_description,
.smartblog-latest-news .sds_post_author,
.smartblog-latest-news .author-name-blog-home,
.smartblog-latest-news .author-name,
.smartblog-latest-news .sds_post_content,
.smartblog-latest-news .smartblog-desc,
.smartblog-latest-news .desc,
.smartblog-latest-news .post_description {
  display: none !important;
}

#smartblog-latest-news .item,
#smartblog-latest-news .sds_blog_post,
.smartblog-latest-news .item,
.smartblog-latest-news .sds_blog_post {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* --- Partner section under logos: align columns --- */
body#index .dor-bizproduct-wrapper > .container > .row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 24px !important;
  align-items: start !important;
}

body#index .dor-bizproduct-wrapper > .container > .row > [class*="col-"] {
  width: auto !important;
  max-width: none !important;
  float: none !important;
}

body#index .dor-bizproduct-wrapper .product_list,
body#index .dor-bizproduct-wrapper .products {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 16px !important;
}

/* --- Responsive --- */
@media (max-width: 1360px) {
  body#index #dorTopProductCategory .product_list,
  body#index #dorTopProductCategory2 .product_list,
  body#index #dor-tab-product-category .product_list,
  body#index #dor-tab-product-category .content-data-lists > .product_list,
  body#index #dorTopProductCategory .allani-flat-carousel,
  body#index #dorTopProductCategory2 .allani-flat-carousel,
  body#index #dor-tab-product-category .allani-flat-carousel,
  body#product .featured-products .products,
  body#product .featured-products .product_list,
  body#product .allani-hook-related-products .products,
  body#product .allani-hook-related-products .product_list,
  body#product .allani-hook-related-brand .products,
  body#product .allani-hook-related-brand .product_list,
  body#product .allani-hook-block .products,
  body#product .allani-hook-block .product_list,
  body#product .allani-hook-block .allani-flat-carousel,
  body#product .blockproductscategory .products,
  body#product .blockproductscategory .product_list,
  body#product .blockproductscategory .allani-flat-carousel {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 991px) {
  body#index #dorTopProductCategory .product_list,
  body#index #dorTopProductCategory2 .product_list,
  body#index #dor-tab-product-category .product_list,
  body#index #dor-tab-product-category .content-data-lists > .product_list,
  body#index #dorTopProductCategory .allani-flat-carousel,
  body#index #dorTopProductCategory2 .allani-flat-carousel,
  body#index #dor-tab-product-category .allani-flat-carousel,
  body#product .featured-products .products,
  body#product .featured-products .product_list,
  body#product .allani-hook-related-products .products,
  body#product .allani-hook-related-products .product_list,
  body#product .allani-hook-related-brand .products,
  body#product .allani-hook-related-brand .product_list,
  body#product .allani-hook-block .products,
  body#product .allani-hook-block .product_list,
  body#product .allani-hook-block .allani-flat-carousel,
  body#product .blockproductscategory .products,
  body#product .blockproductscategory .product_list,
  body#product .blockproductscategory .allani-flat-carousel,
  body#index .dor-bizproduct-wrapper > .container > .row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 639px) {
  body#index #dorTopProductCategory .product_list,
  body#index #dorTopProductCategory2 .product_list,
  body#index #dor-tab-product-category .product_list,
  body#index #dor-tab-product-category .content-data-lists > .product_list,
  body#index #dorTopProductCategory .allani-flat-carousel,
  body#index #dorTopProductCategory2 .allani-flat-carousel,
  body#index #dor-tab-product-category .allani-flat-carousel,
  body#product .featured-products .products,
  body#product .featured-products .product_list,
  body#product .allani-hook-related-products .products,
  body#product .allani-hook-related-products .product_list,
  body#product .allani-hook-related-brand .products,
  body#product .allani-hook-related-brand .product_list,
  body#product .allani-hook-block .products,
  body#product .allani-hook-block .product_list,
  body#product .allani-hook-block .allani-flat-carousel,
  body#product .blockproductscategory .products,
  body#product .blockproductscategory .product_list,
  body#product .blockproductscategory .allani-flat-carousel,
  body#index .dor-bizproduct-wrapper > .container > .row {
    grid-template-columns: 1fr !important;
  }
}
