/* =====================================================================
 * Artweb — Carrinho lateral (mini cart)
 * Todas as classes usam o prefixo "artweb-mc-" para não conflitar com o tema.
 * ================================================================== */

.artweb-mc {
	--mc-cor: #7a1f2b;
	--mc-texto: #1f1f1f;
	--mc-suave: #767676;
	--mc-borda: #ececec;
	--mc-fundo: #ffffff;
	--mc-verde: #2e7d32;
	--mc-ease: cubic-bezier(.22, .9, .28, 1);

	position: fixed;
	inset: 0;
	z-index: 999999;
	visibility: hidden;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--mc-texto);
	transition: visibility 0s linear .4s;
}
.artweb-mc *,
.artweb-mc *::before,
.artweb-mc *::after {
	box-sizing: border-box;
}
.artweb-mc.is-aberto {
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}

html.artweb-mc-travado,
html.artweb-mc-travado body {
	overflow: hidden !important;
}
html.artweb-mc-travado {
	padding-right: var(--mc-scrollbar, 0);
}

/* ---------- Fundo escuro ---------- */
.artweb-mc-overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 10, 12, .5);
	opacity: 0;
	transition: opacity .35s ease;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}
.artweb-mc.is-aberto .artweb-mc-overlay {
	opacity: 1;
}

/* ---------- Painel ---------- */
.artweb-mc-painel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 430px;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	background: var(--mc-fundo);
	box-shadow: -18px 0 50px rgba(0, 0, 0, .22);
	transform: translateX(104%);
	transition: transform .42s var(--mc-ease);
	outline: none;
}
.artweb-mc.is-aberto .artweb-mc-painel {
	transform: translateX(0);
}

/* ---------- Topo ---------- */
.artweb-mc-topo {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--mc-borda);
	flex: 0 0 auto;
}
.artweb-mc-titulo {
	margin: 0;
	font-size: 19px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--mc-cor);
	display: flex;
	align-items: center;
	gap: 8px;
}
.artweb-mc-topo-qtd {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 12px;
	background: #f4eeee;
	color: var(--mc-cor);
	font-size: 13px;
	font-weight: 700;
}
.artweb-mc-fechar {
	width: 38px;
	height: 38px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: #f3f3f3;
	color: #444;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, transform .25s var(--mc-ease);
}
.artweb-mc-fechar:hover {
	background: var(--mc-cor);
	color: #fff;
	transform: rotate(90deg);
}

/* Barra de progresso (aparece enquanto o carrinho sincroniza) */
.artweb-mc-progresso {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	overflow: hidden;
	opacity: 0;
	transition: opacity .2s ease;
}
.artweb-mc-progresso::before {
	content: "";
	position: absolute;
	inset: 0;
	width: 40%;
	background: var(--mc-cor);
	border-radius: 2px;
	animation: artwebMcProgresso 1s ease-in-out infinite;
}
.artweb-mc.is-carregando .artweb-mc-progresso {
	opacity: 1;
}
@keyframes artwebMcProgresso {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(260%); }
}

/* ---------- Corpo (lista) ---------- */
.artweb-mc-corpo {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 6px 20px;
}

.artweb-mc-lista {
	list-style: none;
	margin: 0;
	padding: 0;
}

.artweb-mc-item {
	position: relative;
	display: grid;
	grid-template-columns: 84px 1fr;
	gap: 14px;
	padding: 16px 30px 16px 0;
	margin: 0;
	border-bottom: 1px solid var(--mc-borda);
	overflow: hidden;
	list-style: none;
	transition: max-height .35s var(--mc-ease), opacity .3s ease, transform .35s var(--mc-ease),
		padding .35s var(--mc-ease), border-color .3s ease;
}
.artweb-mc-item:last-child {
	border-bottom-color: transparent;
}

.artweb-mc-item.is-removendo {
	opacity: 0;
	transform: translateX(36px);
	padding-top: 0;
	padding-bottom: 0;
	border-bottom-width: 0;
}

/* Entrada de um produto recém-adicionado */
.artweb-mc.is-aberto .artweb-mc-item.is-novo {
	animation: artwebMcItemEntra .55s var(--mc-ease) both, artwebMcDestaque 1.8s ease .3s both;
}
@keyframes artwebMcItemEntra {
	from { opacity: 0; transform: translateX(34px); }
	to   { opacity: 1; transform: none; }
}
@keyframes artwebMcDestaque {
	0%   { background-color: rgba(122, 31, 43, .10); }
	100% { background-color: transparent; }
}

