/* Blockim Mini Cart — icon trigger + slide-out cart drawer.
   All colours are tokens; override --bmc-accent-custom / --bmc-on-accent-custom
   (or use the settings screen) to match the site palette. */

:root {
	--bmc-bg: #ffffff;
	--bmc-ink: #1f2630;
	--bmc-muted: #687281;
	--bmc-line: #e4e7eb;
	--bmc-soft: #f3f5f6;
	--bmc-accent: var(--bmc-accent-custom, #E1F5F0);
	--bmc-on-accent: var(--bmc-on-accent-custom, #000);
	--bmc-progress: #eeb03a;
	--bmc-badge-bg: #fff200;
	--bmc-badge-ink: #1f2630;
	--bmc-icon-size: 26px;
	--bmc-font: "Varela Round", "Arial Hebrew", Arial, sans-serif;
	--bmc-good: #1c8457;
	--bmc-danger: #bf3a3a;
	--bmc-scrim: rgba(20, 26, 33, 0.48);
	--bmc-shadow: 0 0 40px rgba(20, 26, 33, 0.18);
	--bmc-radius: 12px;
	--bmc-width: 420px;
	--bmc-z: 100000;
}

html.bmc-lock,
html.bmc-lock body {
	overflow: hidden;
}

/* ---------- Trigger (cart icon) ---------- */

.bmc-trigger,
.bmc-trigger:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px;
	color: inherit;
	font: inherit;
	font-family: var(--bmc-font);
	line-height: 1;
	text-decoration: none;
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.bmc-trigger:hover,
.bmc-trigger:focus {
	color: inherit;
	text-decoration: none;
	opacity: 0.85;
}

.bmc-trigger:focus-visible,
#bmc-drawer a:focus-visible,
#bmc-drawer button:focus-visible,
#bmc-drawer input:focus-visible {
	outline: 2px solid var(--bmc-accent);
	outline-offset: 2px;
}

.bmc-trigger__icon {
	position: relative;
	display: inline-flex;
	flex: none;
	width: var(--bmc-icon-size);
	height: var(--bmc-icon-size);
}

.bmc-trigger__icon img.bmc-trigger__img {
	display: block;
	width: var(--bmc-icon-size);
	height: var(--bmc-icon-size);
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
}

/* Recolour the icon file without editing it */
.bmc-trigger--icon-white .bmc-trigger__img { filter: brightness(0) invert(1); }
.bmc-trigger--icon-black .bmc-trigger__img { filter: brightness(0); }

.bmc-trigger__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.bmc-badge {
	position: absolute;
	inset-block-start: -6px;
	inset-inline-start: -8px;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--bmc-badge-bg);
	color: var(--bmc-badge-ink);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.bmc-badge[data-count="0"] {
	display: none;
}

.bmc-badge.is-bump {
	animation: bmc-bump 0.45s ease;
}

.bmc-trigger__total {
	display: none;
	font-size: 14px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.bmc-trigger--with-total .bmc-trigger__total {
	display: inline;
}

/* ---------- Overlay + drawer shell ---------- */

.bmc-overlay {
	position: fixed;
	inset: 0;
	z-index: calc(var(--bmc-z) - 1);
	background: var(--bmc-scrim);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.bmc-overlay.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease;
}

#bmc-drawer {
	position: fixed;
	inset-block: 0;
	inset-inline-end: 0;
	z-index: var(--bmc-z);
	width: min(var(--bmc-width), 100%);
	height: 100%;
	max-height: 100dvh;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	background: var(--bmc-bg);
	color: var(--bmc-ink);
	box-shadow: var(--bmc-shadow);
	font-family: var(--bmc-font);
	font-size: 15px;
	line-height: 1.45;
	text-align: start;
	visibility: hidden;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.22, 0.8, 0.3, 1), visibility 0s linear 0.3s;
}

#bmc-drawer[dir="rtl"] {
	transform: translateX(-100%);
}

#bmc-drawer.is-open {
	visibility: visible;
	transform: none;
	transition: transform 0.3s cubic-bezier(0.22, 0.8, 0.3, 1);
}

#bmc-drawer *,
#bmc-drawer *::before,
#bmc-drawer *::after {
	box-sizing: border-box;
}

