/* ===== Marva Shop: sidebar kategori, tombol keranjang, bar keranjang, QRIS ===== */
:root {
	--mv-bg: #E3DBD8;
	--mv-surface: #F9F6F5;
	--mv-text: #6B4F44;
	--mv-dark: #3E2713;
	--mv-muted: #AA9489;
	--mv-line: #D3C3B6;
	--mv-soft: #BAAA9D;
	--mv-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Tata letak: sidebar + grid ---------- */
.mv-shop-layout {
	clear: both;
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
	margin-top: 1.5rem;
}
.mv-shop-content { min-width: 0; }
.mv-shop-content ul.products { clear: both; }

/* Grid produk 3 kolom di samping sidebar */
.woocommerce .mv-shop-content ul.products,
.woocommerce-page .mv-shop-content ul.products {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
}
.woocommerce .mv-shop-content ul.products::before,
.woocommerce .mv-shop-content ul.products::after { display: none; }
.woocommerce .mv-shop-content ul.products li.product,
.woocommerce-page .mv-shop-content ul.products li.product {
	width: auto;
	margin: 0;
	float: none;
}

.mv-cat-sidebar {
	position: sticky;
	top: 6.5rem;
	background: var(--mv-surface);
	border: 1px solid var(--mv-line);
	border-radius: 16px;
	padding: 1.25rem 1rem 1rem;
	color: var(--mv-text);
}
.mv-cat-sidebar__title {
	font-family: "Cormorant Garamond", serif;
	font-weight: 500;
	font-size: 1.5rem;
	line-height: 1.1;
	color: var(--mv-dark);
	margin: 0 .5rem .75rem;
}
.mv-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}
.mv-cat-list--child {
	margin: 2px 0 4px .75rem;
	padding-left: .5rem;
	border-left: 1px solid var(--mv-line);
}
.mv-cat-item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	padding: .55rem .6rem;
	border-radius: 10px;
	color: var(--mv-text);
	font-family: "DM Sans", sans-serif;
	font-size: .85rem;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.woocommerce-page .site-main .mv-cat-item a { color: var(--mv-text); }
.mv-cat-count {
	flex: none;
	min-width: 1.6rem;
	padding: .1rem .45rem;
	border-radius: 999px;
	background: var(--mv-bg);
	color: var(--mv-text);
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
	text-align: center;
}
@media (hover: hover) and (pointer: fine) {
	.mv-cat-item a:hover { background: var(--mv-bg); }
}
.mv-cat-item a:focus-visible {
	outline: 2px solid var(--mv-dark);
	outline-offset: 1px;
}
.woocommerce-page .site-main .mv-cat-item.is-current > a,
.mv-cat-item.is-current > a {
	background: var(--mv-dark);
	color: var(--mv-surface);
}
.mv-cat-item.is-current > a .mv-cat-count {
	background: rgba(249, 246, 245, .16);
	color: var(--mv-surface);
}

/* ---------- Tombol keranjang + penghitung ---------- */
.mv-atc {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	margin-top: auto;
	container-type: inline-size;
}
.mv-atc [hidden] { display: none !important; }

.woocommerce .mv-atc .mv-atc__add,
.mv-atc .mv-atc__add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	width: 100%;
	min-height: 44px;
	margin: 0;
	white-space: nowrap;
}
.woocommerce ul.products li.product .mv-atc a.button.mv-atc__add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	margin: 0;
	text-align: center;
	line-height: 1.2;
	font-size: .8rem;
	padding: 0 .75rem;
	overflow: hidden;
}
.mv-atc__add span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Kartu sempit: buang ikon agar label muat */
@container (max-width: 240px) {
	.mv-atc__icon { display: none; }
}
.mv-atc__icon { width: 1.15em; height: 1.15em; flex: none; }

