/*
 * Product card — matches the live site (snippets 44, 45, 47, 81, 82, 83, 85, 90).
 * Replaces product-card.css.
 */

.bmc {
	--bmc-ink: #1F1530;
	--bmc-muted: #8A7F99;
	--bmc-pink: #EC4899;
	--bmc-violet: #6B21A8;
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	background: #fff;
	border-radius: 14px;
	padding: 0 0 10px;
	direction: rtl;
	text-align: right;
}
.bmc a { text-decoration: none; }
.bmc button { font-family: inherit; }

/* ---------- Image ---------- */
.bmc-img {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}
.bmc-img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
	object-position: center;
	background: #fff;
	transition: opacity .25s;
}
.bmc-img img.bmc-fill { object-fit: cover; transform: scale(1.04); }
.bmc-img .bmc-img-2 { opacity: 0; }
@media (hover: hover) {
	.bmc:hover .bmc-img .bmc-img-2 { opacity: 1; }
}
.bmc-img.bmc-vimg .bmc-img-2 { display: none; } /* a colour was picked: show only that photo */

/* Savings tag "חוסכים X ₪" */
.bmc-save {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--bmc-pink);
	color: #fff;
	border-radius: 12px;
	padding: 6px 12px 7px;
	line-height: 1.1;
	text-align: center;
	box-shadow: 0 3px 10px rgba(236, 72, 153, .35);
	direction: rtl;
	unicode-bidi: isolate;
}
.bmc-save-l { display: block; font-size: 12px; font-weight: 700; opacity: .95; }
.bmc-save-a { display: block; font-size: 19px; font-weight: 900; white-space: nowrap; direction: rtl; unicode-bidi: isolate; }

