/* =========================================================================
   Mobler B2B — componentes (Ref/EAN, bloco técnico, checkout)
   Carregado sempre, mesmo com o design system desligado.
   ========================================================================= */
:root {
	--mb-primary: #0C223F;
	--mb-accent: #C2410C;
	--mb-ink: #111827;
	--mb-muted: #4B5563;
	--mb-surface: #F3F5F8;
	--mb-border: #D1D5DB;
	--mb-success: #047857;
	--mb-danger: #B91C1C;
	--mb-radius: 8px;
	--mb-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

/* ---------- Ref / EAN inline (carrinho, checkout, encomendas, emails) ---------- */
.mb-codes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
	line-height: 1.2;
}
.mb-code {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 8px;
	border: 1px solid var(--mb-border);
	border-radius: 4px;
	background: #fff;
	font-size: 12px;
	color: var(--mb-ink);
	white-space: nowrap;
}
.mb-code__k {
	font-weight: 700;
	font-size: 10.5px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--mb-muted);
}
.mb-code__v {
	font-family: var(--mb-mono);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	user-select: all; /* um clique seleciona o código inteiro */
}

/* ---------- Bloco técnico na ficha de produto ---------- */
.mb-spec {
	margin: 18px 0 22px;
	border: 1px solid var(--mb-border);
	border-left: 4px solid var(--mb-primary);
	border-radius: var(--mb-radius);
	background: var(--mb-surface);
	overflow: hidden;
}
.mb-spec__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
}
.mb-spec__row {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--mb-border);
}
.mb-spec__row:nth-child(odd) { border-right: 1px solid var(--mb-border); }
.mb-spec__row:nth-last-child(-n+2) { border-bottom: 0; }
.mb-spec dt {
	margin: 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--mb-muted);
}
.mb-spec dd {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--mb-ink);
	word-break: break-word;
}
.mb-spec__sku,
.mb-spec__ean {
	font-family: var(--mb-mono);
	font-variant-numeric: tabular-nums;
	user-select: all;
}
.mb-spec__exvat .amount { color: var(--mb-ink); }
.mb-stock--instock { color: var(--mb-success) !important; }
.mb-stock--outofstock { color: var(--mb-danger) !important; }
.mb-stock--onbackorder { color: #92400E !important; }

/* EAN acrescentado ao widget Product Meta do Elementor */
.mb-meta-ean,
.mb-meta-exvat { display: block; }
.mb-meta-ean .detail-content { font-family: var(--mb-mono); user-select: all; }

/* Ref nos cartões de produto (loja / categorias) */
.mb-loop-ref {
	display: block;
	margin: 2px 0 6px;
	font-family: var(--mb-mono);
	font-size: 12px;
	color: var(--mb-muted);
}

/* ---------- Checkout: artigo com foto ---------- */
.woocommerce-checkout-review-order-table .product-name { vertical-align: top; }
.mb-co-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}
.mb-co-item__img {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border: 1px solid var(--mb-border);
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.mb-co-item__img img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: contain;
	margin: 0 !important;
	padding: 4px;
	box-sizing: border-box;
}
.mb-co-item__body { min-width: 0; display: block; }
.mb-co-item__name {
	display: block;
	font-weight: 600;
	color: var(--mb-ink);
	line-height: 1.35;
}

