/**
 * Cart sidebar — off-canvas WooCommerce side-cart.
 *
 * Desktop: fixed-width, full-height panel docked to the right.
 * Mobile (≤767px): full width and height.
 */

.acr-cart-sidebar__backdrop {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 320ms ease;
}

.acr-cart-sidebar__backdrop.is-open {
	opacity: 1;
	pointer-events: auto;
}

.acr-cart-sidebar {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	width: min(430px, 100vw);
	box-sizing: border-box;
	background: var(--color-cream);
	color: var(--color-black);
	transform: translateX(100%);
	visibility: hidden;
	transition:
		transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 380ms;
}

.acr-cart-sidebar.is-open {
	transform: translateX(0);
	visibility: visible;
	transition:
		transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 0s;
}

.acr-cart-sidebar:focus {
	outline: none;
}

/* ── Head ─────────────────────────────────────────────── */

.acr-cart-sidebar__head {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	gap: 12px;
	padding: 28px 28px 24px;
	border-bottom: 1.5px dashed var(--color-black);
}

.acr-cart-sidebar__back {
	position: absolute;
	left: 24px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: opacity 180ms ease;
}

.acr-cart-sidebar__back:hover,
.acr-cart-sidebar__back:focus-visible {
	opacity: 0.65;
}

.acr-cart-sidebar__back:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.acr-cart-sidebar__title {
	margin: 0;
	font-family: var(--font-primary);
	font-size: clamp(24px, 5vw, 30px);
	font-weight: 400;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.01em;
}

/* ── Body (fragment-refreshed) ────────────────────────── */

.acr-cart-sidebar__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.acr-cart-sidebar__items {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 24px 28px;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.acr-cart-sidebar__item {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	align-items: start;
	gap: 18px;
	padding-bottom: 26px;
	margin-bottom: 26px;
}

.acr-cart-sidebar__item + .acr-cart-sidebar__item {
	border-top: 1px solid rgba(48, 48, 48, 0.14);
	padding-top: 26px;
}

.acr-cart-sidebar__item:last-child {
	padding-bottom: 0;
	margin-bottom: 0;
}

.acr-cart-sidebar__item-media img {
	display: block;
	width: 88px;
	height: 88px;
	object-fit: contain;
}

.acr-cart-sidebar__item-body {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.acr-cart-sidebar__item-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.acr-cart-sidebar__item-name {
	font-family: var(--font-primary);
	font-size: 17px;
	line-height: 1.15;
	text-transform: uppercase;
}

.acr-cart-sidebar__item-name a {
	color: inherit;
	text-decoration: none;
}

.acr-cart-sidebar__remove {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: opacity 180ms ease;
}

.acr-cart-sidebar__remove:hover,
.acr-cart-sidebar__remove:focus-visible {
	opacity: 0.6;
}

.acr-cart-sidebar__item-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.acr-cart-sidebar__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--color-black);
}

.acr-cart-sidebar__qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: opacity 160ms ease;
}

.acr-cart-sidebar__qty-btn:hover {
	opacity: 0.6;
}

.acr-cart-sidebar__qty-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.acr-cart-sidebar__qty-input {
	width: 38px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-family: var(--font-primary);
	font-size: 16px;
	text-align: center;
	pointer-events: none;
}

.acr-cart-sidebar__item-price {
	font-family: var(--font-primary);
	font-size: 16px;
	white-space: nowrap;
}

.acr-cart-sidebar__item.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* ── Empty state ──────────────────────────────────────── */

.acr-cart-sidebar__empty {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 40px 28px;
	text-align: center;
}

.acr-cart-sidebar__empty-text {
	margin: 0;
	font-family: var(--font-primary);
	font-size: 18px;
	text-transform: uppercase;
}

.acr-cart-sidebar__empty-link {
	color: var(--color-black);
	font-family: var(--font-primary);
	text-transform: uppercase;
	text-underline-offset: 4px;
}

/* ── Footer (subtotal + checkout) ─────────────────────── */

.acr-cart-sidebar__footer {
	flex: 0 0 auto;
	margin-top: auto;
	background: var(--color-yellow);
}

.acr-cart-sidebar__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 28px;
	color: var(--color-black);
	font-family: var(--font-primary);
	font-size: 18px;
	text-transform: uppercase;
}

.acr-cart-sidebar__subtotal-value {
	white-space: nowrap;
}

.acr-cart-sidebar__subtotal-value .woocommerce-Price-amount {
	font-weight: inherit;
}

.acr-cart-sidebar__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	padding: 22px 24px;
	background: var(--color-black);
	color: var(--color-white);
	font-family: var(--font-primary);
	font-size: 15px;
	letter-spacing: 0.04em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: opacity 180ms ease;
}

.acr-cart-sidebar__checkout:hover,
.acr-cart-sidebar__checkout:focus-visible {
	opacity: 0.88;
	color: var(--color-white);
}

/* ── Mobile: full width + height ──────────────────────── */

@media (max-width: 767px) {
	.acr-cart-sidebar {
		inset: 0;
		width: 100%;
		height: 100vh;
		height: 100dvh;
	}

	.acr-cart-sidebar__head {
		padding: 22px 20px 20px;
	}

	.acr-cart-sidebar__back {
		left: 18px;
	}

	.acr-cart-sidebar__items {
		padding: 22px 20px;
	}

	.acr-cart-sidebar__subtotal {
		padding: 18px 20px;
	}
}

/* Lock the page behind an open sidebar. */
body.acr-cart-open {
	overflow: hidden;
}
