/* S-M Limited - продуктова карта (B3.4). Спецификация: makets/final/product-card.html, design/dc/SM Product Card.dc.html. */

/* Елементът на Woo цикъла (content-product.php); мрежата е на ul-а на викащия. */
.sm-grid__item {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.sm-card {
	position: relative;
	min-width: 0;
	width: 100%;
	font-family: var(--sm-font);
	color: var(--sm-ink);
}

.sm-card__link {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: var(--sm-ink);
	text-decoration: none;
}

.sm-card__link:hover,
.sm-card__link:focus {
	color: var(--sm-ink);
}

.sm-card__link:focus-visible {
	outline: 2px solid var(--sm-ink);
	outline-offset: 2px;
	border-radius: var(--sm-radius-s);
}

/* Снимка 3:4 на --sm-img. */
.sm-card__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	background: var(--sm-img);
	border-radius: var(--sm-radius-s);
	overflow: hidden;
}

.sm-card__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	mix-blend-mode: multiply;
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s;
}

.sm-card__img--hover {
	opacity: 0;
}

.sm-card.is-sold .sm-card__img {
	opacity: 0.45;
}

/* Бадж долу вляво: „-N %" (ink) / „Ново" (accent). */
.sm-card__badge {
	position: absolute;
	left: 8px;
	bottom: 8px;
	display: flex;
	align-items: center;
	height: 22px;
	padding: 0 7px;
	border-radius: var(--sm-radius-s);
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

.sm-card__badge--sale {
	background: var(--sm-ink);
	color: #FFFFFF;
}

.sm-card__badge--new {
	background: var(--sm-accent);
	color: var(--sm-ink);
}

/* „Изчерпано" в центъра на снимката. */
.sm-card__sold {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	width: fit-content;
	height: 30px;
	margin: auto;
	padding: 0 12px;
	border-radius: var(--sm-radius-s);
	background: #FFFFFF;
	color: var(--sm-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	pointer-events: none;
}

/* Текст под снимката. */
.sm-card__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 0 2px;
}

.sm-card__title {
	font-size: 14px;
	line-height: 1.35;
	text-wrap: pretty;
}

.sm-card__sastav {
	font-size: 12px;
	color: var(--sm-muted);
}

.sm-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	margin-top: 2px;
	font-size: 15px;
	font-weight: 600;
	color: var(--sm-ink);
}

/* Намаление: новата цена червена отпред, старата зачеркната след нея (като макета). */
.sm-card__price ins {
	order: 0;
	color: var(--sm-sale);
	text-decoration: none;
}

.sm-card__price del {
	order: 1;
	color: var(--sm-muted);
	font-size: 13px;
	font-weight: 400;
}

.sm-card__sizes {
	min-height: 15px;
	font-size: 11px;
	color: var(--sm-muted);
	opacity: 0;
	transition: opacity 0.2s;
}

/* Сърцето на YITH: бял кръг 36px горе вдясно, иконата от макета.
   Префиксът `.sm-card` бие `.yith-wcwl-add-to-wishlist-button:is(button):not(…)` на плъгина (без !important). */
.sm-card__wish {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 36px;
	height: 36px;
}

.sm-card .sm-card__wish .yith-add-to-wishlist-button-block,
.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist {
	margin: 0;
	width: 36px;
	height: 36px;
}

.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button-anchor-wrapper {
	display: block;
	width: 36px;
	height: 36px;
	text-decoration: none;
}

.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: none;
	color: var(--sm-ink);
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	text-decoration: none;
}

.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button:hover,
.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button:focus-visible {
	border: 0;
	background: rgba(255, 255, 255, 0.9);
	color: var(--sm-sale);
}

.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button:focus-visible {
	outline: 2px solid var(--sm-ink);
	outline-offset: 2px;
}

/* Иконата на плъгина се заменя със сърцето от макета (22-viewBox, stroke 1.5, 20px). */
.sm-card .sm-card__wish .yith-wcwl-icon-svg__wrapper,
.sm-card .sm-card__wish .yith-wcwl-icon,
.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button img {
	display: none;
}

.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button::before {
	content: "";
	display: block;
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M11 18.5s-7-4.3-7-9.2A3.8 3.8 0 0 1 11 7a3.8 3.8 0 0 1 7 2.3c0 4.9-7 9.2-7 9.2z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M11 18.5s-7-4.3-7-9.2A3.8 3.8 0 0 1 11 7a3.8 3.8 0 0 1 7 2.3c0 4.9-7 9.2-7 9.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* В любими: плътно червено сърце. */
.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button--added {
	color: var(--sm-sale);
}

.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button--added::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='%23000' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M11 18.5s-7-4.3-7-9.2A3.8 3.8 0 0 1 11 7a3.8 3.8 0 0 1 7 2.3c0 4.9-7 9.2-7 9.2z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='%23000' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M11 18.5s-7-4.3-7-9.2A3.8 3.8 0 0 1 11 7a3.8 3.8 0 0 1 7 2.3c0 4.9-7 9.2-7 9.2z'/%3E%3C/svg%3E");
}

.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button--loading {
	opacity: 0.6;
}

/* Текстът на бутона остава за екранните четци, визуално е скрит. */
.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button__label,
.sm-card .sm-card__wish .yith-wcwl-add-to-wishlist-button span {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Hover само на устройства с мишка (desktop): втора снимка, увеличение, размерите. */
@media (hover: hover) {
	.sm-card:not(.is-sold):hover .sm-card__img {
		transform: scale(1.04);
	}

	/* Първата снимка изчезва - иначе през multiply двете се виждат една през друга. */
	.sm-card.has-hover-img:hover .sm-card__img {
		opacity: 0;
	}

	.sm-card.has-hover-img:hover .sm-card__img--hover {
		opacity: 1;
	}

	.sm-card:hover .sm-card__sizes {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sm-card__img,
	.sm-card__sizes {
		transition: none;
	}
}
