/* Off-canvas mini cart drawer */

.kp-mini-cart {
	position: fixed;
	top: var(--kp-mini-cart-top, 0px);
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2500;
	display: block;
	pointer-events: none;
}

.kp-mini-cart[hidden] {
	display: none !important;
}

.kp-mini-cart-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: opacity 220ms ease;
	pointer-events: auto;
}

@media (max-width: 700px) {
	.kp-mini-cart {
		/* On mobile we want a true modal overlay, not below the header */
		top: 0;
	}

	.kp-mini-cart-overlay {
		background: rgba(46, 34, 31, 0.30);
		backdrop-filter: blur(6px);
	}
}

.kp-mini-cart-panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(420px, 92vw);
	background: #ffffff;
	box-shadow: -18px 0 45px rgba(46, 34, 31, 0.14);
	transform: translateX(100%);
	transition: transform 240ms ease, opacity 240ms ease;
	opacity: 1;
	display: flex;
	flex-direction: column;
	border-left: 1px solid rgba(46, 34, 31, 0.08);
	pointer-events: auto;
}

/* Mobile modal (centered popup) */
@media (max-width: 700px) {
	.kp-mini-cart-panel {
		top: 50%;
		left: 50%;
		right: auto;
		height: auto;
		width: min(420px, 94vw);
		max-height: 88vh;
		min-height: 0;
		border-left: 0;
		border: 1px solid rgba(46, 34, 31, 0.10);
		border-radius: 20px;
		box-shadow: 0 26px 70px rgba(46, 34, 31, 0.22);
		transform: translate(-50%, -46%) scale(0.98);
		opacity: 0;
		overflow-y: auto;
		overflow-x: hidden;
	}
}

@media (min-width: 1024px) {
	.kp-mini-cart-panel {
		width: min(520px, 92vw);
	}
}

.kp-mini-cart.is-open .kp-mini-cart-overlay {
	opacity: 1;
}

.kp-mini-cart.is-open .kp-mini-cart-panel {
	transform: translateX(0);
}

@media (max-width: 700px) {
	.kp-mini-cart.is-open .kp-mini-cart-panel {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
}

.kp-mini-cart.is-open {
	pointer-events: auto;
}

body.kp-mini-cart-open {
	overflow: hidden;
	touch-action: none;
}

.kp-mini-cart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 18px 14px;
	background: #ffffff;
	border-bottom: 1px solid rgba(46, 34, 31, 0.08);
}

.kp-mini-cart-title {
	margin: 0;
	font-family: 'Playfair Display', 'Times New Roman', serif;
	font-size: 22px;
	font-weight: 600;
	color: #2e221f;
}