/* Theme-proof resets (Hello Elementor and friends style bare buttons and links) */
#bmc-drawer button,
#bmc-drawer button:hover,
#bmc-drawer button:focus {
	margin: 0;
	padding: 0;
	min-height: 0;
	font: inherit;
	line-height: 1;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

#bmc-drawer a,
#bmc-drawer a:hover,
#bmc-drawer a:focus {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

#bmc-drawer ul,
#bmc-drawer li,
#bmc-drawer p,
#bmc-drawer h2,
#bmc-drawer dl,
#bmc-drawer dt,
#bmc-drawer dd {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bmc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Header ---------- */

.bmc-head {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-block-end: 1px solid var(--bmc-line);
}

#bmc-drawer .bmc-head__title {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--bmc-ink);
}

.bmc-head__count {
	font-size: 14px;
	font-weight: 500;
	color: var(--bmc-muted);
	font-variant-numeric: tabular-nums;
}

#bmc-drawer .bmc-close,
#bmc-drawer .bmc-close:focus {
	flex: none;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	color: var(--bmc-ink);
	background: var(--bmc-soft);
}

#bmc-drawer .bmc-close:hover {
	background: var(--bmc-line);
	color: var(--bmc-ink);
	border-radius: 999px;
}

.bmc-close svg {
	width: 16px;
	height: 16px;
}

/* ---------- Content (replaced by WooCommerce fragments) ---------- */

.bmc-content {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	transition: opacity 0.15s ease;
}

#bmc-drawer.is-busy .bmc-content {
	opacity: 0.55;
	pointer-events: none;
}

/* Shipping progress */
.bmc-ship {
	flex: none;
	display: grid;
	gap: 8px;
	padding: 14px 20px 16px;
	background: var(--bmc-soft);
}

.bmc-ship__msg {
	font-size: 14px;
	font-weight: 600;
	color: var(--bmc-ink);
}

.bmc-ship[data-state="free"] .bmc-ship__msg {
	color: var(--bmc-good);
}

.bmc-ship__track {
	position: relative;
	height: 8px;
	border-radius: 999px;
	background: var(--bmc-line);
}

.bmc-ship__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--bmc-progress);
	transition: width 0.4s ease;
}

.bmc-ship[data-state="free"] .bmc-ship__fill {
	background: var(--bmc-good);
}

.bmc-ship__mark {
	position: absolute;
	inset-block: -3px;
	width: 2px;
	border-radius: 2px;
	background: var(--bmc-bg);
	box-shadow: 0 0 0 1px var(--bmc-muted);
}

.bmc-ship__legend {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 12px;
	color: var(--bmc-muted);
	font-variant-numeric: tabular-nums;
}

/* Items */
#bmc-drawer .bmc-items {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 20px;
}

#bmc-drawer .bmc-item {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr) auto;
	gap: 14px;
	padding: 16px 0;
	border-block-end: 1px solid var(--bmc-line);
}

#bmc-drawer .bmc-item:last-child {
	border-block-end: 0;
}

.bmc-item__thumb {
	display: block;
	width: 76px;
	height: 76px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--bmc-soft);
}

#bmc-drawer .bmc-item__thumb img {
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	display: block;
	border-radius: 0;
}

.bmc-item__main {
	min-width: 0;
	display: grid;
	gap: 4px;
	align-content: start;
}

#bmc-drawer .bmc-item__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--bmc-ink);
	overflow-wrap: anywhere;
}

#bmc-drawer a.bmc-item__name:hover {
	color: var(--bmc-accent);
}

.bmc-item__unit,
.bmc-item__meta {
	font-size: 13px;
	color: var(--bmc-muted);
}

#bmc-drawer .bmc-item__meta dl {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 2px 6px;
}

#bmc-drawer .bmc-item__meta dt {
	font-weight: 500;
}

#bmc-drawer .bmc-item__meta dd,
#bmc-drawer .bmc-item__meta dd p {
	overflow-wrap: anywhere;
}

.bmc-item__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-block-start: 8px;
}

.bmc-item__price {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.bmc-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--bmc-line);
	border-radius: 999px;
	background: var(--bmc-bg);
}

#bmc-drawer .bmc-qty__btn,
#bmc-drawer .bmc-qty__btn:focus {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 500;
	color: var(--bmc-ink);
	border-radius: 999px;
}

