/**
 * PPSOLAR — Mise en page des pages boutique et catégories produits
 * (sortie de ctc-style.css : chargée uniquement sur ces pages, après ctc-style.css)
 */

.woocommerce.archive .site-content,
.woocommerce.tax-product_cat .site-content {
    display: flex !important;
    gap: 30px !important;
    padding: 20px !important;
    align-items: flex-start !important;
}

.woocommerce.archive .content-area,
.woocommerce.tax-product_cat .content-area {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (max-width: 600px) {
    .woocommerce.archive .site-content {
        flex-direction: column !important;
    }
}

/* ======= LAYOUT GLOBAL ======= */

/* On force WooCommerce à utiliser TOUTE la largeur */
body.woocommerce.archive #wrap,
body.tax-product_cat #wrap {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
}

/* Conteneur principal : sidebar gauche + produits droite */
body.woocommerce.archive #content-wrap,
body.tax-product_cat #content-wrap {
    display: flex !important;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
    max-width: 100% !important;
}

/* ======= SIDEBAR FILTRES À GAUCHE ======= */

body.woocommerce.archive #right-sidebar,
body.tax-product_cat #right-sidebar {
    order: 1;
    flex: 0 0 305px;  /* largeur sidebar */
    max-width: 305px;
    margin: 0 !important;
}



/* Neutralise les floats */
body.woocommerce.archive #right-sidebar,
body.tax-product_cat #right-sidebar {
    float: none !important;
}

/* ======= ZONE PRODUITS À DROITE ======= */

body.woocommerce.archive #primary,
body.tax-product_cat #primary {
    order: 2;
    flex: 1 1 auto;
    width: 100% !important;
    margin: 0 !important;
}

/* Grille 4 colonnes sur toute la largeur */
body.woocommerce.archive ul.products,
body.tax-product_cat ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 28px !important;
    width: 100%;
    margin: 0 !important;
    align-items: stretch !important; /* même hauteur partout */
}

/* Empêche OceanWP de casser le grid */
body.woocommerce.archive ul.products li.product,
body.tax-product_cat ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    display: flex !important; /* pour que .woo-entry-inner puisse s'étirer */
}

/* ======= RESPONSIVE ======= */

@media (max-width: 1400px) {
    body.woocommerce.archive ul.products,
    body.tax-product_cat ul.products {
        grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    }
}

@media (max-width: 992px) {

    /* Sidebar passe au-dessus */
    body.woocommerce.archive #content-wrap,
    body.tax-product_cat #content-wrap {
        flex-direction: column;
    }

    body.woocommerce.archive #right-sidebar,
    body.tax-product_cat #right-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px !important;
    }

    body.woocommerce.archive ul.products,
    body.tax-product_cat ul.products {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    }
}

@media (max-width: 600px) {
    body.woocommerce.archive ul.products,
    body.tax-product_cat ul.products {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    body.woocommerce.archive #content-wrap,
    body.tax-product_cat #content-wrap {
        display: flex !important;
        align-items: flex-start;
        gap: 0px;
        width: 100%;
        max-width: 100% !important;
    }
}

/* Bandeau de titre : même largeur que le contenu pleine largeur (filtres + produits) */
@media (min-width: 769px) {
    body.woocommerce.archive .page-header .container,
    body.tax-product_cat .page-header .container {
        width: auto !important;
        max-width: none !important;
        margin-left: 32px !important;
        margin-right: 32px !important;
    }
}