.kp-mini-cart-close {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	border: 0;
	background: transparent;
	color: rgba(46, 34, 31, 0.6);
	font-size: 24px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.kp-mini-cart-close:hover {
	color: rgba(46, 34, 31, 0.85);
}

.kp-mini-cart-body {
	flex: 1 1 auto;
	padding: 0;
	overflow: hidden;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

@media (max-width: 700px) {
	.kp-mini-cart-body {
		/* Let panel height follow content */
		flex: 0 1 auto;
		max-height: none;
		overflow: visible;
	}
}

.kp-mini-cart-content {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: 10px 18px 18px;
}

/* Ensure the WooCommerce widget container is a flex column.

	In this theme, the same element often has both classes:
	.kp-mini-cart-content.widget_shopping_cart_content
*/
.kp-mini-cart .widget_shopping_cart_content {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: transparent;
	padding: 0;
}

.kp-mini-cart .woocommerce-mini-cart {
	margin: 0;
	padding: 0;
	list-style: none;
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding-right: 6px;
}

.kp-mini-cart .woocommerce-mini-cart::-webkit-scrollbar {
	width: 8px;
}

.kp-mini-cart .woocommerce-mini-cart::-webkit-scrollbar-thumb {
	background: rgba(46, 34, 31, 0.18);
	border-radius: 999px;
}

.kp-mini-cart .woocommerce-mini-cart::-webkit-scrollbar-track {
	background: transparent;
}

/* Free shipping row (DOM sits near buttons; order puts it above subtotal) */
.kp-mini-cart .kp-mini-cart-free-shipping {
	order: 10;
	margin-top: auto;

	padding: 12px 12px;
	border-radius: 14px;
	background: rgba(104, 187, 131, 0.10);
	border: 1px solid rgba(104, 187, 131, 0.22);
	color: rgba(46, 34, 31, 0.86);
	font-size: 13.5px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 10px;
}

.kp-mini-cart .kp-mini-cart-free-shipping-icon {
	width: 18px;
	height: 18px;
	color: rgba(46, 34, 31, 0.72);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 18px;
}

.kp-mini-cart .kp-mini-cart-free-shipping-icon svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	fill: none;
}

.kp-mini-cart .kp-mini-cart-savings {
	order: 11;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 2px solid rgba(46, 34, 31, 0.12);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	color: rgba(46, 34, 31, 0.72);
	font-size: 14px;
	font-weight: 600;
}

.kp-mini-cart .kp-mini-cart-savings-value {
	color: #DE737C;
	font-weight: 700;
}

.kp-mini-cart .woocommerce-mini-cart-item {
	display: grid;
	grid-template-columns: 64px 1fr;
	grid-template-rows: auto auto;
	column-gap: 14px;
	row-gap: 6px;
	align-items: start;
	padding: 16px 0;
	border-bottom: 1px solid rgba(46, 34, 31, 0.08);
	position: relative;
}

.kp-mini-cart .woocommerce-mini-cart-item.is-updating {
	opacity: 0.65;
	pointer-events: none;
}

.kp-mini-cart .woocommerce-mini-cart-item.is-updating::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0) 0%,
		rgba(46, 34, 31, 0.05) 50%,
		rgba(255, 255, 255, 0) 100%
	);
	transform: translateX(-60%);
	animation: kpMiniCartShimmer 900ms ease-in-out infinite;
}

@keyframes kpMiniCartShimmer {
	0% {
		transform: translateX(-60%);
	}
	100% {
		transform: translateX(60%);
	}
}

.kp-mini-cart .woocommerce-mini-cart-item:last-child {
	border-bottom: none;
}

.kp-mini-cart .woocommerce-mini-cart-item > a:not(.remove_from_cart_button) {
	grid-column: 1 / 3;
	grid-row: 1;
	display: grid;
	grid-template-columns: 64px 1fr;
	align-items: start;
	column-gap: 14px;
	width: 100%;
	text-decoration: none;
	color: #2e221f;
	font-weight: 600;
	line-height: 1.35;
}

.kp-mini-cart .woocommerce-mini-cart-item img {
	flex: 0 0 64px;
	width: 64px !important;
	height: 64px !important;
	max-width: 64px;
	max-height: 64px;
	aspect-ratio: 1 / 1;
	display: block;
	object-fit: cover;
	border-radius: 12px;
	background: #fff;
	border: 1px solid rgba(46, 34, 31, 0.08);
}

.kp-mini-cart .kp-mini-cart-meta {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-width: 0;
}

.kp-mini-cart .kp-mini-cart-qty-wrap {
	margin-top: 0;
}

.kp-mini-cart .kp-mini-cart-qty {
	display: inline-flex;
	align-items: center;
	height: 36px;
	border-radius: 12px;
	border: 1px solid rgba(46, 34, 31, 0.14);
	background: #ffffff;
	overflow: hidden;
	box-shadow: 0 1px 0 rgba(46, 34, 31, 0.04);
}

.kp-mini-cart .kp-mini-cart-qty.is-loading {
	opacity: 0.7;
}

