/* BPM SHOP DESIGN — Archives catégories produit uniquement.
   La logique WooCommerce / ShopLentor n'est pas modifiée. */

/* Toujours conserver les éléments SEO de l'archive. */
body.bpm-shop-design-active.bpm-product-archive .woocommerce-products-header,
body.bpm-shop-design-active.bpm-product-archive .woocommerce-products-header__title,
body.bpm-shop-design-active.bpm-product-archive .page-title,
body.bpm-shop-design-active.bpm-product-archive .wl-archive-title,
body.bpm-shop-design-active.bpm-product-archive .woolentor-archive-title,
body.bpm-shop-design-active.bpm-product-archive .woocommerce-breadcrumb{
    visibility:visible!important;
    opacity:1!important;
}

/* Le hero/slideshow historique ShopLentor est supprimé sur les catégories seulement. */
body.bpm-shop-design-active.bpm-product-archive .elementor-element:has(> .elementor-background-slideshow){
    display:none!important;
    height:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
}
body.bpm-shop-design-active.bpm-product-archive .elementor-background-slideshow,
body.bpm-shop-design-active.bpm-product-archive .elementor-background-slideshow__slide,
body.bpm-shop-design-active.bpm-product-archive .elementor-background-slideshow__slide__image{
    display:none!important;
}

@media (min-width:1025px){
    /* En-tête : compact, sans toucher au contenu H1/breadcrumb. */
    body.bpm-shop-design-active.bpm-product-archive .woocommerce-products-header{
        min-height:0!important;
        margin-bottom:14px!important;
        padding-bottom:0!important;
    }
    body.bpm-shop-design-active.bpm-product-archive .woocommerce-breadcrumb{
        display:block!important;
        margin-top:0!important;
        margin-bottom:18px!important;
        color:#7a7a7a!important;
        font-size:15px!important;
        line-height:1.45!important;
    }

    /* Neutralise les hauteurs parasites des wrappers qui contiennent la liste. */
    body.bpm-shop-design-active.bpm-product-archive .wl-archive-product,
    body.bpm-shop-design-active.bpm-product-archive .elementor-widget-woolentor-product-archive-addons,
    body.bpm-shop-design-active.bpm-product-archive .elementor-widget-wl-product-archive-layout,
    body.bpm-shop-design-active.bpm-product-archive .elementor-widget-woocommerce-products{
        min-height:0!important;
        padding-top:0!important;
    }

    /* Grille : 4 cartes, rectangle 4:3, remontée mesurée pour enlever le grand vide. */
    body.bpm-shop-design-active.bpm-product-archive ul.products,
    body.bpm-shop-design-active.bpm-product-archive .products,
    body.bpm-shop-design-active.bpm-product-archive .woolentor-products,
    body.bpm-shop-design-active.bpm-product-archive .ht-products,
    body.bpm-shop-design-active.bpm-product-archive .wl-products{
        grid-template-columns:repeat(4,minmax(0,1fr))!important;
        grid-auto-rows:1fr!important;
        align-items:stretch!important;
        gap:24px!important;
        margin-top:-58px!important;
        margin-bottom:70px!important;
        padding-top:0!important;
        position:relative!important;
        z-index:2!important;
    }

    body.bpm-shop-design-active.bpm-product-archive ul.products li.product,
    body.bpm-shop-design-active.bpm-product-archive .products .product{
        height:100%!important;
        align-self:stretch!important;
    }
    body.bpm-shop-design-active.bpm-product-archive ul.products li.product img,
    body.bpm-shop-design-active.bpm-product-archive .products .product img{
        width:100%!important;
        aspect-ratio:4/3!important;
        object-fit:cover!important;
    }

    /* Exception faible nombre de produits (1 à 3) :
       ShopLentor conserve davantage d'espace vertical dans certaines archives courtes.
       On remonte seulement ces grilles. Les catégories de 4 produits ou plus restent inchangées. */
    body.bpm-shop-design-active.bpm-product-archive.bpm-archive-few-products ul.products,
    body.bpm-shop-design-active.bpm-product-archive.bpm-archive-few-products .products,
    body.bpm-shop-design-active.bpm-product-archive.bpm-archive-few-products .woolentor-products,
    body.bpm-shop-design-active.bpm-product-archive.bpm-archive-few-products .ht-products,
    body.bpm-shop-design-active.bpm-product-archive.bpm-archive-few-products .wl-products{
        margin-top:-108px!important;
        margin-bottom:46px!important;
    }

    /* Le contenu SEO suivant repart normalement après la hauteur réelle de la grille. */
    body.bpm-shop-design-active.bpm-product-archive ul.products + *,
    body.bpm-shop-design-active.bpm-product-archive .products + *,
    body.bpm-shop-design-active.bpm-product-archive .woolentor-products + *{
        clear:both!important;
        position:relative!important;
        margin-top:0!important;
        z-index:1!important;
    }
}