.mv-atc__stepper {
	display: grid;
	grid-template-columns: 44px 1fr 44px;
	align-items: center;
	min-height: 44px;
	border: 1.5px solid var(--mv-dark);
	border-radius: 999px;
	background: var(--mv-surface);
	overflow: hidden;
	animation: mv-pop .22s var(--mv-ease);
}
/* Tema (Hello Elementor) mewarnai semua <button> saat hover/fokus — netralkan. */
.mv-atc .mv-atc__btn,
.mv-atc .mv-atc__btn:hover,
.mv-atc .mv-atc__btn:focus,
.mv-atc .mv-atc__btn:active {
	background-color: transparent;
	color: var(--mv-dark);
	border: 0;
	box-shadow: none;
}
.mv-atc__btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--mv-dark);
	cursor: pointer;
	transition: background-color .15s ease, transform .1s ease;
	-webkit-tap-highlight-color: transparent;
}
.mv-atc__btn svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
	.mv-atc .mv-atc__btn:hover:not(:disabled) { background-color: var(--mv-bg); }
}
.mv-atc__btn:active { transform: scale(.92); }
.mv-atc__btn:focus-visible {
	outline: 2px solid var(--mv-dark);
	outline-offset: -4px;
	border-radius: 999px;
}
.mv-atc__btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.mv-atc__qty {
	text-align: center;
	font-family: "DM Sans", sans-serif;
	font-weight: 600;
	font-size: 1.05rem;
	color: var(--mv-dark);
	font-variant-numeric: tabular-nums;
}
.mv-atc.is-busy .mv-atc__qty { opacity: .6; }
.mv-atc__msg {
	margin: .35rem 0 0;
	font-size: .8rem;
	line-height: 1.3;
	color: #9b3b2a;
	min-height: 0;
}
.mv-atc__msg:empty { display: none; }

@keyframes mv-pop {
	from { opacity: 0; transform: scale(.96); }
	to { opacity: 1; transform: scale(1); }
}

/* Kartu produk: tombol rata bawah */
.woocommerce ul.products li.product:has(.mv-atc) {
	display: flex;
	flex-direction: column;
}

/* Halaman produk tunggal */
.mv-atc--single {
	max-width: 340px;
	margin: 1.5rem 0 1.75rem;
}
.mv-atc--single .mv-atc__add,
.mv-atc--single .mv-atc__stepper { min-height: 52px; }
.mv-atc--single .mv-atc__stepper { grid-template-columns: 52px 1fr 52px; }
.mv-atc--single .mv-atc__btn { width: 52px; height: 52px; }
.mv-atc--single .mv-atc__qty { font-size: 1.2rem; }

