/* Product cards. Two flavours share one look: .bl-card (archive loop, content-product.php) and .bl-pcard (home, related, mega).
   Photos sit on the page itself: no tile colour, white studio backgrounds multiply into the cream, and the image gets
   generous padding so the product never touches the edges. Editorial photos (look cards) are shown full-bleed. */

/* ---------------------------------------------------------------- archive grid items */
body .bl-grid ul.bl-products.products li.bl-card {
	position: relative;
	margin: 0;
	padding: 0;
	border-left: 1px solid var(--bl-line);
	border-top: 1px solid var(--bl-line);
	background: transparent;
	text-align: left;
	list-style: none;
	float: none;
	width: auto;
	min-width: 0;
}

body .bl-grid ul.bl-products.products {
	row-gap: 0;
	column-gap: 0;
}

body .bl-grid ul.bl-products.products li.bl-card:nth-child(-n + 2) {
	border-top: 0;
}

@media (min-width: 768px) {
	body .bl-grid ul.bl-products.products li.bl-card:nth-child(-n + 4) {
		border-top: 0;
	}
}

@media (min-width: 1600px) {
	body .bl-grid ul.bl-products.products li.bl-card:nth-child(-n + 5) {
		border-top: 0;
	}
}

.bl-card__media {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

.bl-card__imglink {
	position: absolute;
	inset: 0;
	display: block;
	padding: 11% 13% 9%;
}

.bl-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
	filter: brightness(1.04);
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.25s ease;
}

.bl-card:hover .bl-card__img {
	transform: scale(1.04);
}

.bl-card__img.is-swapping {
	opacity: 0;
}

.bl-card .bl-tag {
	top: 14px;
	left: 14px;
}

/* ---- text block */
.bl-card__body {
	padding: 6px 20px 24px;
}

.bl-card__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 12px;
}

.bl-card__main {
	min-width: 0;
}

.bl-card__title {
	margin: 0;
	color: var(--bl-brand);
	font: 400 19px/1.3 var(--bl-serif);
	letter-spacing: 0.005em;
}

.bl-card__title a {
	color: inherit;
	text-decoration: none;
}

.bl-card__title a:hover {
	color: var(--bl-brand-2);
}

.bl-card__price {
	display: block;
	margin-top: 4px;
	color: var(--bl-brand-2);
	font: 400 12.5px/1.4 var(--bl-sans);
	letter-spacing: 0.02em;
}

body .bl-grid ul.products li.bl-card .bl-card__price,
body .bl-grid ul.products li.bl-card .bl-card__price .amount,
body .bl-grid ul.products li.bl-card .bl-card__price bdi {
	color: var(--bl-brand-2);
	font-weight: 400;
}

.bl-card__price del {
	margin-right: 4px;
	opacity: 0.55;
}

.bl-card__price ins {
	text-decoration: none;
}

.bl-card__price br {
	display: none;
}

/* sizes: plain text, one quiet line */
.bl-card__sizes {
	margin: 10px 0 0;
	color: var(--bl-brand-2);
	font: 400 11px/1.4 var(--bl-sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.8;
}

/* ---- colour swatches: click or hover swaps the photo */
.bl-card__dots {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 3px;
	padding: 0;
	list-style: none;
}

.bl-card__dot {
	position: relative;
	display: block;
	width: 14px;
	height: 14px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--dot, var(--bl-brand-3));
	box-shadow: inset 0 0 0 1px rgba(79, 64, 34, 0.14);
	cursor: pointer;
	transition: transform 0.2s ease;
}

.bl-card__dot::after {
	content: '';
	position: absolute;
	inset: -4px;
	border: 1px solid transparent;
	border-radius: 50%;
	transition: border-color 0.2s ease;
}

.bl-card__dot:hover::after,
.bl-card__dot.is-on::after {
	border-color: var(--bl-brand-2);
}

.bl-card__dot:focus-visible {
	outline: 2px solid var(--bl-brand-2);
	outline-offset: 4px;
}

