/* Yamazen mobile restoration v1.85.8.6
 * Loaded last so the responsive result remains consistent with desktop.
 */

@media (max-width: 1199.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body main,
    body .site-content,
    body main section,
    body main article {
        max-width: 100%;
    }

    body main img:not(.flag):not([class*="flag"]) {
        max-width: 100%;
    }

    /* Tablet uses the complete middle catalogue only. */
    body[class*="template-home"] .processing-category > .container > .row.d-none.d-xl-flex {
        display: none !important;
    }

    body[class*="template-home"] .processing-category > .container > .row.d-none.d-sm-flex.d-xl-none {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body[class*="template-home"] .processing-category > .container > .row.d-flex.d-sm-none {
        display: none !important;
    }

    body[class*="template-home"] .processing-category .processing-item,
    body[class*="template-home"] .processing-category .processing-item .item,
    body[class*="template-home"] .processing-category .processing-item .category,
    body[class*="template-home"] .processing-category .category-cover-link,
    body[class*="template-home"] .processing-category .category-body {
        visibility: visible !important;
        opacity: 1 !important;
    }

    body[class*="template-home"] .processing-category .processing-item {
        display: flex !important;
        min-width: 0 !important;
    }

    body[class*="template-home"] .processing-category .category-cover-img.yamazen-product-sketch {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    /* Keep product/category catalogues visible after legacy load-more code. */
    body article.yamazen-tools-category .product-list,
    body article.yamazen-tools-category .product-list > .container,
    body article.yamazen-tools-category .product-list .row,
    body article.yamazen-tools-category .sub-product-list,
    body article.yamazen-tools-category .product-list-content-manufacture,
    body .product-sub-category .product-list,
    body .product-sub-category .product-list .row,
    body .product-sub-category .product-list-content-manufacture {
        visibility: visible !important;
        opacity: 1 !important;
    }

    body article.yamazen-tools-category .product-hidden,
    body .product-sub-category .product-hidden {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }

    body .yamazen-news-list .card-news-col:not(.news-hidden),
    body .yamazen-news-list .card-news,
    body .yamazen-news-list .card-image-list,
    body .yamazen-news-list .news-image-item {
        visibility: visible !important;
        opacity: 1 !important;
    }

    body .site-footer,
    body .site-footer .footer-head,
    body .site-footer .footer-bottom {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    /* Phone uses its own complete catalogue.  Force it above older d-none rules. */
    body[class*="template-home"] .processing-category > .container > .row.d-none.d-xl-flex,
    body[class*="template-home"] .processing-category > .container > .row.d-none.d-sm-flex.d-xl-none {
        display: none !important;
    }

    body[class*="template-home"] .processing-category > .container > .row.d-flex.d-sm-none {
        display: flex !important;
        width: auto !important;
        margin-right: -8px !important;
        margin-left: -8px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body[class*="template-home"] .processing-category .yamazen-solution-group-title {
        display: block !important;
        padding: 28px 8px 8px !important;
    }

    body[class*="template-home"] .processing-category .processing-item {
        display: flex !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 8px !important;
    }

    body[class*="template-home"] .processing-category .processing-item[hidden],
    body[class*="template-home"] .processing-category .processing-item[aria-hidden="true"] {
        display: none !important;
    }

    body[class*="template-home"] .processing-category .processing-item .item {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        border-radius: 14px !important;
    }

    body[class*="template-home"] .processing-category .processing-item .category {
        display: flex !important;
        min-height: 0 !important;
    }

    body[class*="template-home"] .processing-category .category-cover-link {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 10 !important;
    }

    body[class*="template-home"] .processing-category .category-cover-img.yamazen-product-sketch {
        padding: 12px 12px 42px !important;
        background: #fff !important;
    }

    body[class*="template-home"] .processing-category .category-title {
        min-height: 82px !important;
        margin-top: -82px !important;
        padding: 28px 18px 15px !important;
    }

    body[class*="template-home"] .processing-category .category-title .title {
        font-size: 18px !important;
        line-height: 1.35 !important;
    }

    body[class*="template-home"] .processing-category .category-more-view {
        display: flex !important;
        width: 100% !important;
        height: 52px !important;
        padding: 0 18px !important;
    }

    /* Homepage insights use the same 4:3 artwork treatment as desktop. */
    body[class*="template-home"] .news .news-image {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4 / 3 !important;
    }

    body[class*="template-home"] .news .news-image-item {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        padding: 10px !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    /* Shared card proportions across About, News, and product pages. */
    body .yamazen-about-card-v184,
    body .yamazen-news-list .card-news,
    body article.yamazen-tools-category .product-list-content-manufacture,
    body .product-sub-category .product-list-content-manufacture {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
    }

    body .yamazen-about-card-v184 .card-image,
    body .yamazen-news-list .card-image-list {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 16 / 9 !important;
    }

    body .yamazen-about-card-v184 .card-image img,
    body .yamazen-news-list .news-image-item {
        width: 100% !important;
        height: 100% !important;
        object-position: center !important;
    }

    body .yamazen-about-card-v184 .card-image img {
        object-fit: cover !important;
    }

    body article.yamazen-tools-category .product-list .row,
    body .product-sub-category .product-list .row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        gap: 18px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    body article.yamazen-tools-category .sub-product-list,
    body .product-sub-category .sub-product-list {
        display: block !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body article.yamazen-tools-category .cover-manufacture,
    body .product-sub-category .cover-manufacture {
        display: flex !important;
        width: 100% !important;
        height: 150px !important;
        min-height: 150px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body article.yamazen-tools-category .cover-manufacture img,
    body .product-sub-category .cover-manufacture img {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 84% !important;
        max-height: 104px !important;
        visibility: visible !important;
        opacity: 1 !important;
        object-fit: contain !important;
    }

    body.yamazen-contact-page main.contact > .head {
        height: 210px !important;
        min-height: 210px !important;
    }

    body.yamazen-contact-page main.contact > .head > .cover {
        background-position: 64% center !important;
        background-size: cover !important;
    }

    body .site-footer .footer-head > .container,
    body .site-footer .footer-bottom > .container {
        width: calc(100% - 24px) !important;
        max-width: none !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    body .site-footer .footer-address,
    body .site-footer .yamazen-footer-offices,
    body .site-footer .yamazen-social-connect--footer {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[class*="template-home"] .processing-category .processing-item .item,
    body[class*="template-home"] .processing-category .category-cover-img,
    body .yamazen-about-card-v184,
    body .yamazen-news-list .card-news {
        transition: none !important;
    }
}
