/* ==========================================================================
   Migabo — movimento (Fase 4): pílula elástica e barras de baixo do celular.
   As barras funcionam mesmo se o arquivo de movimento (motion.js) falhar: aí o item
   ativo fica só com fundo colorido, sem a pílula correndo.
   ========================================================================== */

/* ---------- Pílula elástica (criada pelo motion.js dentro das listas) ---------- */
.has-pill { position: relative; }
.dh-pill {
	position: absolute; left: 0; top: 0; z-index: 0;
	opacity: 0; pointer-events: none;
	border-radius: 999px;
	background: var(--dh-primary, #027f76);
	box-shadow: 0 6px 16px color-mix(in srgb, var(--dh-primary, #027f76) 35%, transparent);
	will-change: transform, width, height;
}

/* Abas de categoria do cardápio: com a pílula, viram "chips" */
.dh-categories-scroll.has-pill { padding-top: 8px; padding-bottom: 8px; }
.dh-categories-scroll.has-pill a {
	position: relative; z-index: 1;
	padding: 9px 16px; border-bottom: 0;
	border-radius: 999px;
}
.dh-categories-scroll.has-pill a.is-active,
.dh-categories-scroll.has-pill a.is-active:hover { color: var(--dh-on-primary, #fff); }
.dh-categories-scroll.has-pill a:not(.is-active):hover { color: var(--dh-primary-ink, #027f76); }

/* ---------- Barra de baixo do cliente (celular) ---------- */
.dh-bnav { display: none; }
@media (max-width: 767px) {
	.dh-bnav {
		display: block;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
		padding: 6px 12px max(10px, env(safe-area-inset-bottom));
		pointer-events: none;
	}
	.dh-bnav-list {
		pointer-events: auto;
		display: flex; align-items: stretch; gap: 2px;
		height: 66px; padding: 6px;
		background: var(--dh-surface, #fff);
		border: 1px solid var(--dh-border, #e5e7eb);
		border-radius: 26px;
		box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
	}
	.dh-bnav-list .dh-pill { border-radius: 20px; }
	.dh-bnav-item {
		position: relative; z-index: 1; flex: 1;
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
		border: 0; background: transparent; border-radius: 20px;
		color: var(--dh-muted, #6b7280); text-decoration: none;
		font: 600 calc(11.5px * var(--dh-fs, 1)) / 1.1 var(--dh-font-heading, inherit);
		-webkit-tap-highlight-color: transparent;
		transition: color .2s;
	}
	.dh-bnav-item svg { width: 22px; height: 22px; }
	/* sem pílula (movimento desligado/falhou): fundo suave no ativo */
	.dh-bnav-item[data-ativo="true"] { color: var(--dh-primary-ink, #027f76); background: color-mix(in srgb, var(--dh-brand, #02968c) 12%, white); }
	.has-pill .dh-bnav-item[data-ativo="true"] { color: var(--dh-on-primary, #fff); background: transparent; }
	.dh-bnav-badge {
		position: absolute; top: 4px; left: calc(50% + 6px);
		min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
		background: var(--dh-accent, #e00213); color: var(--dh-on-accent, #fff);
		font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
	}
	.dh-bnav-total { font-size: calc(10.5px * var(--dh-fs, 1)); font-weight: 700; opacity: .85; }
	/* a barra substitui o botão flutuante do carrinho no celular e ganha espaço no fim da página */
	body.has-bnav .dh-cart-fab { display: none !important; }
	body.has-bnav .dh-main, body.has-bnav .dh-mo-wrap { padding-bottom: 110px; }
	/* teclado aberto: a barra sai do caminho */
	html.dh-teclado .dh-bnav { display: none; }
}

/* ---------- Barra de baixo da equipe (painel no celular) ---------- */
.dh-anav { display: none; }
@media (max-width: 782px) {
	.dh-anav {
		display: block;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
		padding: 6px 10px max(10px, env(safe-area-inset-bottom));
		pointer-events: none;
	}
	.dh-anav-list {
		pointer-events: auto;
		display: flex; gap: 2px; height: 64px; padding: 6px;
		background: #fff; border: 1px solid #e5e7eb; border-radius: 24px;
		box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
	}
	.dh-anav-list .dh-pill { border-radius: 18px; }
	.dh-anav-item {
		position: relative; z-index: 1; flex: 1;
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
		border: 0; background: transparent; border-radius: 18px;
		color: #4b5563; text-decoration: none; font-size: 11.5px; font-weight: 700;
		font-family: var(--dh-font-heading, inherit);
		-webkit-tap-highlight-color: transparent;
	}
	.dh-anav-item svg { width: 22px; height: 22px; }
	.dh-anav-item:focus { box-shadow: none; outline: none; }
	.dh-anav-item:focus-visible { outline: 3px solid var(--dh-primary-ink, #027f76); outline-offset: -3px; }
	.dh-anav-item[data-ativo="true"] { color: var(--dh-primary-ink, #027f76); background: color-mix(in srgb, var(--dh-brand, #02968c) 12%, white); }
	.has-pill .dh-anav-item[data-ativo="true"] { color: var(--dh-on-primary, #fff); background: transparent; }
	body.has-anav #wpbody-content { padding-bottom: 120px; }
	body.has-anav .dhq-toast { bottom: 96px; }
}

/* ---------- Painel rápido: abas com pílula ---------- */
.dhq-tabs.has-pill button { position: relative; z-index: 1; }
.dhq-tabs.has-pill button.on { background: transparent; box-shadow: none; color: var(--dh-on-primary, #fff); }
.dhq-tabs.has-pill .dh-pill { border-radius: 9px; }

/* ---------- Menu lateral do painel (computador): pílula no item aberto ---------- */
@media (min-width: 783px) {
	#adminmenu.has-pill > li.menu-top { position: relative; z-index: 1; }
	#adminmenu.has-pill > .dh-pill { border-radius: 10px; left: 0; box-shadow: none; }
	#adminmenu.has-pill > li.current > a.menu-top,
	#adminmenu.has-pill > li.wp-has-current-submenu > a.menu-top { background: transparent !important; color: var(--dh-on-primary, #fff) !important; }
	#adminmenu.has-pill > li.current > a.menu-top div.wp-menu-image::before,
	#adminmenu.has-pill > li.wp-has-current-submenu > a.menu-top div.wp-menu-image::before { color: var(--dh-on-primary, #fff) !important; }
	#adminmenu.has-pill > li.wp-has-current-submenu > a.menu-top::after,
	#adminmenu.has-pill > li.current > a.menu-top::after { display: none; }
}

/* ---------- Reduzir movimento: nada corre, nada pula ---------- */
@media (prefers-reduced-motion: reduce) {
	.dh-pill { transition: none !important; }
	.dh-categories-scroll { scroll-behavior: auto; }
}