.artweb-mc-thumb {
	width: 84px;
	height: 84px;
	border-radius: 10px;
	overflow: hidden;
	background: #f4f4f2;
}
.artweb-mc-thumb a {
	display: block;
	width: 100%;
	height: 100%;
}
.artweb-mc-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.artweb-mc-info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.artweb-mc-nome,
.artweb-mc-nome a {
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--mc-texto);
	text-decoration: none;
	overflow-wrap: anywhere;
}
.artweb-mc-nome a:hover {
	color: var(--mc-cor);
}
.artweb-mc-meta {
	font-size: 12.5px;
	color: var(--mc-suave);
}
.artweb-mc-preco-un {
	font-size: 13px;
	color: var(--mc-suave);
}
.artweb-mc-preco-un del {
	opacity: .7;
}
.artweb-mc-preco-un ins {
	text-decoration: none;
	font-weight: 600;
	color: var(--mc-texto);
}

.artweb-mc-linha {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
	margin-top: 8px;
}

/* Seletor de quantidade */
.artweb-mc-qtd {
	display: inline-flex;
	align-items: center;
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	background: #fff;
	overflow: hidden;
}
.artweb-mc-qtd-btn {
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .18s ease, color .18s ease, transform .12s ease;
}
.artweb-mc-qtd-btn:hover:not(:disabled) {
	background: var(--mc-cor);
	color: #fff;
}
.artweb-mc-qtd-btn:active:not(:disabled) {
	transform: scale(.88);
}
.artweb-mc-qtd-btn:disabled {
	opacity: .3;
	cursor: not-allowed;
}
.artweb-mc-qtd-valor {
	min-width: 28px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.artweb-mc-duplicar {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 32px;
	padding: 0 11px;
	margin: 0;
	border: 1px dashed #cfc3c5;
	border-radius: 999px;
	background: transparent;
	color: var(--mc-cor);
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.artweb-mc-duplicar:hover:not(:disabled) {
	background: #faf3f3;
	border-color: var(--mc-cor);
}
.artweb-mc-duplicar:active:not(:disabled) {
	transform: scale(.94);
}
.artweb-mc-duplicar:disabled {
	opacity: .35;
	cursor: not-allowed;
}

.artweb-mc-total-linha {
	margin-left: auto;
	font-size: 15px;
	font-weight: 800;
	color: var(--mc-texto);
	font-variant-numeric: tabular-nums;
}
.artweb-mc-total-linha.is-pulso,
.artweb-mc-total-linha-resumo strong.is-pulso {
	animation: artwebMcPulso .35s ease;
}
@keyframes artwebMcPulso {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.08); color: var(--mc-cor); }
	100% { transform: scale(1); }
}

.artweb-mc-remover {
	position: absolute;
	top: 12px;
	right: 0;
	width: 30px;
	height: 30px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #a5a5a5;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color .2s ease, background .2s ease;
}
.artweb-mc-remover:hover {
	color: #c62828;
	background: #fdeeee;
}

/* ---------- Aviso (toast) ---------- */
.artweb-mc-toast {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-height: 0;
	margin: 0 20px;
	padding: 0 14px;
	border-radius: 8px;
	background: #2b2b2b;
	color: #fff;
	font-size: 13.5px;
	line-height: 1.35;
	overflow: hidden;
	opacity: 0;
	transition: max-height .3s var(--mc-ease), opacity .25s ease, margin .3s var(--mc-ease), padding .3s var(--mc-ease);
}
.artweb-mc-toast.is-visivel {
	max-height: 90px;
	margin-top: 8px;
	margin-bottom: 8px;
	padding: 11px 14px;
	opacity: 1;
}
.artweb-mc-toast button {
	flex: 0 0 auto;
	padding: 4px 2px;
	margin: 0;
	border: none;
	background: transparent;
	color: #ffd9de;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Rodapé ---------- */
.artweb-mc-rodape {
	flex: 0 0 auto;
	padding: 0 20px;
	background: #fff;
	border-top: 1px solid var(--mc-borda);
	box-shadow: 0 -10px 24px rgba(0, 0, 0, .04);
}
.artweb-mc-rodape:empty,
.artweb-mc.is-vazio .artweb-mc-rodape {
	display: none;
}

.artweb-mc-totais {
	padding: 16px 0 6px;
}
.artweb-mc-total-linha-resumo {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 0 0 6px;
	font-size: 14px;
	color: var(--mc-suave);
}
.artweb-mc-total-linha-resumo strong {
	color: var(--mc-texto);
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	transition: opacity .2s ease;
}
.artweb-mc-total-linha-resumo strong.is-atualizando {
	opacity: .45;
}
.artweb-mc-desconto strong {
	color: var(--mc-verde);
}
.artweb-mc-total-final {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed #ddd;
	color: var(--mc-texto);
	font-size: 16px;
	font-weight: 700;
}
.artweb-mc-total-final strong {
	font-size: 22px;
	font-weight: 800;
	color: var(--mc-cor);
}
.artweb-mc-nota {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--mc-suave);
}

