/* WooCommerce mini cart inside the header side panel */

.ahdb-sidecart {
	background: var(--color-page-bg);
	box-shadow: -6px 0 28px rgba(0, 0, 0, 0.1);
}

.ahdb-sidecart-head,
.ahdb-sidecart-footer {
	border-color: rgba(17, 17, 17, 0.1);
}

.ahdb-sidecart-body {
	padding: 0.25rem 1.125rem 1rem;
	-webkit-overflow-scrolling: touch;
}

/* Reset default widget / WC cart list chrome */
.ahdb-sidecart-body .woocommerce-mini-cart,
.ahdb-sidecart-body ul.woocommerce-mini-cart,
.ahdb-sidecart-body ul.cart_list,
.ahdb-sidecart-body ul.product_list_widget {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ahdb-sidecart-body .woocommerce-mini-cart-item {
	position: relative;
	padding: 1rem 1.75rem 1rem 0;
	border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.ahdb-sidecart-body .woocommerce-mini-cart-item::before,
.ahdb-sidecart-body .woocommerce-mini-cart-item::after {
	display: none;
	content: none;
}

.ahdb-sidecart-body .woocommerce-mini-cart-item .remove {
	position: absolute;
	top: 0.875rem;
	right: 0;
	left: auto;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-family: var(--font-primary);
	font-size: 1.375rem;
	font-weight: var(--font-weight-400);
	line-height: 1;
	color: rgba(17, 17, 17, 0.45);
	text-decoration: none;
	transition: color 0.15s ease;
}

.ahdb-sidecart-body .woocommerce-mini-cart-item .remove:hover,
.ahdb-sidecart-body .woocommerce-mini-cart-item .remove:focus-visible {
	color: var(--color-text);
}

/* Text left, thumbnail right */
.ahdb-sidecart-body .ahdb-sidecart-item__main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) min(var(--ahdb-cart-thumb), 28vw);
	align-items: start;
	column-gap: 0.875rem;
}

.ahdb-sidecart-body .ahdb-sidecart-item__details {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.375rem;
	min-width: 0;
}

.ahdb-sidecart-body .ahdb-sidecart-item__name-link {
	color: inherit;
	text-decoration: none;
}

.ahdb-sidecart-body .ahdb-sidecart-item__name-link:hover {
	opacity: 0.85;
}

.ahdb-sidecart-body .ahdb-sidecart-item__name {
	display: block;
	font-family: var(--font-primary);
	font-size: 1.0625rem;
	font-weight: var(--font-weight-500);
	line-height: 1.35;
	color: var(--color-text);
}

.ahdb-sidecart-body .ahdb-sidecart-item__line {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.125rem;
	margin: 0;
	padding: 0;
	font-family: var(--font-primary);
	line-height: 1.35;
}

.ahdb-sidecart-body .ahdb-sidecart-item__qty {
	font-size: 0.8125rem;
	font-weight: var(--font-weight-400);
	color: rgba(17, 17, 17, 0.55);
}

.ahdb-sidecart-body .ahdb-sidecart-item__price,
.ahdb-sidecart-body .ahdb-sidecart-item__price .amount {
	font-size: 1.0625rem;
	font-weight: var(--font-weight-500);
	color: var(--color-text);
}

.ahdb-sidecart-body .ahdb-sidecart-item__thumb {
	flex-shrink: 0;
	justify-self: end;
	line-height: 0;
}

.ahdb-sidecart-body .ahdb-sidecart-item__thumb-link {
	display: block;
	line-height: 0;
}

.ahdb-sidecart-body .ahdb-sidecart-item__thumb img,
.ahdb-sidecart-body .ahdb-sidecart-item__thumb-link img {
	float: none;
	width: var(--ahdb-cart-thumb) !important;
	height: var(--ahdb-cart-thumb) !important;
	max-width: none !important;
	margin: 0;
	padding: 0;
	object-fit: cover;
	background: rgba(17, 17, 17, 0.04);
}

.ahdb-sidecart-body .ahdb-sidecart-item__details dl.variation {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: rgba(17, 17, 17, 0.6);
}

.ahdb-sidecart-body .ahdb-sidecart-item__details dl.variation dt,
.ahdb-sidecart-body .ahdb-sidecart-item__details dl.variation dd {
	display: inline;
	margin: 0;
}

.ahdb-sidecart-body .ahdb-sidecart-item__details dl.variation dd p {
	margin: 0;
}

.ahdb-sidecart-body .woocommerce-mini-cart__total {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.375rem 0.75rem;
	margin: 0.75rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid rgba(17, 17, 17, 0.1);
	font-family: var(--font-primary);
	font-size: var(--font-size-body-l);
	font-weight: var(--font-weight-500);
	line-height: 1.4;
	color: var(--color-text);
}

.ahdb-sidecart-body .woocommerce-mini-cart__total strong {
	font-weight: var(--font-weight-500);
}

.ahdb-sidecart-body .woocommerce-mini-cart__total .amount {
	font-weight: var(--font-weight-500);
}

.ahdb-sidecart-body .woocommerce-mini-cart__empty-message {
	margin: 2.5rem 0 1.5rem;
	padding: 0 0.5rem;
	text-align: center;
	font-family: var(--font-primary);
	font-size: var(--font-size-body-m);
	line-height: 1.5;
	color: rgba(17, 17, 17, 0.55);
}

.ahdb-sidecart-footer {
	align-items: stretch;
}

.ahdb-sidecart-footer .button {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 2.875rem;
	margin: 0;
	padding: 0.75rem 0.5rem;
	border: 1px solid var(--color-text);
	border-radius: 0;
	background: transparent;
	font-family: var(--font-primary);
	font-size: var(--font-size-body-m);
	font-weight: var(--font-weight-500);
	letter-spacing: 0.06em;
	line-height: 1.25;
	color: var(--color-text);
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ahdb-sidecart-footer .button:hover,
.ahdb-sidecart-footer .button:focus-visible {
	background: var(--color-text);
	color: var(--color-page-bg);
}

.ahdb-sidecart-footer .button:last-child {
	background: var(--color-text);
	color: var(--color-page-bg);
}

.ahdb-sidecart-footer .button:last-child:hover,
.ahdb-sidecart-footer .button:last-child:focus-visible {
	background: transparent;
	color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
	.ahdb-sidecart-body .woocommerce-mini-cart-item .remove,
	.ahdb-sidecart-footer .button {
		transition: none;
	}
}