#bmc-drawer .bmc-qty__btn:hover {
	background: var(--bmc-soft);
	color: var(--bmc-accent);
	border-radius: 999px;
}

#bmc-drawer .bmc-qty__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

#bmc-drawer .bmc-qty__input {
	width: 38px;
	height: 34px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--bmc-ink);
	font: inherit;
	font-weight: 600;
	text-align: center;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
	appearance: textfield;
}

.bmc-qty__input::-webkit-outer-spin-button,
.bmc-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.bmc-qty--single {
	padding: 0 12px;
	height: 34px;
	font-weight: 600;
	color: var(--bmc-muted);
}

#bmc-drawer .bmc-item__remove,
#bmc-drawer .bmc-item__remove:focus {
	align-self: start;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	color: var(--bmc-muted);
}

#bmc-drawer .bmc-item__remove:hover {
	background: var(--bmc-soft);
	color: var(--bmc-danger);
	border-radius: 999px;
}

.bmc-item__remove svg {
	width: 17px;
	height: 17px;
}

/* Footer */
.bmc-foot {
	flex: none;
	display: grid;
	gap: 10px;
	padding: 16px 20px calc(18px + env(safe-area-inset-bottom, 0px));
	border-block-start: 1px solid var(--bmc-line);
	background: var(--bmc-bg);
}

.bmc-foot__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 16px;
}

.bmc-foot__row strong {
	font-size: 20px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.bmc-foot__note {
	font-size: 13px;
	color: var(--bmc-muted);
}

#bmc-drawer .bmc-btn,
#bmc-drawer .bmc-btn:focus {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 12px 18px;
	border-radius: var(--bmc-radius);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	transition: filter 0.15s ease, background-color 0.15s ease;
}

#bmc-drawer .bmc-btn--primary,
#bmc-drawer .bmc-btn--primary:focus {
	background: var(--bmc-accent);
	color: var(--bmc-on-accent);
}

#bmc-drawer .bmc-btn--ghost,
#bmc-drawer .bmc-btn--ghost:focus {
	min-height: 44px;
	font-size: 15px;
	font-weight: 600;
	color: var(--bmc-ink);
	background: transparent;
	border: 1px solid var(--bmc-line);
}

#bmc-drawer .bmc-btn--ghost:hover {
	color: var(--bmc-ink);
	background: var(--bmc-soft);
}

/* Empty state */
.bmc-empty {
	flex: 1 1 auto;
	display: grid;
	justify-items: center;
	align-content: center;
	gap: 12px;
	padding: 32px 28px;
	text-align: center;
}

.bmc-empty svg,
#bmc-drawer .bmc-empty__icon {
	width: 56px;
	height: 56px;
	color: var(--bmc-muted);
}

#bmc-drawer .bmc-empty__icon {
	object-fit: contain;
	filter: brightness(0);
	opacity: 0.4;
}

#bmc-drawer .bmc-empty__title {
	font-size: 18px;
	font-weight: 700;
}

#bmc-drawer .bmc-empty__text {
	max-width: 30ch;
	color: var(--bmc-muted);
}

.bmc-empty .bmc-btn {
	margin-block-start: 8px;
	min-width: 200px;
}

/* Error line */
.bmc-error {
	flex: none;
	margin: 0;
	padding: 10px 20px;
	background: var(--bmc-soft);
	color: var(--bmc-danger);
	font-size: 13px;
	font-weight: 600;
}

.bmc-error:empty {
	display: none;
}

@keyframes bmc-bump {
	0% { transform: scale(1); }
	35% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

@media (max-width: 480px) {
	:root { --bmc-width: 100%; }
	.bmc-head { padding: 14px 16px; }
	.bmc-ship { padding-inline: 16px; }
	#bmc-drawer .bmc-items { padding-inline: 16px; }
	.bmc-foot { padding-inline: 16px; }
	#bmc-drawer .bmc-item { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; }
	.bmc-item__thumb { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
	#bmc-drawer,
	#bmc-drawer.is-open,
	.bmc-overlay,
	.bmc-overlay.is-open,
	.bmc-ship__fill {
		transition: none;
	}
	.bmc-badge.is-bump {
		animation: none;
	}
}