/* ---- bag button: a quiet round on the photo, shown on hover, never in place of the swatches */
.bl-card__bag {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--bl-line);
	border-radius: 50%;
	background: var(--bl-bg);
	color: var(--bl-brand);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.bl-card__bag:hover,
.bl-card__bag:focus-visible {
	border-color: var(--bl-btn-line);
	background: var(--bl-btn-bg);
	color: var(--bl-brand);
}

.bl-card__bag.loading {
	opacity: 1;
	animation: bl-card-pulse 1s ease-in-out infinite;
}

.bl-card__bag.added {
	opacity: 1;
	transform: none;
}

.bl-card .added_to_cart {
	display: none;
}

@keyframes bl-card-pulse {
	50% {
		opacity: 0.45;
	}
}

@media (hover: hover) {
	.bl-card:hover .bl-card__bag,
	.bl-card:focus-within .bl-card__bag {
		opacity: 1;
		transform: none;
	}
}

@media (hover: none) {
	.bl-card__bag {
		opacity: 1;
		transform: none;
		width: 34px;
		height: 34px;
	}
}

@media (max-width: 767px) {
	.bl-card__imglink {
		padding: 9% 10% 7%;
	}
	.bl-card__body {
		padding: 4px 12px 18px;
	}
	.bl-card__title {
		font-size: 16px;
	}
	.bl-card__bag {
		right: 8px;
		bottom: 8px;
	}
}

/* ---------------------------------------------------------------- home / related cards (.bl-pcard) */
body .bl-pcard {
	position: relative;
	background: transparent;
	box-shadow: none;
	text-align: left;
}

body .bl-pcard__media {
	background: transparent;
}

body .bl-pcard .bl-pcard__img {
	box-sizing: border-box;
	padding: 9% 11%;
	object-fit: contain;
	mix-blend-mode: multiply;
	background: transparent;
}

/* look cards show product photos, so they follow the same rule: no tile colour, a little air */
body .bl-pcard--look .bl-pcard__img {
	padding: 3%;
}

body .bl-pcard .bl-pcard__title {
	margin: 18px 0 0;
	color: var(--bl-brand);
	font: 400 19px/1.3 var(--bl-serif);
	text-align: left;
}

body .bl-pcard .bl-pcard__price {
	display: block;
	margin: 4px 0 0;
	color: var(--bl-brand-2);
	font: 400 12.5px/1.4 var(--bl-sans);
	letter-spacing: 0.02em;
	text-transform: none;
	text-align: left;
}

.bl-dots {
	position: absolute;
	right: 0;
	bottom: 4px;
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bl-dots__dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--dot, var(--bl-brand-3));
	box-shadow: inset 0 0 0 1px rgba(79, 64, 34, 0.14);
}

.bl-pcard__bag {
	display: none;
}

/* sale + sold-out tags */
.bl-tag {
	pointer-events: none;
}

/* related / home cards: the price never takes WooCommerce's green */
body.woocommerce div.product .bl-pcard .bl-pcard__price,
body.woocommerce div.product .bl-pcard .bl-pcard__price .amount,
body .bl-pcard .bl-pcard__price bdi {
	color: var(--bl-brand-2);
	font-weight: 400;
}


/* ---- home / related cards: title and price on the left, colour swatches on the same line at the right */
body .bl-pcard__row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin: 18px 0 0;
}

body .bl-pcard__main {
	display: block;
	min-width: 0;
}

body .bl-pcard__row .bl-pcard__title {
	margin: 0;
}

body .bl-pcard__dots {
	display: flex;
	flex: none;
	align-items: center;
	gap: 9px;
	padding: 0 4px 2px 0;
}

body .bl-pcard__dots .bl-card__dot {
	cursor: pointer;
}
.bl-card__bag { display: none !important; }

/* the whole card opens the product; the colour dots stay on top and keep their own click */
li.bl-card { position: relative; cursor: pointer; }
li.bl-card .bl-card__title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
li.bl-card .bl-card__dots { position: relative; z-index: 2; }
li.bl-card .bl-tag { pointer-events: none; }