.kp-mini-cart .kp-mini-cart-qty-btn {
	appearance: none;
	border: 0;
	background: transparent;
	width: 44px;
	height: 36px;
	font-size: 0;
	line-height: 1;
	font-weight: 800;
	font-family: inherit;
	color: rgba(46, 34, 31, 0.82);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kp-mini-cart .kp-mini-cart-qty-btn::before {
	font-size: 20px;
	line-height: 1;
	display: block;
	transform: translateY(-1px);
	color: currentColor;
}

.kp-mini-cart .kp-mini-cart-qty-btn.is-minus::before {
	content: '−';
}

.kp-mini-cart .kp-mini-cart-qty-btn.is-plus::before {
	content: '+';
}

.kp-mini-cart .kp-mini-cart-qty-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.kp-mini-cart .kp-mini-cart-qty-input {
	width: 44px;
	height: 36px;
	border: 0;
	border-left: 1px solid rgba(46, 34, 31, 0.12);
	border-right: 1px solid rgba(46, 34, 31, 0.12);
	text-align: center;
	font-size: 14px;
	font-weight: 800;
	font-family: inherit;
	color: rgba(46, 34, 31, 0.82);
	background: #ffffff;
	padding: 0;
	line-height: 36px;
	font-variant-numeric: tabular-nums;
}

.kp-mini-cart .kp-mini-cart-qty-btn:focus-visible,
.kp-mini-cart .kp-mini-cart-qty-input:focus-visible {
	outline: 2px solid rgba(104, 187, 131, 0.40);
	outline-offset: 2px;
}

.kp-mini-cart .kp-mini-cart-qty-input::-webkit-outer-spin-button,
.kp-mini-cart .kp-mini-cart-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.kp-mini-cart .kp-mini-cart-qty-input[type='number'] {
	appearance: textfield;
	-moz-appearance: textfield;
}

.kp-mini-cart .kp-mini-cart-item-price {
	font-size: 14px;
	font-weight: 700;
	color: #2e221f;
	white-space: nowrap;
	display: flex;
	align-items: baseline;
	gap: 5px;
}

.kp-mini-cart .kp-mini-cart-item-price del,
.kp-mini-cart .kp-mini-cart-regular-price {
	font-size: 12px;
	font-weight: 400;
	color: rgba(46, 34, 31, 0.45);
	text-decoration: line-through;
}

.kp-mini-cart .woocommerce-mini-cart-item a.remove_from_cart_button,
.kp-mini-cart .woocommerce-mini-cart-item a.remove {
	display: none;
}

/* Subtotal row */
.kp-mini-cart .woocommerce-mini-cart__total {
	order: 12;
	margin: 0;
	padding: 10px 0 0;
	border-top: 0;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-weight: 500;
	font-size: 15px;
	color: #2e221f;
}

.kp-mini-cart .woocommerce-mini-cart__total > strong {
	font-weight: 400;
	color: rgba(46, 34, 31, 0.7);
}

.kp-mini-cart .woocommerce-mini-cart__total > .woocommerce-Price-amount {
	font-weight: 600;
	color: #2e221f;
}

/* Make the actions feel like a fixed footer in the drawer */
.kp-mini-cart .woocommerce-mini-cart__buttons {
	order: 13;
	background: transparent;
	padding: 0;
	border-top: 0;
}

.kp-mini-cart .woocommerce-mini-cart__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 12px;
	margin-bottom: 0px;
	padding-bottom: 0;
}

.kp-mini-cart .woocommerce-mini-cart__buttons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	border-radius: 14px;
	font-weight: 800;
	text-decoration: none;
	box-shadow: none;
	border: 1px solid rgba(46, 34, 31, 0.14);
}

/* Prevent arrow icons/characters added via pseudo-elements on buttons */
.kp-mini-cart .woocommerce-mini-cart__buttons a::after,
.kp-mini-cart .woocommerce-mini-cart__buttons a::before {
	content: none !important;
	display: none !important;
}

/* Hide possible WooCommerce shipping/taxes notices in the mini cart footer */
.kp-mini-cart .woocommerce-shipping-taxes-notice,
.kp-mini-cart .woocommerce-mini-cart__tax-notice,
.kp-mini-cart .woocommerce-mini-cart__tax-note,
.kp-mini-cart .woocommerce-mini-cart__shipping-notice {
	display: none !important;
}