/* ---------- Checkout: quantidade ---------- */
.mb-qty {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin: 10px 0 0 84px; /* alinha com o texto, ao lado da foto */
}
.mb-qty__label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--mb-muted);
}
.mb-qty__ctrl {
	display: inline-flex;
	align-items: stretch;
	height: 40px;
	border: 1.5px solid #6B7280;
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}
.mb-qty__btn {
	all: unset;
	box-sizing: border-box;
	width: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 600;
	line-height: 1;
	color: var(--mb-ink);
	background: var(--mb-surface);
	cursor: pointer;
	user-select: none;
}
.mb-qty__btn:hover { background: #E5E7EB; }
.mb-qty__btn:focus-visible { outline: 3px solid var(--mb-primary); outline-offset: -3px; }
.mb-qty .mb-qty__input,
.woocommerce .mb-qty .mb-qty__input {
	width: 56px !important;
	min-height: 0 !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 4px !important;
	border: 0 !important;
	border-left: 1px solid var(--mb-border) !important;
	border-right: 1px solid var(--mb-border) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: #fff !important;
	color: var(--mb-ink) !important;
	font-size: 16px !important; /* evita zoom no iOS */
	font-weight: 700;
	text-align: center;
	-moz-appearance: textfield;
}
.mb-qty__input::-webkit-outer-spin-button,
.mb-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.mb-qty__input:focus { outline: 3px solid var(--mb-primary); outline-offset: -3px; }
.mb-qty__remove {
	all: unset;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	color: var(--mb-danger);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.mb-qty__remove:focus-visible { outline: 2px solid var(--mb-danger); outline-offset: 2px; }
.mb-qty--fixed { color: var(--mb-ink); }

.mb-qty.is-loading { opacity: .5; pointer-events: none; }
.woocommerce-checkout-review-order-table.mb-busy { opacity: .65; transition: opacity .15s; }
tr.mb-removing { opacity: .3; }

@media (max-width: 520px) {
	.mb-co-item__img { flex-basis: 56px; width: 56px; height: 56px; }
	.mb-qty { margin-left: 0; }
	.mb-spec__grid { grid-template-columns: 1fr; }
	.mb-spec__row:nth-child(odd) { border-right: 0; }
	.mb-spec__row:nth-last-child(2) { border-bottom: 1px solid var(--mb-border); }
}

/* Proteção contra o estilo global de botões do Kit do Elementor */
html body .mb-qty .mb-qty__btn,
html body .mb-qty .mb-qty__btn:focus {
	background: var(--mb-surface) !important; color: var(--mb-ink) !important; border: 0 !important; border-radius: 0 !important;
	padding: 0 !important; width: 40px !important; min-height: 0 !important; font-size: 20px !important; box-shadow: none !important;
}
html body .mb-qty .mb-qty__btn:hover { background: #E5E7EB !important; color: var(--mb-ink) !important; }
html body .mb-qty .mb-qty__remove,
html body .mb-qty .mb-qty__remove:hover,
html body .mb-qty .mb-qty__remove:focus {
	background: transparent !important; color: var(--mb-danger) !important; border: 0 !important; padding: 0 !important;
	min-height: 0 !important; font-size: 13px !important; font-weight: 600 !important; text-decoration: underline !important; box-shadow: none !important;
}

/* =========================================================================
   Carrinho / Checkout em BLOCOS do WooCommerce
   ========================================================================= */
/* Ref / EAN (vêm como "item data" por baixo do nome) */
.wc-block-components-product-details { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0 !important; padding: 0 !important; list-style: none !important; }
.wc-block-components-product-details li[class*="__ref"],
.wc-block-components-product-details li[class*="__ean"] {
	display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; padding: 3px 8px;
	border: 1px solid var(--mb-border); border-radius: 4px; background: #fff; font-size: 12px; line-height: 1.3; color: var(--mb-ink);
}
.wc-block-components-product-details li[class*="__ref"] .wc-block-components-product-details__name,
.wc-block-components-product-details li[class*="__ean"] .wc-block-components-product-details__name {
	font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mb-muted);
}
.wc-block-components-product-details li[class*="__ref"] .wc-block-components-product-details__value,
.wc-block-components-product-details li[class*="__ean"] .wc-block-components-product-details__value {
	font-family: var(--mb-mono); font-weight: 600; font-variant-numeric: tabular-nums; user-select: all;
}
/* O separador ":" que o WooCommerce põe entre nome e valor */
.wc-block-components-product-details li[class*="__ref"] .wc-block-components-product-details__name::after,
.wc-block-components-product-details li[class*="__ean"] .wc-block-components-product-details__name::after { content: ""; }

/* Botão principal (Finalizar compra / Fazer encomenda) — branco sobre laranja, 5.2:1 */
html body .wc-block-cart__submit-button,
html body .wc-block-components-checkout-place-order-button,
html body .wc-block-components-button.contained:not(.is-link),
html body .wc-block-mini-cart__footer-checkout {
	background: var(--mb-accent) !important; color: #fff !important; border: 0 !important; border-radius: 6px !important;
	min-height: 54px !important; padding: 14px 24px !important; font-size: 17px !important; font-weight: 700 !important;
	text-decoration: none !important; box-shadow: none !important; opacity: 1 !important;
}
html body .wc-block-cart__submit-button:hover,
html body .wc-block-components-checkout-place-order-button:hover,
html body .wc-block-components-button.contained:not(.is-link):hover,
html body .wc-block-mini-cart__footer-checkout:hover { background: #9A3412 !important; color: #fff !important; }
html body .wc-block-cart__submit-button .wc-block-components-button__text,
html body .wc-block-components-checkout-place-order-button .wc-block-components-button__text,
html body .wc-block-components-button.contained .wc-block-components-button__text { color: #fff !important; text-decoration: none !important; }
html body .wc-block-components-button.outlined,
html body .wc-block-mini-cart__footer-cart {
	background: #fff !important; color: var(--mb-primary) !important; border: 2px solid var(--mb-primary) !important; border-radius: 6px !important;
}
html body .wc-block-components-button.outlined .wc-block-components-button__text { color: var(--mb-primary) !important; }

/* Nome do artigo e preços */
.wc-block-components-product-name { color: var(--mb-ink) !important; font-weight: 600 !important; text-decoration: none !important; font-size: 15px !important; line-height: 1.35; }
.wc-block-components-product-name:hover { color: var(--mb-primary) !important; text-decoration: underline !important; }
.wc-block-cart-item__prices, .wc-block-cart-item__total .wc-block-components-formatted-money-amount { color: var(--mb-ink) !important; font-weight: 700; }
.wc-block-cart-items__header { color: var(--mb-muted) !important; font-size: 12px !important; letter-spacing: .06em; }
.wc-block-cart-item__image img { border: 1px solid var(--mb-border); border-radius: 6px; padding: 4px; background: #fff; object-fit: contain; }

/* Seletor de quantidade dos blocos (protegido do estilo de botões do Kit) */
html body .wc-block-components-quantity-selector { border: 1.5px solid #6B7280 !important; border-radius: 6px !important; background: #fff !important; }
html body .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
	color: var(--mb-ink) !important; font-weight: 700 !important; font-size: 16px !important; border: 0 !important; box-shadow: none !important; background: transparent !important;
}
html body .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button,
html body .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover,
html body .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus {
	background: var(--mb-surface) !important; color: var(--mb-ink) !important; border: 0 !important; border-radius: 0 !important;
	padding: 0 12px !important; min-height: 0 !important; font-size: 18px !important; box-shadow: none !important; opacity: 1 !important;
}
html body .wc-block-cart-item__remove-link,
html body .wc-block-cart-item__remove-link:hover {
	background: transparent !important; color: #B91C1C !important; border: 0 !important; padding: 4px !important; min-height: 0 !important; box-shadow: none !important;
}
/* Cupão e painéis */
html body .wc-block-components-panel__button,
html body .wc-block-components-panel__button:hover,
html body .wc-block-components-panel__button:focus {
	background: transparent !important; color: var(--mb-ink) !important; border: 0 !important; padding: 12px 0 !important;
	font-weight: 600 !important; text-transform: none !important; box-shadow: none !important; min-height: 0 !important;
}
.wc-block-components-totals-item__label, .wc-block-components-totals-item__value { color: var(--mb-ink) !important; }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value { font-size: 20px !important; font-weight: 800 !important; }
.wc-block-components-totals-footer-item-tax { color: var(--mb-muted) !important; }
.wp-block-woocommerce-cart .wc-block-cart__totals-title { color: var(--mb-ink) !important; font-weight: 800 !important; letter-spacing: .06em; }

/* Carrinho clássico: botão remover */
.woocommerce table.cart td.product-remove a.remove { color: #B91C1C !important; border: 1px solid #FCA5A5; font-weight: 400; }
.woocommerce table.cart td.product-remove a.remove:hover { background: #B91C1C !important; color: #fff !important; }

/* Migalhas na ficha de produto (por cima do nome) */
.mb-bc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px !important; padding: 0 !important; font-size: 13px; line-height: 1.4; color: var(--mb-muted); }
.mb-bc a { color: var(--mb-muted) !important; text-decoration: none; }
.mb-bc a:hover { color: var(--mb-primary) !important; text-decoration: underline; text-underline-offset: 3px; }
.mb-bc__sep { color: #9CA3AF; }

/* "REF: … Categoria: …" repetido: esconde também quando a ficha é um template do Elementor */
.summary:has(.mb-spec) .product_meta,
body.single-product:has(.mb-spec) .elementor-widget-woocommerce-product-meta { display: none !important; }

/* Atalhos de subcategorias na página de um grupo */
.mb-subcats { margin: 0 0 24px; }
.mb-subcats ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.mb-subcats a {
	display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px;
	border: 1px solid var(--mb-border); border-radius: 999px; background: #fff;
	color: var(--mb-ink) !important; font-size: 14px; font-weight: 600; text-decoration: none !important;
}
.mb-subcats a:hover { border-color: var(--mb-primary); color: var(--mb-primary) !important; }
.mb-subcats small { font-size: 12px; font-weight: 700; color: var(--mb-muted); background: var(--mb-surface); border-radius: 999px; padding: 1px 7px; }
