/**
 * MyD Delivery - product tag and featured products.
 */

/* Tag on the product card */
.myd-product-item__tag-wrapper {
	flex-basis: 100%;
	width: 100%;
	margin-block-end: 6px;
}

.myd-product-item__tag {
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
	padding: 2px 10px;
	border: 1px solid #e5e5e5;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	text-overflow: ellipsis;
	vertical-align: middle;
	white-space: nowrap;
}

/* Tag de promoção (acréscimo nosso). Vermelho sólido é a cor que o cliente já
   lê como "preço baixo". Só entra quando o texto fala de preço — promoção,
   oferta, desconto, "% off" (ver Product_Highlights::is_promo_tag). As outras
   tags ("Novo", "Mais vendido") seguem discretas: se tudo gritasse, nada
   chamaria atenção.

   O !important vence temas que pintam <span> dentro de cards. */
.myd-product-item__tag.myd-product-item__tag--promo {
	border-color: #d32f2f !important;
	background: #e53935 !important;
	color: #fff !important;
	font-weight: 700;
	letter-spacing: .02em;
	box-shadow: 0 1px 6px rgba(229, 57, 53, .35);
	animation: myd-tag-promo-pulso 2.4s ease-in-out infinite;
}

.myd-product-item__tag--promo::before {
	content: '🔥 ';
}

/* Cores das tags (umPedido, 12/10/2026). São três: Promoção (vermelha, a única
   que pulsa — regra acima), Mais pedido e Novo. O tipo sai do texto da tag
   (Product_Highlights::get_tag_type). "outra" é a cor neutra de uma tag
   digitada à mão que não é nenhuma das três. */
.myd-product-item__tag.myd-product-item__tag--pedido,
.myd-product-item__tag.myd-product-item__tag--novo,
.myd-product-item__tag.myd-product-item__tag--outra {
	color: #fff !important;
	font-weight: 700;
	letter-spacing: .02em;
}
.myd-product-item__tag.myd-product-item__tag--pedido { background: #ea7a0c !important; border-color: #c2640a !important; }
.myd-product-item__tag.myd-product-item__tag--novo   { background: #16a34a !important; border-color: #12843c !important; }
.myd-product-item__tag.myd-product-item__tag--outra  { background: #334155 !important; border-color: #263242 !important; }
.myd-product-item__tag--pedido::before { content: '⭐ '; }
.myd-product-item__tag--novo::before   { content: '✨ '; }

/* Um pulso lento, não um pisca-pisca: chama o olho sem cansar. */
@keyframes myd-tag-promo-pulso {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.06); }
}

/* Quem pediu ao sistema menos movimento não recebe animação. */
@media (prefers-reduced-motion: reduce) {
	.myd-product-item__tag--promo {
		animation: none;
	}
}

/* Featured products section */
.myd-featured {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-block-end: 16px;
}

.myd-featured[hidden] {
	display: none;
}

.myd-featured__list {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-block-end: 6px;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
}

/* Class selectors win over theme styles for the "button" element. */
.myd-featured__item,
.myd-featured__item:hover,
.myd-featured__item:focus {
	display: flex;
	flex: 0 0 140px;
	/* Largura travada: o tema deixa texto de botão sem quebrar linha
	   (white-space: nowrap), e o nome longo esticava o cartão — e a imagem
	   junto. Todos os destaques ficam do mesmo tamanho. */
	width: 140px;
	min-width: 0;
	max-width: 140px;
	white-space: normal;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	margin: 0;
	padding: 10px;
	border: 1px solid #efefef;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	color: inherit;
	cursor: pointer;
	font: inherit;
	scroll-snap-align: start;
	text-align: left;
	text-transform: none;
}

.myd-featured__item:hover,
.myd-featured__item:focus {
	border-color: #d9d9d9;
}

.myd-featured__image {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 6px;
	background: #ececec;
}

.myd-featured__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.myd-featured__name {
	display: -webkit-box;
	width: 100%;
	overflow: hidden;
	white-space: normal;
	overflow-wrap: anywhere;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.myd-featured__price.myd-product-item__price {
	font-size: 13px;
	text-align: left;
	white-space: normal;
}

/*
 * Janela do produto no celular (umPedido, 08/10/2026).
 * Antes a imagem ficava fixa no topo e as opções rolavam numa faixa estreita
 * no meio (numa pizza, ~460px de janela para ~1.800px de opções). Agora a
 * janela inteira rola: a imagem sobe junto, a barra de quantidade e
 * "Adicionar à sacola" fica presa embaixo, e o botão de fechar acompanha.
 * No computador nada muda (sobra altura).
 */
@media (max-width: 768px) {
	.myd-product-popup__wrapper {
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}
	.myd-product-popup__image-container,
	.fdm-popup-product-content {
		flex: 0 0 auto !important;
		overflow: visible !important;
		max-height: none !important;
	}
	/* As opções do MyD têm uma camada clicável com z-index 999999999: rolando
	   por baixo da barra fixa, ela cobria o "Adicionar à sacola" e o toque
	   marcava a opção em vez de adicionar. Aqui elas ficam isoladas numa
	   camada abaixo da barra (o z-index alto passa a valer só entre elas). */
	.fdm-popup-product-content {
		position: relative;
		z-index: 1;
		isolation: isolate;
	}
	.fdm-popup-product-action {
		position: sticky !important;
		bottom: 0;
		z-index: 10;
		margin-top: auto;
		background: #fff;
		box-shadow: 0 -4px 14px rgba(16, 24, 40, .1);
	}
	.myd-product-popup__image-container .fdm-popup-close-btn {
		position: fixed !important;
		z-index: 4;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		border-radius: 50%;
		background: #fff;
		box-shadow: 0 2px 8px rgba(16, 24, 40, .25);
	}
}

/* Ao faltar uma opção obrigatória, a janela rola até o grupo: a folga evita
   que o título fique atrás do botão de fechar. */
.fdm-extra-option-title { scroll-margin-top: 70px; }
