/* Shared meal boxes: homepage, Produtos, native meal categories and Encomendar. */
:is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal) li.trf-category-meal.trf-flow,.trf-flow .trf-catalog__grid>article.trf-meal[data-product-id]){
 --trf-card-bg:#f4f4e8;box-sizing:border-box;min-width:0;padding:12px;border-radius:12px;background:var(--trf-card-bg);overflow:hidden;display:flex;flex-direction:column;container:trf-meal-card / inline-size;
}
:is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal) li.trf-category-meal.trf-flow,.trf-flow .trf-catalog__grid>article.trf-meal[data-product-id])[data-conservation="frozen"]{--trf-card-bg:#f4f4f9}
:is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal) li.trf-category-meal.trf-flow)>.trf-meal{flex:1;min-width:0;width:100%;padding:0;background:transparent}
:is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal) li.trf-category-meal.trf-flow,.trf-flow .trf-catalog__grid>article.trf-meal[data-product-id]) .trf-meal__image{width:calc(100% + 24px);max-width:none;margin:-12px -12px 16px;border-radius:12px}
:is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal) li.trf-category-meal.trf-flow) :is(.trf-home-delivery-link,.trf-category-delivery-link){align-self:stretch;width:100%;max-width:100%;box-sizing:border-box;margin:16px 0 0}
.trf-flow .trf-meal .trf-meal__purchase{width:100%;max-width:100%;min-width:0}
/* Render the final controls before JS, while native disabled fieldsets prevent
   premature selection. Native Woo selects remain in the form for matching. */
.trf-flow .trf-meal__purchase .trf-product-options{display:block}
.trf-flow .trf-meal__purchase .trf-product-native-select{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap;visibility:hidden}
.trf-flow .trf-meal__purchase [data-trf-options-pending] .trf-product-options__buttons input:disabled+span{opacity:1;text-decoration:none;cursor:wait}
/* Overlap initial fallback and live feedback in the same reserved slot. A real
   link stays available if JS fails or is disabled, without a loading timeout. */
.trf-flow .trf-meal__purchase .trf-meal__option-status{display:grid}
.trf-flow .trf-meal__option-status>*{grid-area:1 / 1;align-self:start}
.trf-flow .trf-meal__options-fallback{visibility:hidden;pointer-events:none;color:inherit;text-decoration:underline}
.trf-flow .trf-meal__purchase:has([data-trf-options-pending]) .trf-meal__options-fallback{visibility:visible;pointer-events:auto}
.trf-flow .trf-meal__purchase:has([data-trf-options-pending]) [data-trf-purchase-status]{visibility:hidden}
.trf-flow .trf-meal__purchase:has([data-trf-options-pending]) noscript{display:none}
/* Size choices follow the form width, including cards using subgrid above.
   Keep two columns in narrow cards and at most three in wider cards. */
