/* Force-final layer for /product/ rendering conflicts (layout only) */
body.post-type-archive-product #main-content.product-archive-main > .container,
body.page #main-content.product-categories-main > .container {
    max-width: 1240px !important;
    width: min(1240px, 94vw) !important;
    margin: 0 auto !important;
}

body.post-type-archive-product #main-content.product-archive-main .product-categories-grid,
body.post-type-archive-product #main-content.product-archive-main .product-list-grid,
body.page #main-content.product-categories-main .product-categories-grid,
body.page #main-content.product-categories-main .product-list-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    width: 100% !important;
    align-items: stretch !important;
}

body.post-type-archive-product #main-content.product-archive-main .category-card,
body.post-type-archive-product #main-content.product-archive-main .product-card,
body.page #main-content.product-categories-main .category-card,
body.page #main-content.product-categories-main .product-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
}

body.post-type-archive-product #main-content.product-archive-main .category-image-wrapper,
body.post-type-archive-product #main-content.product-archive-main .product-image-wrapper,
body.page #main-content.product-categories-main .category-image-wrapper,
body.page #main-content.product-categories-main .product-image-wrapper {
    height: 185px !important;
    flex: 0 0 185px !important;
    overflow: hidden !important;
}

body.post-type-archive-product #main-content.product-archive-main .category-image-wrapper img,
body.post-type-archive-product #main-content.product-archive-main .product-image-wrapper img,
body.page #main-content.product-categories-main .category-image-wrapper img,
body.page #main-content.product-categories-main .product-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

body.post-type-archive-product #main-content.product-archive-main .product-content,
body.page #main-content.product-categories-main .product-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
}

body.post-type-archive-product #main-content.product-archive-main .product-link,
body.page #main-content.product-categories-main .product-link {
    margin-top: auto !important;
}

body.post-type-archive-product #main-content.product-archive-main .product-link:visited,
body.page #main-content.product-categories-main .product-link:visited {
    background: #0f5e42 !important;
    border-color: #0f5e42 !important;
    color: #ffffff !important;
}

body.post-type-archive-product #main-content.product-archive-main .product-link:visited:hover,
body.post-type-archive-product #main-content.product-archive-main .product-link:visited:focus,
body.page #main-content.product-categories-main .product-link:visited:hover,
body.page #main-content.product-categories-main .product-link:visited:focus {
    background: #0b4d36 !important;
    border-color: #0b4d36 !important;
    color: #ffffff !important;
}

@media (min-width: 769px) and (max-width: 1100px) {
    body.post-type-archive-product #main-content.product-archive-main .product-categories-grid,
    body.post-type-archive-product #main-content.product-archive-main .product-list-grid,
    body.page #main-content.product-categories-main .product-categories-grid,
    body.page #main-content.product-categories-main .product-list-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    body.post-type-archive-product #main-content.product-archive-main .product-categories-grid,
    body.post-type-archive-product #main-content.product-archive-main .product-list-grid,
    body.page #main-content.product-categories-main .product-categories-grid,
    body.page #main-content.product-categories-main .product-list-grid {
        grid-template-columns: 1fr !important;
    }
}