/* phones and touch: swipe through the other colours / materials of a card */
.bl-card__rail, .bl-card__pips { display: none; }
@media (max-width: 767px) {
	.bl-card__rail {
		position: absolute;
		inset: 0;
		z-index: 1;
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-x pan-y;
		scrollbar-width: none;
		background: var(--bl-bg, #f7f4ee);
	}
	.bl-card__rail::-webkit-scrollbar { display: none; }
	.bl-card__slide { flex: 0 0 100%; display: block; scroll-snap-align: center; scroll-snap-stop: always; -webkit-user-drag: none; padding: 11% 13% 9%; }
	.bl-card__slide .bl-card__img { transition: none; }
	.bl-card .bl-tag, .bl-card .bl-card__bag { z-index: 3; }
	.bl-card__rail { z-index: 2; }
	@supports (-webkit-touch-callout: none) {
		/* only photos that already have a transparent version; the others still need the blend to hide their white backdrop */
		body li.bl-card .bl-card__rail .bl-card__slide .bl-card__img[src*="-bl.webp"] {
			mix-blend-mode: normal;
			filter: none;
			will-change: auto;
			backface-visibility: visible;
			-webkit-user-drag: none;
			-webkit-touch-callout: none;
		}
		.bl-card__rail { transform: translateZ(0); isolation: isolate; }
	}
	.bl-card__pips {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 10px;
		z-index: 2;
		display: flex;
		justify-content: center;
		gap: 5px;
		pointer-events: none;
	}
	.bl-card__pips i { width: 5px; height: 5px; border-radius: 50%; background: rgba(79, 64, 34, .25); transition: background .2s ease; }
	.bl-card__pips i.is-on { background: var(--bl-brand, #4f4022); }
}

/* ---------------------------------------------------------------- quick add: a small sand round next to the swatches */
body li.bl-card .bl-card__row { flex-wrap: nowrap; align-items: flex-end; }
.bl-card__end { position: relative; z-index: 2; display: flex; flex: none; align-items: center; gap: 12px; }
.bl-card__end .bl-card__dots { margin: 0; }
.bl-card__qa {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: var(--bl-btn-bg, #ebe3d4);
	color: var(--bl-brand);
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.bl-card__qa:hover, .bl-card__qa:focus-visible { background: var(--bl-brand); color: var(--bl-bg); }
.bl-card__qa.loading { animation: bl-card-pulse 1s ease-in-out infinite; pointer-events: none; }
.bl-card__qa.added { background: var(--bl-brand); color: var(--bl-bg); }
.bl-card__qa .bl-icon { width: 16px; height: 16px; }

/* phones: the title gets the whole first line (one line, never two), price on the left and swatches + quick add on the right */
@media (max-width: 767px) {
	body li.bl-card .bl-card__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: end; }
	body li.bl-card .bl-card__main { display: contents; }
	body li.bl-card .bl-card__title { grid-column: 1 / -1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
	body li.bl-card .bl-card__title a { white-space: nowrap; }
	body li.bl-card .bl-card__price { grid-column: 1; align-self: center; margin-top: 0; }
	body li.bl-card .bl-card__end { grid-column: 2; gap: 8px; }
	.bl-card__qa { width: 30px; height: 30px; }
}

/* 1+1 offer on earrings: a small label on the photo, and a line under the price on the product page */
.bl-card__media, .bl-pcard__media { position: relative; }
.bl-bogo {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 3;
	padding: 6px 12px;
	border-radius: 9999px;
	background: var(--bl-brand);
	color: var(--bl-bg);
	font: 400 11px/1 var(--bl-sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	pointer-events: none;
}
.bl-pdp__bogo { margin-top: 14px !important; }
.bl-bogo-note {
	display: inline-flex;
	align-items: center;
	padding: 9px 16px;
	border-radius: 9999px;
	background: var(--bl-btn-bg, #ebe3d4);
	color: var(--bl-brand);
	font: 400 12px/1 var(--bl-sans);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
@media (max-width: 767px) { .bl-bogo { left: 8px; bottom: 8px; padding: 5px 10px; font-size: 10px; } }
