/* Orçamentos — Menu de categorias com produtos: [menu_categorias] */

.pmc {
	--pmc-accent: #1F3664;
	--pmc-accent-txt: #fff;
	--pmc-ink: #0f172a;
	--pmc-muted: #6b7280;
	--pmc-faint: #9ca3af;
	--pmc-line: #e8ebf0;
	--pmc-sunk: #f7f8fa;
	--pmc-surface: #fff;
	--pmc-t: .18s cubic-bezier(.2, .8, .2, 1);
	position: relative;
	display: inline-block;
	font-family: inherit;
	color: var(--pmc-ink);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.pmc *, .pmc *::before, .pmc *::after { box-sizing: border-box; }
.pmc ul, .pmc li { margin: 0; padding: 0; list-style: none; border: 0; }
.pmc a { text-decoration: none; box-shadow: none; color: inherit; }
.pmc .pmc-ico { width: 18px; height: 18px; flex: none; }

/* ---------- botão do cabeçalho ---------- */
.pmc .pmc-abrir {
	display: inline-flex; align-items: center; gap: 9px; height: 44px; margin: 0; padding: 0 16px;
	border: 1px solid var(--pmc-line); border-radius: 12px; background: var(--pmc-surface);
	font: inherit; font-size: 14.5px; font-weight: 600; color: var(--pmc-ink); cursor: pointer;
	transition: border-color var(--pmc-t), color var(--pmc-t);
}
.pmc .pmc-abrir .pmc-ico { color: var(--pmc-accent); }
.pmc .pmc-abrir:hover, .pmc.is-aberto .pmc-abrir { border-color: var(--pmc-accent); color: var(--pmc-accent); }
.pmc .pmc-abrir:focus-visible { outline: 2px solid var(--pmc-accent); outline-offset: 2px; }

/* ---------- painel ---------- */
.pmc-painel {
	position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
	width: min(1100px, calc(100vw - 32px));
	padding: 14px; background: var(--pmc-surface);
	border: 1px solid var(--pmc-line); border-radius: 20px;
	box-shadow: 0 30px 70px -24px rgba(15, 23, 42, .45);
	animation: pmc-entra .16s ease-out;
}
.pmc-painel[hidden] { display: none; }
@keyframes pmc-entra { from { opacity: 0; transform: translateY(-6px); } }
.pmc--aberto { display: block; width: 100%; }
.pmc--aberto .pmc-painel { position: static; width: auto; animation: none; box-shadow: none; }

.pmc-grelha { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }

/* ---------- categorias (coluna esquerda) ---------- */
.pmc-cats { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.pmc .pmc-cat {
	display: flex; align-items: center; gap: 11px; padding: 9px 11px;
	border: 2px solid var(--pmc-ink); border-radius: 12px; background: var(--pmc-surface);
	font-size: 15px; font-weight: 600; cursor: pointer;
	transition: background var(--pmc-t), border-color var(--pmc-t), transform var(--pmc-t);
}
.pmc .pmc-cat:hover { transform: translateX(2px); }
.pmc .pmc-cat.is-ativa { background: var(--pmc-accent); border-color: var(--pmc-accent); color: var(--pmc-accent-txt); }
.pmc-cat-img {
	width: 40px; height: 40px; flex: none; overflow: hidden; border-radius: 8px; background: var(--pmc-sunk);
	display: grid; place-items: center;
}
.pmc-cat-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pmc-cat-img--vazia { width: 100%; height: 100%; background: linear-gradient(135deg, #eef1f5, #e3e8ee); }
.pmc-cat-txt { display: flex; flex-direction: column; min-width: 0; }
.pmc-cat-nome { font-size: 15px; font-weight: 650; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmc-cat-txt small { font-size: 11.5px; font-weight: 500; color: var(--pmc-muted); }
.pmc .pmc-cat.is-ativa .pmc-cat-txt small { color: var(--pmc-accent-txt); opacity: .7; }
.pmc .pmc-cat:focus-visible { outline: 2px solid var(--pmc-accent); outline-offset: 3px; }

/* ---------- produtos (à direita, em linha) ---------- */
.pmc-produtos { position: relative; min-width: 0; }

/* Esbatido nas pontas: mostra que a linha continua para lá do que se vê. */
.pmc-produtos::before, .pmc-produtos::after {
	content: ""; position: absolute; top: 0; bottom: 14px; width: 54px; z-index: 3;
	pointer-events: none; opacity: 0; transition: opacity var(--pmc-t);
}
.pmc-produtos::before { left: -2px; background: linear-gradient(90deg, var(--pmc-surface), rgba(255, 255, 255, 0)); }
.pmc-produtos::after  { right: -2px; background: linear-gradient(270deg, var(--pmc-surface), rgba(255, 255, 255, 0)); }
.pmc-produtos.tem-esq::before, .pmc-produtos.tem-dir::after { opacity: 1; }

/* Setas por cima das pontas. */
.pmc .pmc-desl {
	position: absolute; top: calc(50% - 26px); z-index: 4;
	width: 40px; height: 40px; margin: 0; padding: 0; display: grid; place-items: center;
	border: 1px solid var(--pmc-line); border-radius: 50%; background: var(--pmc-surface); color: var(--pmc-ink);
	box-shadow: 0 6px 18px -6px rgba(15, 23, 42, .35); cursor: pointer;
	transition: transform var(--pmc-t), border-color var(--pmc-t), color var(--pmc-t);
}
.pmc .pmc-desl[hidden] { display: none; }
.pmc .pmc-desl:hover { border-color: var(--pmc-accent); color: var(--pmc-accent); transform: scale(1.06); }
.pmc .pmc-desl:focus-visible { outline: 2px solid var(--pmc-accent); outline-offset: 2px; }
.pmc .pmc-desl .pmc-ico { width: 20px; height: 20px; }
.pmc-desl--ant { left: -14px; }
.pmc-desl--seg { right: -14px; }

.pmc-lista {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr);
	gap: 12px; overflow-x: auto; padding-bottom: 10px;
	scroll-behavior: smooth; scroll-snap-type: x proximity;
}
.pmc-lista > * { scroll-snap-align: start; }
/* Barra sempre visível: no macOS as barras são flutuantes e não se veem.
   Nota: o Chrome ignora estas regras se existir scrollbar-width, por isso
   essa propriedade não é usada aqui (o Firefox mostra a sua, que já é visível). */
.pmc-lista::-webkit-scrollbar { height: 8px; }
.pmc-lista::-webkit-scrollbar-track { background: var(--pmc-sunk); border-radius: 99px; }
.pmc-lista::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--pmc-accent) 55%, #cbd5e1); border-radius: 99px; }
.pmc-lista::-webkit-scrollbar-thumb:hover { background: var(--pmc-accent); }
.pmc-lista[hidden] { display: none; }

.pmc-card {
	display: flex; flex-direction: column; min-width: 0; padding: 12px;
	border: 1px solid var(--pmc-line); border-radius: 16px; background: var(--pmc-surface);
	box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
	transition: border-color var(--pmc-t), transform var(--pmc-t), box-shadow var(--pmc-t);
}
.pmc-card:hover { border-color: var(--pmc-accent); transform: translateY(-2px); box-shadow: 0 16px 30px -22px rgba(15, 23, 42, .6); }

.pmc-card-topo { position: relative; }
.pmc-card-img { display: block; height: 128px; border-radius: 10px; overflow: hidden; background: var(--pmc-sunk); }
.pmc-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }

.pmc .pmc-add {
	position: absolute; top: 6px; left: 6px; z-index: 2;
	display: inline-flex; align-items: center; gap: 5px; height: 28px; margin: 0; padding: 0 10px;
	border: 0; border-radius: 999px; background: var(--pmc-ink); color: #fff;
	font: inherit; font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer;
	transition: filter var(--pmc-t), background var(--pmc-t);
}
.pmc .pmc-add .pmc-ico { width: 13px; height: 13px; }
.pmc .pmc-add:hover { filter: brightness(1.25); }
.pmc .pmc-add.is-ok { background: #15803d; }
.pmc .pmc-add:focus-visible { outline: 2px solid var(--pmc-accent); outline-offset: 2px; }

.pmc-card-cat {
	margin-top: 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
	color: var(--pmc-accent); text-transform: none;
}
.pmc .pmc-card-nome {
	margin-top: 4px; font-size: 13.5px; font-weight: 650; line-height: 1.35; color: var(--pmc-ink);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pmc .pmc-card-nome:hover { color: var(--pmc-accent); }

.pmc-card-fundo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.pmc-card-sku {
	font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
	font-size: 10.5px; color: var(--pmc-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pmc .pmc-card-seta {
	display: grid; place-items: center; width: 34px; height: 30px; flex: none;
	border-radius: 8px; background: var(--pmc-accent); color: var(--pmc-accent-txt);
	transition: filter var(--pmc-t);
}
.pmc .pmc-card-seta:hover { filter: brightness(1.08); }
.pmc .pmc-card-seta .pmc-ico { width: 16px; height: 16px; }

.pmc .pmc-todos {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
	min-width: 150px; padding: 12px; text-align: center;
	border: 1px dashed var(--pmc-line); border-radius: 16px; background: var(--pmc-sunk);
	font-size: 13px; font-weight: 600; color: var(--pmc-ink);
	transition: border-color var(--pmc-t), color var(--pmc-t);
}
.pmc .pmc-todos strong { font-size: 18px; color: var(--pmc-accent); }
.pmc .pmc-todos:hover { border-color: var(--pmc-accent); color: var(--pmc-accent); }

/* ---------- aviso ---------- */
.pmc-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 99999;
	padding: 12px 18px; border-radius: 12px; background: #0f172a; color: #fff;
	font-size: 14px; opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.pmc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.pmc-toast[hidden] { display: none; }

/* ---------- ecrãs estreitos ---------- */
@media (max-width: 860px) {
	.pmc-painel { width: min(560px, calc(100vw - 24px)); }
	.pmc-grelha { grid-template-columns: minmax(0, 1fr); }
	.pmc-cats { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
	.pmc .pmc-cat { white-space: nowrap; }
	.pmc-cat-txt small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pmc *, .pmc *::before, .pmc *::after { transition: none !important; animation: none !important; }
}

/* =====================================================
 * Versão de telemóvel — [menu_categorias_mobile]
 * ===================================================== */
.pmcm { display: block; width: 100%; }
.pmcm-cats { display: flex; flex-direction: column; gap: 10px; }

.pmcm-item {
	border: 1px solid var(--pmc-line); border-radius: 16px; background: var(--pmc-surface); overflow: hidden;
	transition: border-color var(--pmc-t);
}
.pmcm-item.is-aberta { border-color: var(--pmc-accent); }

.pmc .pmcm-cat {
	display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px;
	margin: 0; padding: 10px 14px; border: 0; background: none;
	font: inherit; text-align: left; color: var(--pmc-ink); cursor: pointer;
}
.pmcm-item.is-aberta .pmcm-cat { background: var(--pmc-accent); color: var(--pmc-accent-txt); }
.pmcm-cat-img {
	width: 46px; height: 46px; flex: none; overflow: hidden; border-radius: 10px;
	background: var(--pmc-sunk); display: grid; place-items: center;
}
.pmcm-cat-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pmcm-cat-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pmcm-cat-nome { font-size: 16px; font-weight: 650; line-height: 1.25; }
.pmcm-cat-txt small { font-size: 12px; color: var(--pmc-muted); }
.pmcm-item.is-aberta .pmcm-cat-txt small { color: var(--pmc-accent-txt); opacity: .75; }
.pmcm-seta { display: grid; place-items: center; width: 26px; height: 26px; flex: none; transition: transform var(--pmc-t); }
.pmcm-seta svg { width: 20px; height: 20px; }
.pmcm-item.is-aberta .pmcm-seta { transform: rotate(180deg); }
.pmc .pmcm-cat:focus-visible { outline: 2px solid var(--pmc-accent); outline-offset: -3px; }

.pmcm-painel { padding: 12px 0 10px; }
.pmcm-painel[hidden] { display: none; }

/* produtos: uma linha que se desliza com o dedo, com encaixe */
.pmcm-lista {
	display: grid; grid-auto-flow: column; grid-auto-columns: 62%;
	gap: 10px; padding: 0 14px 10px; overflow-x: auto;
	scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.pmcm-lista > * { scroll-snap-align: center; }
.pmcm-lista::-webkit-scrollbar { height: 6px; }
.pmcm-lista::-webkit-scrollbar-track { background: var(--pmc-sunk); border-radius: 99px; }
.pmcm-lista::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--pmc-accent) 55%, #cbd5e1); border-radius: 99px; }
.pmcm-card .pmc-card-img { height: 116px; }
.pmcm-card .pmc-card-nome { -webkit-line-clamp: 3; }

.pmcm-fundo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; flex-wrap: wrap; }
.pmcm-dica {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 12px; color: var(--pmc-muted);
}
.pmcm-dica::after { content: "›››"; letter-spacing: -2px; animation: pmcm-desliza 1.4s ease-in-out infinite; }
.pmcm-dica[hidden] { display: none; }
@keyframes pmcm-desliza { 50% { opacity: .35; transform: translateX(3px); } }
.pmc .pmcm-todos {
	display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 16px;
	border-radius: 999px; background: var(--pmc-accent); color: var(--pmc-accent-txt);
	font-size: 13.5px; font-weight: 650;
}
.pmc .pmcm-todos .pmc-ico { width: 15px; height: 15px; }

@media (min-width: 720px) {
	.pmcm-lista { grid-auto-columns: 232px; }
}
