/* ---- shell do bottom sheet ---- */
.mpx-overlay {
	position: fixed;
	top: 0; left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999999;
	display: none;
	opacity: 0;
	-webkit-align-items: flex-end;
	align-items: flex-end;
	-webkit-justify-content: center;
	justify-content: center;
	-webkit-transition: opacity 0.3s ease;
	transition: opacity 0.3s ease;
}
.mpx-overlay.mpx-show {
	display: -webkit-flex;
	display: flex;
	opacity: 1;
}
.mpx-sheet {
	background: #f4f6f8;
	width: 100%;
	max-width: 450px;
	/* altura FIXA (min == max, pedido do usuario): a modal ocupa quase a tela
	   toda, sobrando so uma fresta minima no topo; o rodape e empurrado ao
	   fundo pelo margin-top:auto do .mpx-rodape quando o conteudo e curto.
	   ATENCAO Chrome mobile: vh e calculado com a barra de URL RECOLHIDA - com
	   a barra visivel o sheet estourava para cima e o topo sumia. Onde existe
	   dvh (viewport dinamico) o @supports abaixo corrige; nos browsers antigos
	   o JS do MPX aplica px do innerHeight real. */
	min-height: 97vh;
	max-height: 97vh;
	border-top-left-radius: 24px;
	border-top-right-radius: 24px;
	-webkit-transform: translateY(100%);
	transform: translateY(100%);
	-webkit-transition: -webkit-transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	overflow: hidden;
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	flex-direction: column;
}
.mpx-overlay.mpx-show .mpx-sheet {
	-webkit-transform: translateY(0);
	transform: translateY(0);
}

/* viewport dinamico: acompanha a barra de URL do browser mobile */
@supports (height: 100dvh) {
	.mpx-sheet {
		min-height: 97dvh;
		max-height: 97dvh;
	}
}

/* No desktop a interface se comporta como modal, centralizada na viewport.
   O bottom sheet e sua animacao de baixo para cima ficam restritos ao mobile. */
@media (min-width: 769px) {
	.mpx-overlay {
		-webkit-align-items: center;
		align-items: center;
	}
	.mpx-sheet {
		min-height: 90vh;
		max-height: 90vh;
		border-radius: 24px;
		opacity: 0;
		-webkit-transform: translateY(12px) scale(0.98);
		transform: translateY(12px) scale(0.98);
		-webkit-transition: opacity 0.25s ease, -webkit-transform 0.25s ease;
		transition: opacity 0.25s ease, transform 0.25s ease;
	}
	.mpx-overlay.mpx-show .mpx-sheet {
		opacity: 1;
		-webkit-transform: translateY(0) scale(1);
		transform: translateY(0) scale(1);
	}
}