.kp-mini-cart .woocommerce-mini-cart__buttons a:first-child {
	background: #68bb83;
	color: #ffffff;
	border-color: rgba(104, 187, 131, 0.55);
	box-shadow: 0 8px 20px rgba(104, 187, 131, 0.28);
	font-weight: 700;
}

.kp-mini-cart .woocommerce-mini-cart__buttons a:first-child:hover {
	background: #5aa874;
	color: #ffffff;
}

.kp-mini-cart .woocommerce-mini-cart__buttons a.checkout {
	background: #ffffff;
	color: #68bb83;
	border-color: rgba(104, 187, 131, 0.55);
	box-shadow: none;
}

.kp-mini-cart .woocommerce-mini-cart__buttons a.checkout:hover {
	background: rgba(104, 187, 131, 0.08);
	color: #5aa874;
	border-color: rgba(104, 187, 131, 0.7);
}

@media (max-width: 700px) {
	.kp-mini-cart .woocommerce-mini-cart__buttons {
		grid-template-columns: 1fr;
	}

	.kp-mini-cart-panel {
		width: min(420px, 94vw);
	}

	.kp-mini-cart-title {
		font-size: 18px;
		font-weight: 500;
	}

	.kp-mini-cart-header {
		padding: 16px 16px 10px;
		border-bottom: none;
	}

	.kp-mini-cart-close {
		width: 28px;
		height: 28px;
		font-size: 34px;
		font-weight: 300;
		line-height: 0.75;
		padding: 0;
	}

	.kp-mini-cart-body {
		padding: 0;
	}

	.kp-mini-cart-content {
		padding: 0 16px 16px;
		flex: 0 1 auto;
	}

	.kp-mini-cart .widget_shopping_cart_content {
		flex: 0 1 auto;
	}

	.kp-mini-cart .woocommerce-mini-cart {
		overflow-y: auto;
		overflow-x: hidden;
		min-height: 0;
		max-height: 390px;
		padding-right: 2px;
	}

	/* Mobile item layout: row1 image/title/remove, row2 qty/price */
	.kp-mini-cart .woocommerce-mini-cart-item {
		display: grid;
		grid-template-columns: 72px 1fr 28px;
		grid-template-rows: auto auto;
		column-gap: 14px;
		row-gap: 10px;
		position: relative;
		padding: 14px 0 14px;
		min-height: 0;
		border-bottom: 1px solid rgba(222, 115, 124, 0.22);
	}

	/* Remove button: plain x on the right */
	.kp-mini-cart .woocommerce-mini-cart-item a.remove_from_cart_button,
	.kp-mini-cart .woocommerce-mini-cart-item a.remove {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		position: absolute !important;
		grid-column: auto;
		grid-row: auto;
		justify-self: auto;
		align-self: auto;
		width: 24px;
		height: 24px;
		border-radius: 0 !important;
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
		color: rgba(46, 34, 31, 0.6) !important;
		font-size: 0;
		font-weight: 300;
		line-height: 1;
		text-decoration: none;
		transition: color 0.15s ease;
		padding: 0;
		margin: 0;
		top: 40px !important;
		right: 0 !important;
		left: auto !important;
		bottom: auto !important;
		transform: translateY(-50%) !important;
		overflow: visible !important;
		-webkit-text-fill-color: transparent;
	}

	.kp-mini-cart .woocommerce-mini-cart-item a.remove_from_cart_button::before,
	.kp-mini-cart .woocommerce-mini-cart-item a.remove::before {
		content: '×';
		display: block;
		font-size: 24px;
		font-weight: 300;
		line-height: 1;
		color: currentColor;
		-webkit-text-fill-color: currentColor;
	}

	.kp-mini-cart .woocommerce-mini-cart-item a.remove_from_cart_button:hover,
	.kp-mini-cart .woocommerce-mini-cart-item a.remove:hover {
		color: rgba(46, 34, 31, 0.85) !important;
	}

	.kp-mini-cart .woocommerce-mini-cart-item a.remove_from_cart_button:hover::before,
	.kp-mini-cart .woocommerce-mini-cart-item a.remove:hover::before {
		color: rgba(46, 34, 31, 0.85);
	}

	/* Product row content */
	.kp-mini-cart .woocommerce-mini-cart-item > a:not(.remove_from_cart_button) {
		grid-column: 1 / 4;
		grid-row: 1;
		display: grid;
		grid-template-columns: 72px 1fr;
		column-gap: 14px;
		align-items: center;
		padding-right: 28px;
		font-size: 14px;
		font-weight: 600;
		line-height: 1.35;
		margin: 0;
	}

	.kp-mini-cart .woocommerce-mini-cart-item img {
		flex: 0 0 72px;
		width: 72px !important;
		height: 72px !important;
		max-width: 72px;
		max-height: 72px;
		border-radius: 8px;
		border: 1px solid rgba(46, 34, 31, 0.08);
		box-shadow: none;
		object-fit: contain;
		background: #fff;
	}

	.kp-mini-cart .kp-mini-cart-meta {
		grid-column: 1 / 4;
		grid-row: 2;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
	}

	.kp-mini-cart .kp-mini-cart-qty-wrap {
		flex-shrink: 0;
	}

	/* Minimal quantity selector */
	.kp-mini-cart .kp-mini-cart-qty {
		height: 28px;
		border-radius: 6px;
		border: 1px solid rgba(46, 34, 31, 0.10);
		background: rgba(46, 34, 31, 0.03);
		box-shadow: none;
	}

	.kp-mini-cart .kp-mini-cart-qty-btn {
		width: 28px;
		height: 28px;
		color: rgba(46, 34, 31, 0.5);
	}

	.kp-mini-cart .kp-mini-cart-qty-btn::before {
		font-size: 14px;
		font-weight: 400;
	}

	.kp-mini-cart .kp-mini-cart-qty-input {
		width: 28px;
		height: 28px;
		font-size: 13px;
		font-weight: 500;
		border-left: none;
		border-right: none;
		background: transparent;
		line-height: 28px;
		color: rgba(46, 34, 31, 0.7);
	}

	/* Subtler price */
	.kp-mini-cart .kp-mini-cart-item-price {
		font-size: 16px;
		font-weight: 600;
		color: #2e221f;
		line-height: 1;
		text-align: right;
	}

	.kp-mini-cart .kp-mini-cart-item-price del,
	.kp-mini-cart .kp-mini-cart-regular-price {
		font-size: 11px;
	}

	/* Subtler meta row */
	.kp-mini-cart .kp-mini-cart-meta {
		gap: 8px;
	}

	/* Free shipping bar */
	.kp-mini-cart .kp-mini-cart-free-shipping {
		padding: 12px 14px;
		border-radius: 10px;
		font-size: 13px;
		font-weight: 500;
		background: rgba(104, 187, 131, 0.08);
		border: none;
		margin-top: 16px;
	}

	.kp-mini-cart .kp-mini-cart-savings {
		margin-top: 12px;
		padding-top: 12px;
		border-top: 1px solid rgba(46, 34, 31, 0.08);
		font-size: 13.5px;
	}

	/* Subtotal */
	.kp-mini-cart .woocommerce-mini-cart__total {
		font-size: 14px;
		padding-top: 10px;
		margin-top: 8px;
		border-top: 0;
	}

	/* Buttons */
	.kp-mini-cart .woocommerce-mini-cart__buttons a {
		height: 48px;
		border-radius: 10px;
		font-size: 14px;
		font-weight: 500;
	}

	.kp-mini-cart .woocommerce-mini-cart__buttons a:first-child {
		border-color: rgba(46, 34, 31, 0.12);
	}

	.kp-mini-cart .woocommerce-mini-cart__buttons a.checkout {
		box-shadow: none;
	}
}
