/* Shared responsive adjustments for the public catalogue and product pages. */
@media (min-width:768px) and (max-width:991px) {
    .header .header-top .header-left { display:none !important; }
    .header .header-top .header-right { width:100%; min-width:0; justify-content:flex-end; }
    .header .header-top .tp-header-customer-links,
    .header .header-top .tp-header-customer-links a { flex-shrink:0; }
}

@media (max-width:767px) {
    #tpAiLauncher { bottom:calc(108px + env(safe-area-inset-bottom, 0px)) !important; }
}

@media (max-width:1100px) {
    .cat_wrap.tp-category-modern .catalogo_topo_filtros { display:block !important; margin:16px 0; }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtros {
        display:flex; flex-wrap:wrap; align-items:center; gap:12px; width:100%;
    }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtros > .float-left,
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtros > .float-right {
        float:none !important; width:auto !important; max-width:100%; margin:0; flex:0 1 auto;
    }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .float-left { flex:1 1 100%; }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .info-extra-paginacao { display:block !important; }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtro_order,
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtro_view { display:block !important; width:auto !important; margin:0; padding:0; }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtros > .c,
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .float-right:has(.vista-catalogo),
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .float-right:has(.paginacao .none) { display:none !important; }
    .cat_wrap.tp-category-modern .paginacao { display:flex; flex-wrap:wrap; gap:5px; }
    .cat_wrap.tp-category-modern .paginacao button { min-width:32px; min-height:36px; margin:0 !important; }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .chosen-container { max-width:100%; }
    .cat_wrap.tp-category-modern #product_show {
        display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px;
        float:none !important; width:100%; min-width:0; clear:both;
    }
    .cat_wrap.tp-category-modern #product_show > .prd_d,
    .cat_wrap.tp-category-modern #product_show > li {
        float:none !important; width:100% !important; max-width:100% !important;
        min-width:0; margin:0 !important;
    }
    .cat_wrap.tp-category-modern #product_show > li > .prd_d { width:100%; max-width:100%; }
    .cat_wrap.tp-category-modern #product_show .prd_img { width:100%; max-width:100%; height:200px; }
    .cat_wrap.tp-category-modern #product_show .prd_img a { display:flex; align-items:center; justify-content:center; width:100%; height:100%; }
    .cat_wrap.tp-category-modern #product_show .prd_img .helper { display:none; }
    .cat_wrap.tp-category-modern #product_show .prd_img img { width:100% !important; height:100% !important; max-width:100%; max-height:100% !important; object-fit:contain; }
    .cat_wrap.tp-category-modern #product_show .prd_title { height:auto; min-height:3.6em; }
    .cat_wrap.tp-category-modern #product_show .prd_title a { overflow-wrap:anywhere; }
    .cat_wrap.tp-category-modern #product_show .prodby,
    .cat_wrap.tp-category-modern #product_show .prodby-des { max-width:100%; }
    .cat_wrap.tp-category-modern #product_show:has(.left-block) { grid-template-columns:1fr; }
    .cat_wrap.tp-category-modern #product_show .prd_d:has(> .left-block) {
        display:grid; grid-template-columns:110px minmax(0,1fr); gap:12px;
    }
    .cat_wrap.tp-category-modern #product_show .prd_d > .left-block { grid-row:1 / 3; }
    .cat_wrap.tp-category-modern #product_show .prd_d > .center-block,
    .cat_wrap.tp-category-modern #product_show .prd_d > .right-block { grid-column:2; }
    .cat_wrap.tp-category-modern #product_show .prd_d > .left-block,
    .cat_wrap.tp-category-modern #product_show .prd_d > .center-block,
    .cat_wrap.tp-category-modern #product_show .prd_d > .right-block {
        float:none; width:100%; min-width:0; margin:0; padding:0;
    }
    .cat_wrap.tp-category-modern #product_show > .c,
    .cat_wrap.tp-category-modern #product_show > .clear { display:none; }

    /* Constrain the image itself as well as its link to avoid cropping. */
    .tp-p4a .tp-p4a-photo {
        min-height:0 !important; height:clamp(280px,44vw,420px) !important;
        max-height:none !important; aspect-ratio:auto !important;
    }
    .tp-p4a .tp-p4a-photo .tp-p4a-main-link { min-height:0; height:100%; overflow:hidden; padding:10px; }
    .tp-p4a .tp-p4a-photo .tp-p4a-main-img { width:100% !important; height:100% !important; min-height:0; max-width:100%; max-height:100%; object-fit:contain; }
    .tp-p4a .tp-p4a-info .tp-p4a-title,
    .tp-p4a .tp-p4a-attr-grid strong { overflow-wrap:anywhere; }
    .tp-p4a .tp-p4a-side { min-width:0; max-width:100%; }
    .tp-p4a .tp-p4a-btn { height:auto; min-height:48px; padding:12px 16px; text-align:center; white-space:normal; }
}

@media (max-width:767px) {
    .cat_wrap.tp-category-modern #product_show { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .cat_wrap.tp-category-modern #product_show .prd_img { height:160px; }
    .cat_wrap.tp-category-modern #product_show .prd_img img { max-height:150px !important; }
    .cat_wrap.tp-category-modern #product_show .prd_title a { font-size:13px; }
    .cat_wrap.tp-category-modern #product_show .prd_d:has(> .left-block) { grid-template-columns:85px minmax(0,1fr); }
    .tp-p4a .tp-p4a-photo { height:clamp(220px,74vw,340px) !important; }
}

@media (max-width:359px) {
    .cat_wrap.tp-category-modern #product_show { grid-template-columns:1fr; }
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtro_order,
    .cat_wrap.tp-category-modern .catalogo_topo_filtros .filtro_view { margin:0; }
}
