/**
 * מכון נדב — העגלה בהדר: החלונית (inc/mn-mini-cart.php, assets/mn-mini-cart.js).
 *
 * Desktop: a card hanging under the cart button, with a small arrow pointing
 * at it (the script sets its top/left). Phone: a sheet from the bottom over a
 * dimmed page. Colours are the header's (--mnh-*, on :root in mn-header.css),
 * with fallbacks so the panel stands on its own.
 */

.mn-minicart {
	--mnc-orange: var( --mnh-orange, #ef9439 );
	--mnc-orange-hi: var( --mnh-orange-hi, #f7a95c );
	--mnc-ink: var( --mnh-ink, #1b1510 );
	--mnc-ink-2: var( --mnh-ink-2, #4a2c0f );
	--mnc-paper: var( --mnh-paper, #fffaf3 );
	--mnc-tint: var( --mnh-tint, rgba( 239, 148, 57, 0.16 ) );
	--mnc-rule: rgba( 27, 21, 16, 0.1 );
	--mnc-r: var( --mnh-r, 10px );
	--mnc-ease: var( --mnh-ease, cubic-bezier( 0.22, 1, 0.36, 1 ) );
	position: fixed;
	inset: 0;
	z-index: 2147482000; /* over the header menus and the chat bubbles */
	pointer-events: none;
	direction: rtl;
	font-family: "Heebo", sans-serif;
}

.mn-minicart[hidden] {
	display: none;
}

/* The WhatsApp and Crisp bubbles would sit on the phone sheet. */
html.mn-minicart-open .ccw_plugin,
html.mn-minicart-open .crisp-client,
html.mn-minicart-open #crisp-chatbox {
	display: none !important;
}

.mn-minicart__backdrop {
	display: none;
}

/* ------------------------------------------------------------------ panel */

.mn-minicart__panel {
	position: fixed;
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc( 100vw / var( --mn-z, 1 ) - 24px );
	max-height: min( 560px, calc( 100vh / var( --mn-z, 1 ) - 140px ) );
	border-radius: 14px;
	background: var( --mnc-paper );
	color: var( --mnc-ink );
	box-shadow: 0 0 0 1px rgba( 27, 21, 16, 0.08 ), 0 26px 60px -22px rgba( 27, 21, 16, 0.55 );
	pointer-events: auto;
	outline: none;
	opacity: 0;
	transform: translateY( -6px ) scale( 0.985 );
	transform-origin: var( --mn-arrow-x, 30px ) 0;
	transition: opacity 0.16s ease, transform 0.24s var( --mnc-ease );
}

.mn-minicart.is-open .mn-minicart__panel {
	opacity: 1;
	transform: none;
}

/* The arrow up to the button. */
.mn-minicart__panel::before {
	content: "";
	position: absolute;
	top: -6px;
	left: calc( var( --mn-arrow-x, 30px ) - 6px );
	width: 12px;
	height: 12px;
	border-radius: 2px 0 0;
	background: var( --mnc-paper );
	box-shadow: -1px -1px 0 rgba( 27, 21, 16, 0.08 );
	transform: rotate( 45deg );
}

.mn-minicart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px 10px;
	border-bottom: 1px solid var( --mnc-rule );
}

.mn-minicart__title {
	margin: 0;
	padding: 0;
	color: var( --mnc-ink );
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

.mn-minicart__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0 0 0 -6px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var( --mnc-ink-2 );
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.mn-minicart__close:hover {
	background: var( --mnc-tint );
}

.mn-minicart__close svg,
.mn-minicart__remove svg {
	width: 18px;
	height: 18px;
}

.mn-minicart__panel :focus-visible {
	outline: 2px solid var( --mnc-ink );
	outline-offset: 2px;
}

/* ------------------------------------------------------------------- body */

.mn-minicart__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	transition: opacity 0.15s ease;
}

.mn-minicart.is-loading .mn-minicart__body:not( .mn-minicart__body--loading ) {
	opacity: 0.55;
}

/* Until the cart arrives: three soft bars. */
.mn-minicart__body--loading {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 22px 18px 26px;
}

.mn-minicart__skeleton {
	display: block;
	height: 14px;
	border-radius: 7px;
	background: linear-gradient( 90deg, rgba( 27, 21, 16, 0.06 ), rgba( 27, 21, 16, 0.12 ), rgba( 27, 21, 16, 0.06 ) );
	background-size: 200% 100%;
	animation: mn-minicart-shimmer 1.1s linear infinite;
}

.mn-minicart__skeleton--short {
	width: 55%;
}

@keyframes mn-minicart-shimmer {
	to {
		background-position: -200% 0;
	}
}

.mn-minicart__error {
	margin: 0;
	padding: 0 18px 16px;
	color: #a1360b;
	font-size: 14px;
}

#mn-minicart .mn-minicart__error a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
}

/* --- empty --------------------------------------------------------------- */

.mn-minicart__empty {
	padding: 22px 22px 24px;
	text-align: center;
}

.mn-minicart__emptyicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	margin-bottom: 12px;
	border-radius: 50%;
	background: var( --mnc-tint );
	color: var( --mnc-ink );
}

.mn-minicart__emptyicon svg {
	width: 28px;
	height: 28px;
}

#mn-minicart .mn-minicart__emptytitle,
#mn-minicart .mn-minicart__emptytext {
	text-align: center; /* the theme sets paragraphs to the start edge */
}