/* ---------- Bar keranjang melayang ---------- */
.mv-cartbar {
	position: fixed;
	left: 50%;
	bottom: max(1rem, env(safe-area-inset-bottom));
	z-index: 50;
	display: flex;
	align-items: center;
	gap: .6rem;
	max-width: calc(100vw - 2rem);
	padding: .7rem .8rem .7rem 1.25rem;
	border-radius: 999px;
	background: var(--mv-dark);
	color: var(--mv-surface);
	box-shadow: 0 10px 30px rgba(62, 39, 19, .28);
	font-family: "DM Sans", sans-serif;
	font-size: .95rem;
	text-decoration: none;
	white-space: nowrap;
	transform: translateX(-50%);
	animation: mv-rise .3s var(--mv-ease);
}
.mv-cartbar[hidden] { display: none; }
.mv-cartbar,
.mv-cartbar:hover,
.mv-cartbar:focus,
.woocommerce-page .mv-cartbar { color: var(--mv-surface); text-decoration: none; }
.mv-cartbar__total { font-weight: 600; font-variant-numeric: tabular-nums; }
.mv-cartbar__sep { opacity: .5; }
.mv-cartbar__cta {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	margin-left: .4rem;
	padding: .45rem .6rem .45rem .9rem;
	border-radius: 999px;
	background: var(--mv-surface);
	color: var(--mv-dark);
	font-weight: 500;
}
.mv-cartbar__cta svg { width: 16px; height: 16px; }
.mv-cartbar:focus-visible { outline: 2px solid var(--mv-dark); outline-offset: 3px; }
body.mv-has-cartbar { padding-bottom: 5rem; }
@keyframes mv-rise {
	from { opacity: 0; transform: translate(-50%, 12px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- QRIS ---------- */
.mv-qris {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1.75rem;
	align-items: center;
	margin: 0 0 2rem;
	padding: 1.5rem;
	border: 1px solid var(--mv-line);
	border-radius: 16px;
	background: var(--mv-surface);
	color: var(--mv-text);
}
.mv-qris__code {
	display: block;
	width: 240px;
	max-width: 100%;
	height: auto;
	padding: .75rem;
	border-radius: 12px;
	background: #fff;
	border: 1px solid var(--mv-line);
}
.mv-qris__title {
	font-family: "Cormorant Garamond", serif;
	font-weight: 500;
	font-size: 1.8rem;
	line-height: 1.1;
	color: var(--mv-dark);
	margin: 0 0 .5rem;
}
.mv-qris__amount {
	font-size: 1.6rem;
	font-weight: 600;
	color: var(--mv-dark);
	font-variant-numeric: tabular-nums;
	margin: .25rem 0 .75rem;
}
.mv-qris__steps { margin: 0 0 .75rem 1.1rem; padding: 0; }
.mv-qris__steps li { margin: .2rem 0; }
.mv-qris__note { font-size: .9rem; color: var(--mv-muted); margin: 0; }
.mv-qris__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.mv-qris__actions .button { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Seluler ---------- */
@media (max-width: 1024px) {
	.woocommerce .mv-shop-content ul.products,
	.woocommerce-page .mv-shop-content ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.mv-shop-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.25rem;
		margin-top: 1rem;
	}
	/* Sidebar menjadi deretan chip yang bisa digeser */
	.mv-cat-sidebar {
		position: static;
		padding: 0;
		border: 0;
		background: none;
	}
	.mv-cat-sidebar__title {
		position: absolute;
		width: 1px; height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
	.mv-cat-nav {
		margin-inline: -1.5rem;
		padding-inline: 1.5rem;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.mv-cat-nav::-webkit-scrollbar { display: none; }
	.mv-cat-list,
	.mv-cat-list--child {
		display: flex;
		gap: .5rem;
		margin: 0;
		padding: 0;
		border: 0;
		width: max-content;
	}
	.mv-cat-item { display: contents; }
	.mv-cat-item a {
		white-space: nowrap;
		padding: .5rem .5rem .5rem .9rem;
		border: 1px solid var(--mv-line);
		border-radius: 999px;
		background: var(--mv-surface);
		min-height: 40px;
	}
	.woocommerce .mv-shop-content ul.products,
	.woocommerce-page .mv-shop-content ul.products { gap: .9rem; }
	.mv-atc__stepper { grid-template-columns: 40px 1fr 40px; }
	.mv-atc__btn { width: 40px; }
	.woocommerce ul.products li.product .mv-atc a.button.mv-atc__add { font-size: .85rem; padding: 0 .5rem; }
	.mv-atc__icon { display: none; }
	.mv-atc--single { max-width: none; }
	.mv-cartbar { width: calc(100vw - 2rem); justify-content: space-between; padding-left: 1rem; }
	.mv-cartbar__cta { margin-left: auto; }
	.mv-qris { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 1.25rem; }
	.mv-qris__steps { text-align: left; }
	.mv-qris__actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.mv-atc__stepper,
	.mv-cartbar { animation: none; }
	.mv-atc__btn:active { transform: none; }
}

/* ---------- Tombol Kembali ---------- */
.mv-back,
.woocommerce-page .site-main a.mv-back,
.woocommerce-page .mv-back {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	min-height: 40px;
	margin: 0 0 1rem;
	padding: .35rem .95rem .35rem .6rem;
	border: 1px solid var(--mv-line);
	border-radius: 999px;
	background: var(--mv-surface);
	color: var(--mv-dark);
	font-family: "DM Sans", sans-serif;
	font-size: .85rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
	-webkit-tap-highlight-color: transparent;
}
.mv-back svg { width: 18px; height: 18px; flex: none; }
@media (hover: hover) and (pointer: fine) {
	.mv-back:hover,
	.woocommerce-page .site-main a.mv-back:hover { background: var(--mv-bg); border-color: var(--mv-soft); color: var(--mv-dark); }
}
.mv-back:active { transform: scale(.97); }
.mv-back:focus-visible { outline: 2px solid var(--mv-dark); outline-offset: 2px; }
.mv-back + .woocommerce-breadcrumb { margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
	.mv-back:active { transform: none; }
}
