/* Bundle Management - front end. Colours and widths come from the settings page (CSS variables). */

/* ---------- Product page button ---------- */
html body .bm-open-wrap {
	margin: 12px 0 14px;
	clear: both;
}
html body .bm-open {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 2px solid var(--bm-accent);
	border-radius: var(--bm-radius);
	background: transparent;
	color: var(--bm-accent);
	-webkit-text-fill-color: var(--bm-accent);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none;
	transition: background .2s ease, color .2s ease;
}
html body .bm-open:hover,
html body .bm-open:focus {
	background: var(--bm-accent);
	color: var(--bm-accent-text);
	-webkit-text-fill-color: var(--bm-accent-text);
}

/* ---------- Popup ---------- */
html body .bm-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
}
html body .bm-modal.is-open {
	display: flex;
}
html body.bm-lock {
	overflow: hidden;
}
html body .bm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .7);
}
html body .bm-modal__box {
	position: relative;
	width: min(560px, 92vw);
	max-height: 86vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	padding: 22px 20px 18px;
	border-radius: var(--bm-radius);
	background: var(--bm-popup-bg);
	color: var(--bm-popup-text);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
html body .bm-modal__box * {
	color: var(--bm-popup-text);
	-webkit-text-fill-color: var(--bm-popup-text);
}
html body .bm-modal__x {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
}
html body .bm-modal__title {
	margin: 0 30px 6px 0;
	font-size: 20px;
	font-weight: 700;
	text-transform: uppercase;
}
html body .bm-modal__note {
	margin: 0 0 12px;
	font-size: 14px;
	opacity: .85;
}
html body .bm-modal__scroll {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
html body .bm-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	background: transparent;
}
html body .bm-table th,
html body .bm-table td {
	padding: 10px 6px;
	border: 0;
	border-bottom: 1px solid rgba(128, 128, 128, .35);
	background: transparent;
	text-align: center;
	font-size: 14px;
	vertical-align: middle;
}
html body .bm-table th {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
}
html body .bm-table td.bm-c-pieces {
	font-weight: 700;
	text-align: left;
}
html body .bm-choose {
	margin: 0;
	padding: 8px 14px;
	border: 0;
	border-radius: var(--bm-radius);
	background: var(--bm-accent);
	cursor: pointer;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	box-shadow: none;
}
html body .bm-modal__box .bm-choose,
html body .bm-modal__box .bm-choose * {
	color: var(--bm-accent-text);
	-webkit-text-fill-color: var(--bm-accent-text);
}

/* Phones: the popup slides up from the bottom */
@media (max-width: 549px) {
	html body .bm-modal {
		align-items: flex-end;
	}
	html body .bm-modal__box {
		width: 100%;
		max-height: 82vh;
		border-radius: var(--bm-radius) var(--bm-radius) 0 0;
		padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
		animation: bm-up .22s ease-out;
	}
	html body .bm-table th,
	html body .bm-table td {
		padding: 9px 3px;
		font-size: 13px;
	}
	html body .bm-choose {
		padding: 7px 10px;
	}
}
@keyframes bm-up {
	from { transform: translateY(40px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}

/* ---------- Side cart: discount lines ---------- */
html body .bm-mini {
	margin: 4px 0 8px;
}
html body .bm-mini__row {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin: 0;
	padding: 5px 0;
	font-size: 13px;
	line-height: 1.3;
}
html body .bm-mini__row--total {
	border-top: 1px solid rgba(128, 128, 128, .4);
	font-weight: 700;
}

/* ---------- Side cart: bundle offers (compact) ---------- */
html body .bm-offers {
	margin: 10px 0 0;
	padding: 0;
	text-align: left;
}
html body .bm-offers__title {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
}
html body .bm-offers__done {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}
html body .bm-card {
	margin: 0 0 8px;
	padding: 8px 10px;
	border: 1px solid var(--bm-offer-border);
	border-radius: var(--bm-radius);
	background: var(--bm-offer-bg);
	color: var(--bm-offer-text);
}
html body .bm-card:last-child {
	margin-bottom: 0;
}
html body .bm-card__head {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0 0 2px;
	line-height: 1.25;
}
html body .bm-card__cat {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
}
html body .bm-card__prod {
	font-size: 11px;
	opacity: .75;
}
html body .bm-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0;
	padding: 5px 0;
	border-top: 1px dashed rgba(0, 0, 0, .2);
}
html body .bm-card__head + .bm-row {
	margin-top: 4px;
}
html body .bm-row__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	font-size: 12px;
	line-height: 1.3;
}
html body .bm-row__top {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
}
html body .bm-row__n {
	font-size: 13px;
}
html body .bm-row__save {
	font-weight: 700;
}
html body .bm-add {
	flex: 0 0 auto;
	margin: 0;
	padding: 7px 10px;
	border: 0;
	border-radius: var(--bm-radius);
	background: var(--bm-accent);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
}
html body .bm-add.is-loading {
	opacity: .55;
	pointer-events: none;
}
html body .bm-error {
	margin: 4px 0 0;
	font-size: 12px;
	color: #c0392b;
}

/* The side cart forces dark text on everything inside it - keep our colours */
html body .widget_shopping_cart .bm-card,
html body .widget_shopping_cart .bm-card * {
	color: var(--bm-offer-text) !important;
	-webkit-text-fill-color: var(--bm-offer-text) !important;
}
html body .widget_shopping_cart .bm-card {
	border-color: var(--bm-offer-border) !important;
	background: var(--bm-offer-bg) !important;
}
html body .widget_shopping_cart .bm-add,
html body .widget_shopping_cart .bm-add * {
	color: var(--bm-accent-text) !important;
	-webkit-text-fill-color: var(--bm-accent-text) !important;
	background-color: var(--bm-accent) !important;
}
html body .widget_shopping_cart .bm-error {
	color: #c0392b !important;
	-webkit-text-fill-color: #c0392b !important;
}
html body .widget_shopping_cart .bm-row {
	border-color: rgba(0, 0, 0, .2) !important;
	margin: 0 !important;
}
html body .widget_shopping_cart .bm-offers p,
html body .widget_shopping_cart .bm-card span,
html body .widget_shopping_cart .bm-card div {
	margin-top: 0;
	margin-bottom: 0;
}

/* ---------- Side cart width (set from the settings page) ---------- */
/* Panels open from the right, so a wider panel grows to the LEFT. */
@media (min-width: 850px) {
	html body.bm-has-offers .off-canvas-cart .mfp-content,
	html body.bm-has-offers .mfp-content.off-canvas-cart {
		width: var(--bm-normal-w) !important;
		max-width: 96vw !important;
	}
	html body.bm-wide-cart .off-canvas-cart .mfp-content,
	html body.bm-wide-cart .mfp-content.off-canvas-cart {
		width: var(--bm-wide-w) !important;
		max-width: 96vw !important;
	}
	html body.bm-wide-cart .bm-offers__list {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
	html body.bm-wide-cart .bm-offers__list .bm-card {
		margin: 0;
	}
}
@media (max-width: 849px) {
	html body.bm-has-offers .off-canvas-cart .mfp-content,
	html body.bm-has-offers .mfp-content.off-canvas-cart {
		width: var(--bm-m-w) !important;
		max-width: none !important;
		height: auto !important;
		max-height: 92vh !important;
		overflow-y: auto !important;
	}
	html body.bm-wide-cart .off-canvas-cart .mfp-content,
	html body.bm-wide-cart .mfp-content.off-canvas-cart {
		width: var(--bm-m-wide) !important;
	}
}

/* side cart: bundle discount + total after discount, directly under "Subtotal" */
.bm-tot { display: block; margin-top: 6px; }
.bm-tot .bm-tot__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; font-size: 14px; line-height: 1.4; text-align: left; }
.bm-tot .bm-tot__row--disc, .bm-tot .bm-tot__row--disc * { color: #0a7a3d !important; font-weight: 700; }
.bm-tot .bm-tot__row--pay { margin-top: 2px; padding-top: 6px; border-top: 1px solid rgba(0, 0, 0, .15); font-size: 16px; font-weight: 800; }
.bm-tot .bm-tot__row--pay strong, .bm-tot .bm-tot__row--pay strong * { font-weight: 800; }

/* Side cart bill (1.7.4): replaces the item list */
.widget_shopping_cart_content:has(.bm-tot--bill) ul.cart_list,
.widget_shopping_cart_content:has(.bm-tot--bill) ul.woocommerce-mini-cart,
.bm-hide-list { display: none !important; }
.bm-tot--bill { display: block; margin: 4px 0 10px; text-align: left; }
.bm-tot--bill .bm-tot__row--item { position: relative; padding: 8px 0 8px 24px; border-bottom: 1px solid rgba(0, 0, 0, .1); font-size: 14px; }
.bm-tot--bill .bm-tot__name { flex: 1 1 auto; min-width: 0; padding-right: 8px; font-weight: 600; }
.bm-tot--bill .bm-tot__price { flex: 0 0 auto; }
.bm-tot--bill .bm-tot__x { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; line-height: 16px; text-align: center; border: 1px solid currentColor; border-radius: 50%; font-size: 14px; opacity: .6; text-decoration: none; }
.bm-tot--bill .bm-tot__row--qty { margin-top: 6px; }
.bm-tot--bill .bm-tot__row--sub { font-weight: 600; }
.bm-tot--bill .bm-tot__row--pay { font-size: 17px; }