.mn-minicart__emptytitle {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}

.mn-minicart__emptytext {
	margin: 0 0 18px;
	color: var( --mnc-ink-2 );
	font-size: 14.5px;
	line-height: 1.5;
}

.mn-minicart__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* --- buttons -------------------------------------------------------------

   Links here are prefixed with #mn-minicart: the child theme's style.css
   colours and sizes every link (`body.site_layout_16 a`). */

#mn-minicart .mn-minicart__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 0 18px;
	border: 1.5px solid transparent;
	border-radius: var( --mnc-r );
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#mn-minicart .mn-minicart__btn svg {
	width: 18px;
	height: 18px;
}

#mn-minicart .mn-minicart__btn--primary,
#mn-minicart .mn-minicart__btn--primary:visited {
	background: var( --mnc-orange );
	color: var( --mnc-ink );
}

#mn-minicart .mn-minicart__btn--primary:hover,
#mn-minicart .mn-minicart__btn--primary:focus-visible {
	background: var( --mnc-orange-hi );
	color: var( --mnc-ink );
}

#mn-minicart .mn-minicart__btn--ghost {
	border-color: rgba( 27, 21, 16, 0.22 );
	background: transparent;
	color: var( --mnc-ink );
	font-weight: 600;
}

#mn-minicart .mn-minicart__btn--ghost:hover,
#mn-minicart .mn-minicart__btn--ghost:focus-visible {
	border-color: var( --mnc-ink );
	background: rgba( 27, 21, 16, 0.04 );
}

#mn-minicart .mn-minicart__btn--ghost svg {
	color: var( --mnc-orange );
}

/* --- kits in the cart ---------------------------------------------------- */

.mn-minicart__items {
	margin: 0;
	padding: 4px 18px;
	list-style: none;
}

.mn-minicart__item {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 0;
	border-bottom: 1px solid var( --mnc-rule );
	transition: opacity 0.2s ease;
}

.mn-minicart__item:last-child {
	border-bottom: 0;
}

.mn-minicart__item.is-removing {
	opacity: 0.4;
}

.mn-minicart__itemtext {
	min-width: 0;
}

#mn-minicart .mn-minicart__name,
#mn-minicart .mn-minicart__name:visited {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	color: var( --mnc-ink );
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
}

#mn-minicart a.mn-minicart__name:hover {
	text-decoration: underline;
}

.mn-minicart__meta {
	display: block;
	margin-top: 2px;
	color: var( --mnc-ink-2 );
	font-size: 13px;
	line-height: 1.4;
}

.mn-minicart__qty {
	margin-inline-start: 6px;
	font-weight: 600;
}

.mn-minicart__price {
	color: var( --mnc-ink );
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.mn-minicart__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var( --mnc-ink-2 );
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mn-minicart__remove:hover {
	background: rgba( 161, 54, 11, 0.1 );
	color: #a1360b;
}

.mn-minicart__remove:disabled {
	cursor: default;
}

/* --- total and checkout -------------------------------------------------- */

.mn-minicart__foot {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 18px 16px;
	border-top: 1px solid var( --mnc-rule );
	background: rgba( 239, 148, 57, 0.06 );
	border-radius: 0 0 14px 14px;
}

.mn-minicart__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	font-size: 14.5px;
	color: var( --mnc-ink-2 );
}

.mn-minicart__total strong {
	color: var( --mnc-ink );
	font-size: 19px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

#mn-minicart .mn-minicart__link,
#mn-minicart .mn-minicart__link:visited {
	align-self: center;
	color: var( --mnc-ink );
	font-size: 14.5px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mn-minicart__trust {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	color: var( --mnc-ink-2 );
	font-size: 12.5px;
}

.mn-minicart__trust svg {
	width: 14px;
	height: 14px;
}

/* ------------------------------------------------------------------ phone */

@media ( max-width: 767px ) {
	.mn-minicart__backdrop {
		display: block;
		position: absolute;
		inset: 0;
		background: rgba( 21, 17, 13, 0.45 );
		opacity: 0;
		pointer-events: auto;
		transition: opacity 0.2s ease;
	}

	.mn-minicart.is-open .mn-minicart__backdrop {
		opacity: 1;
	}

	.mn-minicart__panel {
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-width: none;
		max-height: 82vh;
		padding-bottom: env( safe-area-inset-bottom );
		border-radius: 18px 18px 0 0;
		transform: translateY( 32px );
		transition: opacity 0.18s ease, transform 0.28s var( --mnc-ease );
	}

	/* A handle, so it reads as a sheet. */
	.mn-minicart__panel::before {
		top: 8px;
		left: 50%;
		width: 40px;
		height: 4px;
		border-radius: 2px;
		background: rgba( 27, 21, 16, 0.18 );
		box-shadow: none;
		transform: translateX( -50% );
	}

	.mn-minicart__head {
		padding-top: 22px;
	}

	.mn-minicart__foot {
		border-radius: 0;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.mn-minicart__panel,
	.mn-minicart__backdrop {
		transition: none;
	}

	.mn-minicart__skeleton {
		animation: none;
	}
}