/* ---------- Text ---------- */
.bmc-lab {
	display: block;
	margin: 10px 4px 2px;
	font-size: 12px;
	letter-spacing: .3px;
	color: var(--bmc-muted);
	font-weight: 600;
}
.bmc-title {
	margin: 0 4px 6px;
	padding: 0;
	min-height: 2.7em;
	font-size: 15.5px;
	font-weight: 800;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.bmc-title a { color: var(--bmc-ink); }
.bmc-price {
	margin: 0 4px 8px;
	min-height: 26px;
	display: flex;
	gap: 8px;
	align-items: baseline;
	justify-content: flex-start;
	flex-wrap: wrap;
	font-size: 18px;
	font-weight: 800;
	color: var(--bmc-ink);
}
.bmc-price ins, .bmc-price ins * { color: var(--bmc-pink); text-decoration: none; order: 1; }
.bmc-price del, .bmc-price del * { color: #9A93A6; font-size: 14px; font-weight: 500; order: 2; opacity: 1; }
.bmc-price .woocommerce-Price-amount { white-space: nowrap; }

/* ---------- One attribute: chips ---------- */
.bmc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-content: flex-start;
	margin: 0 4px 10px;
	min-height: 30px;
}
.bmc .bmc-chips button {
	min-width: 34px;
	height: 30px;
	padding: 0 8px;
	border: 1px solid #D6D6D6;
	border-radius: 4px;
	background: #fff;
	color: #111;
	font-weight: 600;
	font-size: 12.5px;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	min-height: 0;
}
.bmc .bmc-chips button.on { border-color: #111; background: #111; color: #fff; }
.bmc .bmc-chips button.bmc-sw {
	width: 26px;
	min-width: 26px;
	height: 26px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid #CFCFCF;
	box-shadow: inset 0 0 0 2px #fff;
}
.bmc .bmc-chips button.bmc-sw.on { outline: 2px solid #111; outline-offset: 2px; border-color: #CFCFCF; }
.bmc .bmc-chips.bmc-flash button { animation: bmcFlash .5s 2; }
@keyframes bmcFlash { 50% { border-color: var(--bmc-pink); box-shadow: 0 0 0 2px #FDECF4; } }

/* ---------- 2-3 attributes: one row each ---------- */
.bmc-mrow {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin: 6px 4px 0;
}
.bmc-mrow:last-of-type { margin-bottom: 10px; }
.bmc-mlab { font-size: 12px; color: var(--bmc-muted); font-weight: 600; margin-left: 2px; }
.bmc .bmc-mrow button {
	cursor: pointer;
	min-height: 0;
	box-shadow: none;
}
.bmc .bmc-mrow button.bmc-mo {
	min-width: 34px;
	height: 30px;
	padding: 0 9px;
	border: 1.5px solid #E5DFF0;
	background: #fff;
	color: var(--bmc-ink);
	border-radius: 8px;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1;
}
.bmc .bmc-mrow button.bmc-msw {
	width: 26px;
	height: 26px;
	padding: 0;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1.5px #D9D2E6;
}
.bmc .bmc-mrow button.on { box-shadow: 0 0 0 2px #7C3AED; border-color: #7C3AED; }
.bmc .bmc-mrow button.bmc-mo.on { background: #F5F0FF; }
.bmc .bmc-mrow button.off { opacity: .3; text-decoration: line-through; cursor: not-allowed; }
.bmc-mrow.bmc-flash { animation: bmcRow .6s; }
@keyframes bmcRow { 0%, 100% { background: transparent; } 50% { background: #FDE7F3; } }

/* Colour circles that are not a plain colour (live snippet 65) are painted by card.js */
.bmc button.bmc-txt { width: auto; min-width: 34px; border-radius: 4px; padding: 0 8px; }

/* ---------- Buttons row: ♡ [הוסיפו לסל] 👁 ---------- */
.bmc-act {
	display: flex;
	align-items: stretch;
	gap: 6px;
	margin: auto 4px 0;
	width: calc(100% - 8px);
	box-sizing: border-box;
}
.bmc .bmc-add {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	border: 0;
	border-radius: 8px;
	background: #111;
	color: #fff !important;
	font-weight: 700;
	font-size: 14.5px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 8px;
	box-shadow: none;
	min-height: 0;
}
.bmc .bmc-add:hover, .bmc .bmc-add:focus { background: #2B2B2B; color: #fff; }
.bmc .bmc-add[disabled] { opacity: .6; }
.bmc .bmc-fav, .bmc .bmc-qv {
	flex: 0 0 40px;
	width: 40px;
	min-width: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #D6D6D6;
	border-radius: 6px;
	background: #fff;
	box-shadow: none;
	cursor: pointer;
}
.bmc .bmc-fav:hover, .bmc .bmc-qv:hover, .bmc .bmc-fav:focus, .bmc .bmc-qv:focus { border-color: #111; background: #fff; }
.bmc .bmc-fav svg, .bmc .bmc-qv svg { width: 18px; height: 18px; fill: none; stroke: #111; stroke-width: 2; }
.bmc .bmc-fav.on svg { fill: var(--bmc-pink); stroke: var(--bmc-pink); }

/* ---------- Toast ---------- */
.bmc-toast {
	position: fixed;
	left: 50%;
	bottom: 90px;
	transform: translateX(-50%);
	background: #1F1530;
	color: #fff;
	padding: 12px 18px;
	border-radius: 12px;
	font-weight: 700;
	font-size: 15px;
	z-index: 2147483001;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	direction: rtl;
	pointer-events: none;
}

/* ---------- Quick view ---------- */
.bmc-qv-ov {
	position: fixed;
	inset: 0;
	background: rgba(20, 10, 35, .55);
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.bmc-qv-box {
	position: relative;
	background: #fff;
	border-radius: 16px;
	max-width: 820px;
	width: 100%;
	max-height: 90vh;
	overflow: auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 22px;
	padding: 22px;
	direction: rtl;
	text-align: right;
}
.bmc-qv-box .bmc-qv-x {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #F3EEF9;
	color: #1F1530;
	font-size: 20px;
	line-height: 36px;
	cursor: pointer;
	box-shadow: none;
	min-height: 0;
}
.bmc-qv-main { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; border-radius: 12px; background: #fff; display: block; }
.bmc-qv-th { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.bmc-qv-th img { width: 56px; height: 56px; object-fit: contain; border: 1.5px solid #EEE; border-radius: 8px; cursor: pointer; background: #fff; }
.bmc-qv-th img.on { border-color: #111; }
.bmc-qv-lab { font-size: 12px; color: #8A7F99; font-weight: 600; }
.bmc-qv-t { font-size: 20px; font-weight: 800; margin: 4px 0 8px; color: #1F1530; line-height: 1.35; }
.bmc-qv-p { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.bmc-qv-p ins { color: #EC4899; text-decoration: none; }
.bmc-qv-p del { color: #9A93A6; font-size: 15px; font-weight: 500; margin-inline-start: 10px; }
.bmc-qv-d { font-size: 14.5px; line-height: 1.6; color: #3B3347; margin-bottom: 12px; max-height: 120px; overflow: auto; }
.bmc-qv-box .bmc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.bmc-qv-box .bmc-chips button { min-width: 40px; height: 36px; padding: 0 10px; border: 1px solid #D6D6D6; border-radius: 4px; background: #fff; color: #111; font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: none; min-height: 0; }
.bmc-qv-box .bmc-chips button.on { background: #111; color: #fff; border-color: #111; }
.bmc-qv-box .bmc-chips.bmc-flash button { animation: bmcFlash .5s 2; }
.bmc-qv-box .bmc-qv-add {
	width: 100%;
	height: 48px;
	border: 0;
	border-radius: 8px;
	background: #111;
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
	padding: 0;
	box-shadow: none;
}
.bmc-qv-link { display: block; text-align: center; margin-top: 10px; color: #6B21A8; font-weight: 700; text-decoration: underline !important; }

/* ---------- Favourites page ([bm_favorites]) ---------- */
.bmc-fav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.bmc-fav-item { position: relative; }
.bmc-fav-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; border-radius: 12px; background: #fff; }
.bmc-fav-item a { color: #1F1530; text-decoration: none; font-weight: 800; display: block; margin: 8px 0 4px; line-height: 1.35; }
.bmc-fav-item .pr { font-weight: 800; color: #EC4899; }
.bmc-fav-item .bmc-fav-rm {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
	cursor: pointer;
	color: #EC4899;
	font-size: 18px;
	padding: 0;
}
.bmc-fav-empty { font-size: 17px; text-align: center; padding: 40px 0; }

/* ======================================================
   MOBILE
   ====================================================== */
@media (max-width: 767px) {
	.bmc-img img.bmc-fill { transform: none; }

	.bmc-save {
		flex-direction: row;
		gap: 3px;
		padding: 3px 7px;
		top: auto;
		bottom: 6px;
		right: 6px;
		border-radius: 8px;
		box-shadow: 0 2px 6px rgba(236, 72, 153, .3);
		transform: scale(.85);
		transform-origin: 100% 100%;
	}
	.bmc-save-l { font-size: 10.5px; }
	.bmc-save-a { font-size: 12px; }

	.bmc-lab { font-size: 11px; }
	.bmc-title { font-size: 14px; }
	.bmc-price { gap: 2px 6px; font-size: 15.5px; min-height: 0; }
	.bmc-price del, .bmc-price del * { font-size: 12px; }
	.bmc .bmc-chips button { min-width: 32px; height: 30px; font-size: 12px; }

	.bmc-act { gap: 4px; }
	.bmc .bmc-fav { flex-basis: 34px; width: 34px; min-width: 34px; min-height: 36px; }
	.bmc .bmc-qv { display: none; }
	.bmc .bmc-add { font-size: 12.5px; padding: 0 2px; white-space: nowrap; }

	.bmc-qv-ov { align-items: flex-end; padding: 0; }
	.bmc-qv-box { grid-template-columns: 1fr; border-radius: 18px 18px 0 0; max-height: 92vh; padding: 16px; gap: 12px; }
	.bmc-qv-main { aspect-ratio: 1 / 1; }

	.bmc-fav-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.bmc-img img, .bmc .bmc-chips.bmc-flash button, .bmc-mrow.bmc-flash { transition: none; animation: none; }
}

/* ---------- Product lists outside the category page ([products] shortcodes, related, upsells) ---------- */
ul.products:has(> li.bmc-li) {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 30px 16px;
	align-items: stretch;
}
ul.products.columns-2:has(> li.bmc-li) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
ul.products.columns-3:has(> li.bmc-li) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
ul.products.columns-5:has(> li.bmc-li) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
ul.products:has(> li.bmc-li)::before,
ul.products:has(> li.bmc-li)::after { display: none; }
ul.products li.bmc-li { display: flex; width: auto; float: none; margin: 0; padding: 0; list-style: none; }
@media (max-width: 767px) {
	ul.products:has(> li.bmc-li),
	ul.products[class*="columns-"]:has(> li.bmc-li) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
}