.artweb-mc-acoes {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px 0 calc(18px + env(safe-area-inset-bottom, 0px));
}

.artweb-mc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	padding: 0 18px;
	margin: 0;
	border-radius: 10px;
	border: 2px solid var(--mc-cor);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .2px;
	text-decoration: none;
	cursor: pointer;
	transition: filter .2s ease, background .2s ease, color .2s ease, transform .12s ease, box-shadow .2s ease;
}
.artweb-mc-btn-primario {
	background: var(--mc-cor);
	color: #fff;
	box-shadow: 0 8px 18px -8px var(--mc-cor);
}
.artweb-mc-btn-primario:hover {
	filter: brightness(.9);
	color: #fff;
}
.artweb-mc-btn-secundario {
	background: transparent;
	color: var(--mc-cor);
	min-height: 46px;
}
.artweb-mc-btn-secundario:hover {
	background: #faf3f3;
}
.artweb-mc-btn:active {
	transform: scale(.985);
}

/* ---------- Carrinho vazio ---------- */
.artweb-mc-vazio {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 6px;
	min-height: 60%;
	padding: 50px 10px;
	color: var(--mc-suave);
}
.artweb-mc-vazio svg {
	color: #cdb8bb;
	margin-bottom: 8px;
}
.artweb-mc-vazio-titulo {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	color: var(--mc-texto);
}
.artweb-mc-vazio-texto {
	margin: 0 0 14px;
	font-size: 14px;
}
.artweb-mc-vazio .artweb-mc-btn {
	width: auto;
	min-width: 180px;
}

/* =====================================================================
 * Ícone do carrinho + contador (badge)
 * ================================================================== */
.artweb-mc-gatilho {
	position: relative;
}

.artweb-cart-count {
	--mc-cor: #7a1f2b;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--mc-cor);
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	font-style: normal;
	font-variant-numeric: tabular-nums;
	box-sizing: border-box;
	transition: transform .2s ease;
}
.artweb-cart-count.is-zero {
	display: none;
}
.artweb-mc-gatilho > .artweb-cart-count {
	position: absolute;
	top: -6px;
	right: -9px;
	pointer-events: none;
}
.artweb-cart-count.is-bump {
	animation: artwebMcBump .5s var(--mc-ease, ease);
}
@keyframes artwebMcBump {
	0%   { transform: scale(1); }
	35%  { transform: scale(1.55); }
	65%  { transform: scale(.9); }
	100% { transform: scale(1); }
}

/* Ícone pronto (shortcode [artweb_carrinho_icone]) */
.artweb-mc-icone {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}
.artweb-mc-icone .artweb-cart-count {
	position: absolute;
	top: 2px;
	right: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	.artweb-mc-painel {
		width: 100%;
	}
	.artweb-mc-topo {
		padding: 14px 16px;
	}
	.artweb-mc-corpo {
		padding: 4px 16px;
	}
	.artweb-mc-rodape {
		padding: 0 16px;
	}
	.artweb-mc-toast {
		margin-left: 16px;
		margin-right: 16px;
	}
	.artweb-mc-item {
		grid-template-columns: 72px 1fr;
		gap: 12px;
	}
	.artweb-mc-thumb {
		width: 72px;
		height: 72px;
	}
}

/* ---------- Acessibilidade: respeita "reduzir movimento" ---------- */
@media (prefers-reduced-motion: reduce) {
	.artweb-mc,
	.artweb-mc *,
	.artweb-cart-count {
		animation: none !important;
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
	}
}
