/**
 * Theme mini-cart — visual parity with former UpsellWP Side Cart overrides.
 * Tokens: Montserrat / --global-font-family-1, #1C1C1E, #737378, #F6F6F6, #DBDBDE, #EBEBED.
 */

body.shopito-mc-open {
	overflow: hidden;
}

body.shopito-mc-open .site-header,
body.shopito-mc-open .site-header__search-overlay,
body.shopito-mc-open .site-header__mobile {
	z-index: 1;
}

.shopito-mc {
	position: fixed;
	inset: 0;
	z-index: 200000;
	font-family: var(--global-font-family-1, "Montserrat", sans-serif);
}

.shopito-mc[hidden] {
	display: none !important;
}

.shopito-mc:not(.is-open) {
	pointer-events: none;
}

.shopito-mc__backdrop {
	position: absolute;
	inset: 0;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	background: rgba(28, 28, 30, 0.45);
	opacity: 0;
	transition: opacity 0.28s ease;
	pointer-events: none;
}

.shopito-mc.is-open .shopito-mc__backdrop {
	opacity: 1;
	pointer-events: auto;
}

.shopito-mc__panel {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	width: min(360px, 100vw);
	height: 100%;
	background: #ffffff;
	box-shadow: -8px 0 32px rgba(28, 28, 30, 0.12);
	transform: translateX(100%);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.shopito-mc.is-open .shopito-mc__panel {
	transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
	.shopito-mc__backdrop,
	.shopito-mc__panel {
		transition: none;
	}
}

.shopito-mc__header {
	padding: 20px 20px 12px;
	border-bottom: 1px solid #ebebed;
	flex: 0 0 auto;
}

.shopito-mc__header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

.shopito-mc__title {
	margin: 0;
	font-weight: 600;
	font-size: 18px;
	line-height: 22px;
	letter-spacing: -0.18px;
	color: #1c1c1e;
}

.shopito-mc__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #737378;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.shopito-mc__close:hover {
	background: #f6f6f6;
	color: #1c1c1e;
}

.shopito-mc__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
	background: #ffffff;
}

.shopito-mc__contents {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.shopito-mc__block--items {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 8px 16px 12px;
	-webkit-overflow-scrolling: touch;
}

.shopito-mc__block--totals {
	flex: 0 0 auto;
	padding: 0 16px 16px;
	border-top: 1px solid #ebebed;
	background: #ffffff;
}

.shopito-mc__empty {
	margin: 0;
	padding: 32px 20px;
	text-align: center;
	font-size: 14px;
	line-height: 20px;
	color: #737378;
}

.shopito-mc__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.shopito-mc__item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 0;
	border-top: 1px solid #ebebed;
	color: #1c1c1e;
}

.shopito-mc__item:first-child {
	border-top: 0;
}

.shopito-mc__item.is-removing {
	opacity: 0;
	transform: translateX(12px);
	pointer-events: none;
	transition: opacity 0.14s ease, transform 0.14s ease;
}

.shopito-mc__item-image {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border: 1px solid #ebebed;
	border-radius: 10px;
	background: #ffffff;
	box-sizing: border-box;
}

.shopito-mc__item-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.shopito-mc__item-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.shopito-mc__item-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.shopito-mc__item-title {
	font-weight: 600;
	font-size: 14px;
	line-height: 18px;
	color: #1c1c1e;
	text-decoration: none;
}

.shopito-mc__item-title:hover {
	text-decoration: underline;
}

.shopito-mc__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #99999e;
	cursor: pointer;
	flex: 0 0 auto;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.shopito-mc__remove:hover {
	background: #f6f6f6;
	color: #1c1c1e;
}

.shopito-mc__item .variation {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.shopito-mc__item .variation dt,
.shopito-mc__item .variation dd {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 3px 8px;
	border: 1px solid #dbdbde;
	border-radius: 6px;
	background: #ffffff;
	font-weight: 500;
	font-size: 11px;
	line-height: 15px;
	color: #3d3d42;
}

.shopito-mc__item-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.shopito-mc__qty {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 8px;
	border: 1px solid #dbdbde;
	border-radius: 10px;
	background: #ffffff;
	gap: 2px;
	box-sizing: border-box;
}

.shopito-mc__qty-btn {
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #737378;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.shopito-mc__qty-btn:hover {
	background: #f6f6f6;
	color: #1c1c1e;
}

.shopito-mc__qty-input {
	width: 32px;
	height: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: center;
	font-family: inherit;
	font-weight: 600;
	font-size: 13px;
	line-height: 18px;
	color: #1c1c1e;
	-moz-appearance: textfield;
}

.shopito-mc__qty-input::-webkit-outer-spin-button,
.shopito-mc__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.shopito-mc__item-price {
	font-weight: 600;
	font-size: 13px;
	line-height: 18px;
	color: #1c1c1e;
	white-space: nowrap;
}

.shopito-mc__totals {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 16px;
	font-weight: 500;
}

.shopito-mc__total-line--grand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 15px;
	line-height: 21px;
	color: #1c1c1e;
	font-weight: 600;
}

.shopito-mc__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding-top: 16px;
}

.shopito-mc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 12px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
	text-align: center;
	box-sizing: border-box;
	cursor: pointer;
}

.shopito-mc__btn--cart {
	background: #ffffff;
	color: #1c1c1e;
	border: 1.5px solid #1c1c1e;
}

.shopito-mc__btn--cart:hover {
	background: #f6f6f6;
}

.shopito-mc__btn--checkout {
	background: #1c1c1e;
	color: #ffffff;
	border: 1.5px solid #1c1c1e;
}

.shopito-mc__btn--checkout:hover {
	background: #000000;
	color: #ffffff;
}

/* Busy: block clicks + header spinner — no panel opacity (was bleaching content) */
.shopito-mc.is-busy .shopito-mc__panel {
	pointer-events: none;
	cursor: wait;
}

.shopito-mc.is-busy .shopito-mc__title::after {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-left: 10px;
	border: 2px solid #dbdbde;
	border-top-color: #1c1c1e;
	border-radius: 50%;
	vertical-align: -1px;
	animation: shopito-mc-spin 0.6s linear infinite;
}

@keyframes shopito-mc-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 480px) {
	.shopito-mc__panel {
		width: 100vw;
	}

	.shopito-mc__actions {
		grid-template-columns: 1fr;
	}
}