.trf-flow .trf-meal .trf-meal__purchase{container:trf-meal-options / inline-size}
.trf-flow .trf-meal__purchase [data-trf-options="attribute_pa_tamanho"] .trf-product-options__buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:8px}
.trf-flow .trf-meal__purchase [data-trf-options="attribute_pa_tamanho"] .trf-product-options__buttons label{display:flex;min-width:0;max-width:none;margin:0}
.trf-flow .trf-meal__purchase [data-trf-options="attribute_pa_tamanho"] .trf-product-options__buttons span{box-sizing:border-box;width:100%;height:100%;min-height:56px;padding:8px 6px;flex-direction:column;text-align:center;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
.trf-flow .trf-meal__purchase [data-trf-options="attribute_pa_tamanho"] .trf-product-options__buttons bdi{max-width:100%;text-wrap:balance}
@container trf-meal-options (min-width:280px){
 .trf-flow .trf-meal__purchase [data-trf-options="attribute_pa_tamanho"] .trf-product-options__buttons{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Keep native prices and public minimum values equally legible in every meal list. */
:is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid) :is(.trf-meal__price,.trf-meal__preview-price,.trf-meal__price .woocommerce-Price-amount,.trf-meal__preview-price .woocommerce-Price-amount){font-weight:700}
@container trf-meal-card (max-width:150px){
 .trf-flow .trf-meal__purchase-actions{flex-wrap:wrap}
 .trf-flow .trf-meal__purchase button[data-trf-add]{flex-basis:100%}
}
/* Full catalogues share the homepage columns, without limiting their number of rows. */
:is(.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid){grid-template-columns:minmax(0,1fr)}
@media(min-width:360px){:is(.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:600px){:is(.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid){grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1100px){:is(.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid){grid-template-columns:repeat(4,minmax(0,1fr))}}
/* One readable meal card per row on portrait phones; landscape/tablet keep their columns. */
@media(max-width:767px) and (orientation:portrait){
 :is(.trf-home-catalog.trf-flow[data-trf-home-catalog] .trf-home-products,.trf-home-catalog.trf-flow[data-trf-home-catalog] .trf-home-loading,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid){grid-template-columns:minmax(0,1fr)}
 .trf-home-catalog.trf-flow .trf-home-loading span:not(:first-child){display:none}
}
/* Equal tracks per visual row, with complete names and no fixed card height. */
@supports(grid-template-rows:subgrid){
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid){align-items:stretch;row-gap:12px}
 :is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal) li.trf-category-meal.trf-flow,.trf-flow .trf-catalog__grid>article.trf-meal[data-product-id]){display:grid;grid-template-rows:subgrid;grid-row:span 6;gap:12px;align-items:stretch;padding:12px;container-type:normal}
 :is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal) li.trf-category-meal.trf-flow)>.trf-meal{display:grid;grid-template-rows:subgrid;grid-column:1;grid-row:1 / span 6;gap:12px;align-items:stretch;padding:0}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),.trf-flow .trf-catalog__grid) .trf-meal__image{grid-row:1;margin:-12px -12px 4px}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),.trf-flow .trf-catalog__grid) .trf-meal h3{grid-row:2;min-height:0;margin:0;overflow-wrap:anywhere}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),.trf-flow .trf-catalog__grid) .trf-home-accompaniments{grid-row:3;margin:0}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),.trf-flow .trf-catalog__grid) :is(.trf-meal__price,.trf-meal__preview-price){grid-row:4;align-self:start;margin:0}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),.trf-flow .trf-catalog__grid) :is(.trf-meal__purchase,.trf-meal__bottom){grid-row:5 / span 2;align-self:stretch;margin:8px 0 0}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal)) :is(.trf-home-delivery-link,.trf-category-delivery-link){grid-column:1;grid-row:6;align-self:end;margin:4px 0 0}
 /* Native archives keep their option guidance visible before the delivery CTA.
    Reserve row 6 for the link instead of sharing it with the form's live status. */
 .trf-category-page .trf-category-products ul.products>li.trf-category-meal:not([data-trf-card-preview="1"]):not(.trf-category-delivery-ready)>.trf-meal{grid-row:1 / span 5}
 .trf-category-page .trf-category-products ul.products>li.trf-category-meal:not([data-trf-card-preview="1"]):not(.trf-category-delivery-ready)>.trf-meal>.trf-meal__purchase{grid-row:5}
 /* Only ready cards expose forms; never override the public preview's hidden state. */
 :is(.trf-home-catalog.trf-flow .trf-home-products>.trf-home-card.trf-category-delivery-ready,.trf-category-page .trf-category-products ul.products li.trf-category-meal.trf-category-delivery-ready,[data-trf-flow].trf-flow--meals .trf-catalog__grid>article.trf-meal[data-product-id]) .trf-meal__purchase{display:flex!important;flex-direction:column}
 /* Let the free space sit above the feedback, keeping guidance next to the
    purchase row regardless of the number of option groups or button rows. */
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid) .trf-meal__purchase>.trf-meal__feedback{order:2;box-sizing:border-box;min-height:30px;margin:auto 0 8px;padding-top:12px}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid) :is(.single_variation_wrap,form>.trf-meal__purchase-actions){order:3;margin-top:0}
 :is(.trf-home-catalog.trf-flow .trf-home-products,.trf-category-page .trf-category-products ul.products:has(> .trf-category-meal),[data-trf-flow].trf-flow--meals .trf-catalog__grid) .trf-meal__cart-link{order:2}
}
