/* Containment fixes for legacy fixed-size cards and the homepage photo composition. */
body:is([data-clone-family=product-list],[data-clone-family=product-detail],[data-clone-family=search]) .list-pro{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px 0;float:none;width:100%;min-height:0;margin:0}
body:is([data-clone-family=product-list],[data-clone-family=product-detail],[data-clone-family=search]) .list-pro::before,
body:is([data-clone-family=product-list],[data-clone-family=product-detail],[data-clone-family=search]) .list-pro::after{display:none}
.list-pro>li{display:flex;float:none;width:auto;min-width:0;margin:0}
.list-pro>li>a{display:flex;flex-direction:column;box-sizing:border-box;flex:1;min-width:0;height:auto;min-height:0;padding:15px;margin:0;border:1px solid #ddd;overflow:visible}
.list-pro>li .m{float:none;position:relative;width:100%;height:auto;aspect-ratio:4/3;line-height:normal;display:flex;align-items:center;justify-content:center}
.list-pro>li .m img{display:block;width:100%;height:100%;max-width:100%;object-fit:contain}
.list-pro>li .text{float:none;display:flex;flex-direction:column;align-items:center;gap:10px;flex:1;width:100%;min-width:0;margin:12px 0 0;text-align:center}
.list-pro>li .text h4{font-size:16px;line-height:1.5;margin:0;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
.list-pro>li .text .more{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:30px;line-height:1.5;font-size:12px;padding:6px 12px;margin-top:auto}
/* The same source product names and links remain; long names can grow the row. */
body[data-clone-family=home] .fm-home-product-grid article{display:flex;flex-direction:column;min-width:0}
body[data-clone-family=home] .fm-home-product-grid article>a{display:flex;flex-direction:column;flex:1;height:auto;min-width:0;box-sizing:border-box}
body[data-clone-family=home] .fm-home-product-grid article>a>span{margin-top:auto;padding-top:3px}
body[data-clone-family=product-detail] .yunu-showcase{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);align-items:start;gap:26px}
body[data-clone-family=product-detail] .yunu-showcase::before,
body[data-clone-family=product-detail] .yunu-showcase::after{display:none}
body[data-clone-family=product-detail] .yunu-showcase>.pc-slide,
body[data-clone-family=product-detail] .yunu-showcase>.yunu-showcase-info{float:none;width:100%!important;min-width:0;margin:0}
body[data-clone-family=product-detail] .yunu-showcase-info h1{height:auto;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.5}
body[data-clone-family=product-detail] .yunu-showcase-info p{height:auto;min-height:0;line-height:1.9}
body[data-clone-family=product-detail] .pc-slide .view .swiper-slide .imgauto{display:flex;align-items:center;justify-content:center;height:auto;min-height:220px;aspect-ratio:4/3;line-height:normal}
body[data-clone-family=product-detail] .pc-slide .view .imgauto img{display:block;width:100%;height:100%;max-height:100%;max-width:100%;object-fit:contain}
body[data-clone-family=product-detail] .list-3{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin:0}
body[data-clone-family=product-detail] .list-3::before,
body[data-clone-family=product-detail] .list-3::after{display:none}
body[data-clone-family=product-detail] .list-3>li{display:flex;float:none;width:auto;min-width:0;margin:0}
body[data-clone-family=product-detail] .list-3>li>a{display:flex;flex-direction:column;flex:1;min-width:0;height:auto;margin:0}
body[data-clone-family=product-detail] .list-3 .m{display:flex;align-items:center;justify-content:center;height:auto;aspect-ratio:4/3;line-height:normal}
body[data-clone-family=product-detail] .list-3 .m img{display:block;width:100%;height:100%;object-fit:contain}
body[data-clone-family=product-detail] .list-3 .text h4{white-space:normal;overflow-wrap:anywhere;line-height:1.6;padding:12px 12px 0}
body[data-clone-family=product-detail] .list-3 .text p{white-space:normal;padding:0 12px 12px;line-height:1.6}
/* Let the composition contribute its full height to the page at every width.
   Factory, product and equipment use separate cells with a clear gutter. */
body[data-clone-family=home] .fm-home-factory-hero .fm-hero-visual{display:grid;grid-template-columns:minmax(0,28fr) minmax(0,69fr);gap:14px 3%;height:auto;min-height:0;width:100%;max-width:100%;align-self:center}
.fm-home-factory-hero .fm-hero-visual>.fm-hero-plant{position:relative;inset:auto;grid-column:1/-1;grid-row:1;width:100%;height:auto;aspect-ratio:4;margin:0}
.fm-home-factory-hero .fm-hero-visual>.fm-hero-product{position:relative;inset:auto;grid-column:2;grid-row:2;align-self:start;width:100%;max-width:100%;margin:0;clip-path:none;box-shadow:none;border:1px solid #ffffff35}
.fm-home-factory-hero .fm-hero-visual>.fm-hero-proof-gallery{position:relative;inset:auto;grid-column:1;grid-row:2;display:grid;grid-template-columns:1fr;grid-template-rows:1fr 1fr;align-self:stretch;width:100%;height:auto;min-height:0;margin:0;gap:10px}
@media(max-width:1023px){
 body:is([data-clone-family=product-list],[data-clone-family=product-detail],[data-clone-family=search]) .list-pro{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
 .list-pro>li .m{aspect-ratio:1/1}
 .list-pro>li .text h4{font-size:14px}
 body[data-clone-family=product-detail] .yunu-showcase{grid-template-columns:1fr;gap:25px;padding:0;border:0}
 body[data-clone-family=product-detail] .list-3{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
}
@media(max-width:767px){
 body:is([data-clone-family=product-list],[data-clone-family=product-detail],[data-clone-family=search]) .list-pro{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .list-pro>li>a{padding:10px}
 body[data-clone-family=product-detail] .list-3{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 body[data-clone-family=home] .fm-home-factory-hero .fm-hero-visual{grid-template-columns:minmax(0,1fr);gap:12px;margin-bottom:14px}
 .fm-home-factory-hero .fm-hero-visual>.fm-hero-plant{grid-column:1;grid-row:1;min-height:140px;aspect-ratio:2.62}
 .fm-home-factory-hero .fm-hero-visual>.fm-hero-product{grid-column:1;grid-row:2;width:100%;justify-self:stretch;margin:0}
 .fm-home-factory-hero .fm-hero-visual>.fm-hero-proof-gallery{grid-column:1;grid-row:3;grid-template-columns:1fr 1fr;grid-template-rows:1fr;height:78px}
}
@media(max-width:359px){
 .fm-home-factory-hero .fm-hero-visual>.fm-hero-plant{min-height:130px;aspect-ratio:2.62}
 .fm-home-factory-hero .fm-hero-visual>.fm-hero-product{width:100%}
 .fm-home-factory-hero .fm-hero-visual>.fm-hero-proof-gallery{height:70px}
}