/* Tablette/mobile : pas de marge négative, pour éviter tout chevauchement. */
@media (max-width:1024px){
    body.bpm-shop-design-active.bpm-product-archive .woocommerce-products-header{
        min-height:0!important;
        margin-bottom:18px!important;
        padding-bottom:0!important;
    }
    body.bpm-shop-design-active.bpm-product-archive .woocommerce-breadcrumb{
        margin-bottom:22px!important;
    }
    body.bpm-shop-design-active.bpm-product-archive ul.products,
    body.bpm-shop-design-active.bpm-product-archive .products,
    body.bpm-shop-design-active.bpm-product-archive .woolentor-products,
    body.bpm-shop-design-active.bpm-product-archive .ht-products,
    body.bpm-shop-design-active.bpm-product-archive .wl-products{
        margin-top:0!important;
        margin-bottom:48px!important;
    }
}


/* V3.3 — Navigation dynamique des sous-catégories WooCommerce.
   Aucun libellé n'est codé en dur : seuls les enfants réels de la catégorie courante sont affichés. */
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav{
    width:min(1420px,calc(100% - 48px));
    margin:0 auto 24px!important;
    position:relative;
    z-index:5;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav__inner{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-chip{
    display:inline-flex;
    align-items:center;
    gap:9px;
    min-height:40px;
    padding:9px 15px;
    border:1px solid #dfe3e8;
    border-radius:10px;
    background:#fff;
    color:#171a1f!important;
    font-size:14px;
    font-weight:650;
    line-height:1.2;
    text-decoration:none!important;
    box-shadow:0 3px 12px rgba(17,24,39,.035);
    transition:background .18s ease,color .18s ease,border-color .18s ease,transform .18s ease;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-chip__mark{
    width:7px;
    height:7px;
    flex:0 0 7px;
    border-radius:50%;
    background:#171a1f;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-chip:hover{
    background:#171a1f;
    border-color:#171a1f;
    color:#fff!important;
    transform:translateY(-1px);
}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-chip:hover .bpm-subcategory-chip__mark{background:#fff;}

@media (min-width:1025px){
    /* La navigation occupe l'espace entre breadcrumb et produits sans recréer le grand vide. */
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav + ul.products,
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav + .products,
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav + .woolentor-products,
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav + .ht-products,
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav + .wl-products{
        margin-top:0!important;
    }
}
@media (max-width:767px){
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav{
        width:calc(100% - 28px);
        margin-bottom:18px!important;
    }
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-nav__inner{
        gap:8px;
    }
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-chip{
        min-height:38px;
        padding:8px 12px;
        font-size:13px;
    }
}

/* V3.4.1 — Navigation produits : insertion après le breadcrumb, sans modifier la grille */
body.bpm-shop-design-active.bpm-product-archive .bpm-product-nav{
    margin:18px 0 24px;
    padding:0;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-product-nav__inner{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-product-chip{
    display:inline-flex;
    align-items:center;
    min-height:34px;
    padding:7px 13px;
    border:1px solid #d8dde3;
    border-radius:999px;
    background:#f7f8f9;
    color:#20242a !important;
    font-size:14px;
    font-weight:600;
    line-height:1.2;
    text-decoration:none !important;
    box-shadow:none;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-product-chip:hover{
    background:#20242a;
    border-color:#20242a;
    color:#fff !important;
}
@media (max-width:767px){
    body.bpm-shop-design-active.bpm-product-archive .bpm-product-nav{margin:14px 0 18px;}
    body.bpm-shop-design-active.bpm-product-archive .bpm-product-nav__inner{gap:6px;}
    body.bpm-shop-design-active.bpm-product-archive .bpm-product-chip{font-size:13px;padding:6px 10px;}
}

/* ==========================================================
   V3.6 — Familles : filtre instantané + vraie page SEO
   ========================================================== */
body.bpm-shop-design-active.bpm-product-archive .bpm-product-nav--families{
    margin:18px 0 26px;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-product-nav--families .bpm-product-nav__inner{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:stretch;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-family-control{
    display:inline-flex;
    align-items:stretch;
    border:1px solid #d8dde3;
    border-radius:10px;
    overflow:hidden;
    background:#fff;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-family-filter{
    appearance:none;
    border:0;
    margin:0;
    padding:9px 13px;
    min-height:38px;
    background:#fff;
    color:#20242a;
    font:inherit;
    font-size:14px;
    font-weight:700;
    line-height:1.15;
    cursor:pointer;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-family-filter:hover,
body.bpm-shop-design-active.bpm-product-archive .bpm-family-filter.is-active{
    background:#20242a;
    color:#fff;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-family-seo-link{
    display:inline-flex;
    align-items:center;
    gap:4px;
    padding:8px 11px;
    border-left:1px solid #d8dde3;
    background:#f7f8f9;
    color:#4b5563!important;
    font-size:12px;
    font-weight:650;
    line-height:1.15;
    text-decoration:none!important;
    white-space:nowrap;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-family-seo-link:hover{
    background:#eef0f2;
    color:#111827!important;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-product-nav--families > .bpm-product-nav__inner > .bpm-family-filter[data-bpm-filter="all"]{
    border:1px solid #d8dde3;
    border-radius:10px;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-filter-status{
    min-height:18px;
    margin-top:8px;
    color:#6b7280;
    font-size:12px;
    font-weight:600;
}
@media(max-width:767px){
    body.bpm-shop-design-active.bpm-product-archive .bpm-family-control{width:100%;}
    body.bpm-shop-design-active.bpm-product-archive .bpm-family-filter{flex:1;text-align:left;}
    body.bpm-shop-design-active.bpm-product-archive .bpm-family-seo-link{flex:0 0 auto;}
}

/* V3.6.1 — fallback strict des sous-catégories que ShopLentor ne rend pas. */
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback{
    width:min(1420px,calc(100% - 48px));margin:34px auto 70px;padding:0;
}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback__header{margin:0 0 28px;}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback__spectrum{
    width:min(820px,75%);height:24px;margin:0 0 28px;
    background:linear-gradient(90deg,#e7b500 0 14%,#dc321f 24%,#bf1855 34%,#7350a0 48%,#1385c0 62%,#00a4b4 72%,#00806e 84%,#65a71c 100%);
    clip-path:polygon(0 20%,3% 20%,3% 80%,5% 80%,5% 20%,8% 20%,8% 80%,11% 80%,11% 20%,15% 20%,15% 80%,18% 80%,18% 20%,23% 20%,23% 80%,27% 80%,27% 20%,31% 20%,31% 80%,35% 80%,35% 20%,39% 20%,39% 80%,43% 80%,43% 20%,47% 20%,47% 80%,51% 80%,51% 20%,55% 20%,55% 80%,59% 80%,59% 20%,63% 20%,63% 80%,67% 80%,67% 20%,71% 20%,71% 80%,75% 80%,75% 20%,79% 20%,79% 80%,83% 80%,83% 20%,87% 20%,87% 80%,91% 80%,91% 20%,94% 20%,94% 80%,97% 80%,97% 20%,100% 20%,100% 80%,0 80%);
}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback h1{font-size:42px;line-height:1.1;margin:0 0 42px;font-weight:800;color:#080808;}
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback .woocommerce-breadcrumb{margin:0 0 30px!important;}
body.bpm-shop-design-active.bpm-product-archive .bpm-crumb-sep{padding:0 10px;color:#8a8a8a;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-products{margin:0 0 58px!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:24px!important;list-style:none!important;padding:0!important;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-product{border:1px solid #dfe3e8;border-radius:14px;overflow:hidden;background:#fff;box-shadow:0 8px 24px rgba(20,30,45,.05);margin:0!important;width:auto!important;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-product a{text-decoration:none!important;color:#151a22!important;display:block;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-product img{display:block;width:100%!important;aspect-ratio:4/3!important;object-fit:cover!important;margin:0!important;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-product__bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 18px;min-height:72px;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-product .woocommerce-loop-product__title{font-size:17px!important;line-height:1.25!important;font-weight:700!important;margin:0!important;padding:0!important;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-arrow{font-size:22px;color:#1683ff;flex:0 0 auto;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-seo{max-width:1200px;margin:46px 0 0!important;padding:0!important;line-height:1.75;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-seo h2{font-size:30px;line-height:1.2;margin:38px 0 14px;}
body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-seo h3{font-size:23px;line-height:1.25;margin:32px 0 12px;}
@media(max-width:1024px){body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-products{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:767px){body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback{width:calc(100% - 28px);margin-top:24px}body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback h1{font-size:31px;margin-bottom:26px}body.bpm-shop-design-active.bpm-product-archive .bpm-fallback-products{grid-template-columns:1fr!important;gap:16px!important}.bpm-subcategory-fallback__spectrum{width:100%!important}}

/* V3.6.2 — fallback exclusif : évite la flèche CSS globale en doublon. */
body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback .bpm-fallback-product .woocommerce-loop-product__title:after{content:none!important;display:none!important;}


/* ==========================================================
   V3.6.4 — SOUS-CATEGORIE FALLBACK : FLUX PROPRE
   Le fallback a son propre H1 + breadcrumb + grille. La règle générale
   desktop (-58px) ne doit jamais remonter sa grille sur le breadcrumb.
   Scope strict : archive product_cat enfant + fallback uniquement.
   ========================================================== */
@media (min-width:1025px){
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback .bpm-fallback-products,
    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback ul.products.bpm-fallback-products{
        margin-top:0!important;
        margin-bottom:58px!important;
        padding-top:0!important;
        position:relative!important;
        z-index:2!important;
        transform:none!important;
    }

    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback__header{
        position:relative!important;
        z-index:3!important;
        margin-bottom:0!important;
    }

    body.bpm-shop-design-active.bpm-product-archive .bpm-subcategory-fallback .woocommerce-breadcrumb{
        display:block!important;
        position:relative!important;
        z-index:3!important;
        margin:0 0 30px!important;
        padding:0!important;
        min-height:0!important;
    }
}