@supports (height: 100dvh) {
	@media (min-width: 769px) {
		.mpx-sheet {
			min-height: 90dvh;
			max-height: 90dvh;
		}
	}
}
.mpx-handle {
	width: 40px; height: 4px;
	background: #d5dade;
	border-radius: 2px;
	margin: 10px auto 0 auto;
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
}
.mpx-header {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	padding: 12px 16px;
	background: #f4f6f8;
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
}
.mpx-header h3, .mpx-header h2 {
	margin: 0;
	-webkit-flex: 1;
	flex: 1;
	min-width: 0;
	font-size: 17px;
	font-weight: 600;
	color: #2c3e50;
	border-bottom: 0;
	text-align: left;
}
.mpx-voltar {
	font-size: 18px;
	color: #2c3e50;
	padding: 8px 12px 8px 0;
	cursor: pointer;
}
.mpx-fechar {
	background: #e9ecef;
	border: none;
	font-size: 16px;
	color: #495057;
	cursor: pointer;
	border-radius: 50%;
	width: 44px; height: 44px;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	touch-action: manipulation;
	-webkit-transition: background-color 0.12s ease;
	transition: background-color 0.12s ease;
}
.mpx-compartilhar {
	display: none;
	background: #e9ecef;
	border: none;
	font-size: 16px;
	color: #495057;
	cursor: pointer;
	border-radius: 50%;
	width: 44px; height: 44px;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	margin-right: 8px;
	touch-action: manipulation;
	-webkit-transition: background-color 0.12s ease;
	transition: background-color 0.12s ease;
}
.mpx-fechar:active, .mpx-compartilhar:active { background: #d5dade; }
.mpx-fechar:focus, .mpx-compartilhar:focus {
	outline: 2px solid #495057;
	outline-offset: 2px;
}
.mpx-corpo {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 0 12px;
	-webkit-flex: 1;
	flex: 1;
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	flex-direction: column;
}
/* o form ocupa o corpo inteiro (flex-grow - min-height:100% nao resolve quando
   a altura do sheet vem de min-height); com conteudo curto o rodape e empurrado
   ao fundo pelo margin-top:auto */
.mpx-corpo .mpx-form {
	-webkit-flex: 1 0 auto;
	flex: 1 0 auto;
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	flex-direction: column;
}
.mpx-corpo .mpx-form .mpx-rodape { margin-top: auto; }
/* tipos de adicionais */
.mpx-tipo { background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 10px; overflow: visible; }
.mpx-tipo-cab {
	padding: 12px 14px;
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 5;
	background-color: #f2f2f2;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: space-between;
	justify-content: space-between;
	border-radius: 14px 14px 0 0;
	text-align: left;
}
.mpx-tipo-titulo span { font-size: 14px; font-weight: 600; color: #1f1f1f; }
.mpx-tipo-titulo small { font-size: 12px; color: #5a6470; }
.mpx-badge {
	padding: 5px 10px;
	font-size: 12px;
	border-radius: 6px;
	background-color: #424040;
	color: white;
	white-space: nowrap;
	margin-left: 10px;
	-webkit-transition: all 0.3s ease;
	transition: all 0.3s ease;
}
.mpx-badge-ok { background-color: #28a745; }
.mpx-badge-ok:before { content: "\f00c"; font-family: "Font Awesome 5 Pro"; font-weight: 900; margin-right: 5px; }
.mpx-badge-erro {
	background-color: #dc3545;
	-webkit-animation: mpxshake 0.82s cubic-bezier(.36,.07,.19,.97) both;
	animation: mpxshake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}
@-webkit-keyframes mpxshake {
	10%, 90% { -webkit-transform: translate3d(-1px, 0, 0); }
	20%, 80% { -webkit-transform: translate3d(2px, 0, 0); }
	30%, 50%, 70% { -webkit-transform: translate3d(-4px, 0, 0); }
	40%, 60% { -webkit-transform: translate3d(4px, 0, 0); }
}
@keyframes mpxshake {
	10%, 90% { transform: translate3d(-1px, 0, 0); }
	20%, 80% { transform: translate3d(2px, 0, 0); }
	30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
	40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* itens */
.mpx-item {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	padding: 10px 12px;
	text-align: left;
}
.mpx-hr { border: 0; border-top: 1px solid #f0f0f0; margin: 0 12px; }
.mpx-stepper { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-flex-shrink: 0; flex-shrink: 0; }
.mpx-mais, .mpx-menos, .mpx-sabor-mais, .mpx-sabor-menos {
	width: 34px; height: 34px;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
	cursor: pointer;
}
.mpx-mais i, .mpx-sabor-mais i { color: #097969; -webkit-text-stroke: 1px white; }
.mpx-menos i, .mpx-sabor-menos i { color: #EE4B2B; -webkit-text-stroke: 1px white; }
.mpx-qty {
	width: 20px; height: 32px;
	text-align: center;
	background: transparent;
	border: none;
	font-size: 15px;
	padding: 0;
	-webkit-appearance: none;
}
.mpx-form[data-mpx-edita-adicional="1"] .mpx-qty { width: 28px; cursor: text; -webkit-user-select: text; user-select: text; }
.mpx-form[data-mpx-edita-adicional="1"] .mpx-qty:focus { outline: 1px solid #097969; border-radius: 4px; }

/* com 0 selecionado, "-" e o "0" SOMEM de verdade (display) - o conteudo
   ganha o espaco; ao chegar em 1+ eles aparecem e o layout acomoda */
.mpx-item .mpx-menos,
.mpx-item .mpx-sabor-menos,
.mpx-item .mpx-qty { display: none; }
.mpx-item.mpx-tem-qtd .mpx-menos,
.mpx-item.mpx-tem-qtd .mpx-sabor-menos {
	display: -webkit-flex;
	display: flex;
}
.mpx-item.mpx-tem-qtd .mpx-qty { display: inline-block; }
.mpx-item-info { -webkit-flex: 1; flex: 1; margin-left: 8px; min-width: 0; }
.mpx-item-nome { font-size: 14px; color: #1f1f1f; margin: 0; }
.mpx-item-desc { font-size: 12px; color: #5a6470; margin: 2px 0 0 0; word-break: break-word; }
.mpx-item-valor { font-size: 13px; font-weight: 700; color: #1f1f1f; margin: 2px 0 0 0; }
.mpx-riscado { color: #8a939e; font-weight: 400; font-size: 12px; }
.mpx-acrescimo { color: #8a6d3b; font-size: 11px; }
.mpx-item { cursor: pointer; } /* linha inteira clicavel */
.mpx-item-foto { -webkit-flex-shrink: 0; flex-shrink: 0; margin-left: 8px; }
.mpx-item-foto img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; }

/* radio desmarcavel (permiteate == 1) */
.mpx-radio-circulo {
	width: 22px; height: 22px;
	border-radius: 50%;
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
}
.mpx-radio-circulo i { font-size: 11px; color: #fff; display: none; }
.mpx-item-radio, .mpx-sabor-radio { cursor: pointer; }
.mpx-item-radio.mpx-marcado .mpx-radio-circulo i,
.mpx-sabor-radio.mpx-marcado .mpx-radio-circulo i { display: block; }

/* rodape do sheet */
.mpx-rodape {
	position: -webkit-sticky;
	position: sticky;
	bottom: 0;
	background: #fff;
	margin: 0 -12px;
	padding: 12px 16px;
	padding-bottom: calc(12px + env(safe-area-inset-bottom));
	box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.08);
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	z-index: 6;
}
.mpx-qtd-box {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	border: 1px solid #e1e5ea;
	border-radius: 12px;
	overflow: hidden;
	height: 48px;
	margin-right: 8px;
	background: #fff;
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
}
.mpx-qtd-box button {
	-webkit-appearance: none;
	appearance: none;
	border: none;
	background: #f7f9fb;
	width: 44px; height: 48px;
	font-size: 16px;
	cursor: pointer;
	outline: none;
}
.mpx-qtd-menos i { color: #EE4B2B; }
.mpx-qtd-mais i { color: #097969; }
.mpx-qtd-input {
	width: 42px; height: 48px;
	text-align: center;
	border: 0;
	border-left: 1px solid #eef1f5;
	border-right: 1px solid #eef1f5;
	font-size: 17px;
	font-weight: 700;
	color: #1f1f1f;
	background: #fff;
	-webkit-appearance: none;
	padding: 0;
}
.mpx-btn-inserir, .mpx-btn-continuar {
	-webkit-flex: 1;
	flex: 1;
	height: 48px;
	border: none;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
}
.mpx-btn-inserir-total { margin-left: 8px; font-weight: 700; }
.mpx-btn-inserir-txt { margin-left: 6px; }
.mpx-btn-inserir i { margin-right: 0; }

/* botao de acao "desligado" enquanto os criterios obrigatorios nao foram
   atendidos: SO visual (opacidade) - o clique continua ativo de proposito,
   para as mensagens de validacao existentes (badge/swal/toast) explicarem
   o que falta (paridade com o confirm-button.disabled do montesuapizza) */
.mpx-btn-off {
	opacity: 0.5;
	-webkit-transition: opacity 0.25s ease;
	transition: opacity 0.25s ease;
}

/* busca das opcoes */
.mpx-busca-abrir {
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	margin-left: 6px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #424040;
	font-size: 16px;
	cursor: pointer;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
}
.mpx-busca-abrir:active { background: #e4e4e4; }
.mpx-busca-linha { display: none; }
.mpx-busca-aberta { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.mpx-busca-aberta .mpx-tipo-titulo,
.mpx-busca-aberta .mpx-combo-etapa-nome { -webkit-flex: 1 1 0; flex: 1 1 0; min-width: 0; }
.mpx-busca-aberta .mpx-busca-abrir { display: none; }
.mpx-busca-aberta .mpx-busca-linha {
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-flex: 0 0 100%;
	flex: 0 0 100%;
	margin-top: 10px;
}
.mpx-busca-campo {
	-webkit-flex: 1;
	flex: 1;
	min-width: 0;
	height: 42px;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	padding: 0 2px 0 12px;
	background: #fff;
	border: 1px solid #e1e5ea;
	border-radius: 10px;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}
.mpx-busca-campo > i { color: #8a939c; font-size: 14px; margin-right: 8px; }
.mpx-busca-input {
	-webkit-flex: 1;
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: #1f1f1f;
	font-size: 16px; /* abaixo de 16px o iOS da zoom ao focar */
	-webkit-appearance: none;
}
.mpx-busca-limpar,
.mpx-busca-fechar {
	-webkit-flex-shrink: 0;
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #5a6470;
	cursor: pointer;
	display: -webkit-flex;
	display: flex;
	-webkit-align-items: center;
	align-items: center;
	-webkit-justify-content: center;
	justify-content: center;
}
.mpx-busca-limpar { visibility: hidden; font-size: 15px; }
.mpx-busca-com-texto .mpx-busca-limpar { visibility: visible; }
.mpx-busca-fechar { margin-left: 4px; font-size: 16px; }
/* os separadores originais ficariam fora do lugar ao reordenar: o bloco traz o seu */
.mpx-busca-bloco > .mpx-hr,
.mpx-busca-lista > .msc-divider { display: none; }
.mpx-busca-bloco + .mpx-busca-bloco:before { content: ""; display: block; border-top: 1px solid #f0f0f0; margin: 0 12px; }
.mpx-combo-lista .mpx-busca-bloco + .mpx-busca-bloco:before { border-top-color: #f2f2f2; margin: 0 16px; }
.mpx-busca-achou .mpx-item-nome:before,
#mpxCorpo .mpx-busca-achou .msc-nome:before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #f5a623;
	vertical-align: middle;
	position: relative;
	top: -1px;
}

/* tipo de adicional CHEIO (atingiu o maximo/permiteate): esmaece o que nao da
   mais para adicionar. Itens ja selecionados continuam nitidos (o "-" segue
   util para reduzir); o clique continua ativo de proposito - o aviso legado
   ("quantidade maxima de opcoes") explica o porque ao tocar. */
.mpx-tipo-cheio .mpx-item:not(.mpx-tem-qtd) { opacity: 0.45; }
.mpx-tipo-cheio .mpx-item:not(.mpx-tem-qtd) .mpx-item-nome,
.mpx-tipo-cheio .mpx-item:not(.mpx-tem-qtd) .mpx-item-desc,
.mpx-tipo-cheio .mpx-item:not(.mpx-tem-qtd) .mpx-item-valor { color: #9aa1a8; }
.mpx-tipo-cheio .mpx-mais i { color: #c3c9cf !important; }
.mpx-tipo-cheio .mpx-item:not(.mpx-tem-qtd) .mpx-radio-circulo { border-color: #c3c9cf; }

/* aviso rapido dentro do sheet (posicao final calculada pelo JS de cada modal) */
.mpx-toast {
	position: absolute;
	bottom: 96px; /* fallback; o JS calcula a altura real do rodape */
	left: 50%;
	-webkit-transform: translateX(-50%);
	transform: translateX(-50%);
	background: rgba(33, 33, 33, 0.92);
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	padding: 10px 16px;
	border-radius: 20px;
	z-index: 20;
	max-width: 90%;
	text-align: center;
	pointer-events: none;
}
