/* Keep fallback slides aligned with product-carousel.js. */
.shop-product-carousel {
	position: relative;
	--carousel-slides: 2.2;
	--carousel-gap: 10px;
	--carousel-slide-width: calc((100% - (var(--carousel-slides) - 1) * var(--carousel-gap)) / var(--carousel-slides));
}

.shop-product-carousel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-5);
	margin-bottom: var(--gap-heading);
}

.shop-product-carousel__title {
	margin: 0;
}

.shop-product-carousel__navigation {
	display: flex;
	gap: var(--space-2);
}

.shop-product-carousel__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--action-size-primary);
	height: var(--action-size-primary);
	padding: 10px;
	border: 1px solid var(--theme-palette-color-6);
	border-radius: var(--radius-md);
	background: var(--theme-palette-color-8);
	color: var(--theme-palette-color-4);
	cursor: pointer;
	transition:
		border-color var(--transition-base),
		color var(--transition-base),
		background-color var(--transition-base);
}

.shop-product-carousel__button:hover:not(.swiper-button-disabled) {
	border-color: var(--theme-palette-color-1);
	color: var(--theme-palette-color-2);
	background: var(--theme-palette-color-8);
}

/* Explicit flex dimensions also give inline SVGs a stable size in Safari. */
.shop-product-carousel__button > svg {
	display: block;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
}

.shop-product-carousel__button.swiper-button-disabled {
	opacity: 0.4;
	cursor: default;
}

.shop-product-carousel__swiper {
	overflow-x: auto;
	scroll-snap-type: x proximity;
	/* Keep native scrolling without a scrollbar that disappears on init. */
	scrollbar-width: none;
}

.shop-product-carousel__swiper::-webkit-scrollbar {
	display: none;
}

.shop-product-carousel__swiper.swiper-initialized {
	overflow: hidden;
	scroll-snap-type: none;
}

.shop-product-carousel__navigation[hidden] {
	/* Reserve the same header space before Swiper enables the buttons. */
	display: flex;
	visibility: hidden;
}

.shop-recently-viewed[hidden] {
	display: none;
}

.single-product .shop-product-recommendations {
	margin-block: var(--space-8);
}

.single-product .shop-product-carousel[data-carousel-type="related"] .shop-product-carousel__title {
	font-size: clamp(1.125rem, 2.2vw, 1.375rem);
}

.shop-product-recommendations > * + * {
	margin-top: var(--space-8);
}

.shop-product-carousel .swiper-slide {
	display: flex;
	height: auto;
	flex-shrink: 0;
	width: var(--carousel-slide-width);
	margin-right: var(--carousel-gap);
}

/* Intermediate widths match the existing Swiper configuration. */
@media (min-width: 576px) {
	.shop-product-carousel {
		--carousel-slides: 3.2;
		--carousel-gap: 12px;
	}
}

@media (min-width: 768px) {
	.shop-product-carousel {
		--carousel-slides: 3.5;
		--carousel-gap: 14px;
	}
}

@media (min-width: 1000px) {
	.shop-product-carousel {
		--carousel-slides: 4.5;
	}
}

@media (min-width: 1200px) {
	.shop-product-carousel {
		--carousel-slides: 5;
		--carousel-gap: 16px;
	}
}

.shop-product-carousel__swiper:not(.swiper-initialized) .swiper-slide {
	scroll-snap-align: start;
}

.shop-product-carousel__swiper:not(.swiper-initialized) .swiper-slide:last-child {
	margin-right: 0;
}

.shop-recently-viewed__placeholder {
	display: flex;
	overflow: hidden;
}

.shop-recently-viewed__placeholder-card {
	overflow: hidden;
	border: 1px solid var(--theme-palette-color-6);
	border-radius: var(--radius-md);
}

.shop-recently-viewed__placeholder-media {
	aspect-ratio: 1;
	background: var(--theme-palette-color-6);
	opacity: 0.45;
}

.shop-recently-viewed__placeholder-body {
	height: 200px;
	padding: var(--space-4);
}

.shop-recently-viewed__placeholder-body > span {
	display: block;
	height: 13px;
	margin-bottom: var(--space-3);
	border-radius: var(--radius-sm);
	background: var(--theme-palette-color-6);
	opacity: 0.45;
}

.shop-recently-viewed__placeholder-body > span:nth-child(2) {
	width: 65%;
}

.shop-recently-viewed__placeholder-body > span:last-child {
	height: 40px;
	margin-top: 28px;
}

@media (min-width: 1000px) and (max-width: 1250px) {
	body.woocommerce.archive ul.products[data-products] {
		--shop-columns: repeat(3, minmax(0, 1fr));
	}
}

article.shop-product-card,
li.product-item {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	border: 1px solid var(--theme-palette-color-6);
	border-radius: var(--radius-md);
	background: var(--theme-palette-color-8);
	overflow: hidden;
	--space-1: 3px;
	--space-2: 6px;
	--space-3: 9px;
	--space-4: 12px;
	--space-5: 16px;
	--space-6: 18px;
	--fs-xs: 0.6875rem;
	--fs-sm: 0.75rem;
	--fs-md: 0.8125rem;
	--fs-2xl: 1.25rem;
	--radius-md: var(--radius-compact);
	--radius-sm: var(--radius-compact-sm);
}

.shop-product-card__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	padding: var(--space-6);
	background: var(--theme-palette-color-8);
}

.shop-product-card__media-discount {
	display: none;
}

.shop-product-card__image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: var(--theme-palette-color-8);
}

.shop-product-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform var(--transition-slow);
	color: var(--theme-palette-color-8);
}

.shop-product-card__badge {
	position: absolute;
	top: var(--space-3);
	left: var(--space-3);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 24px;
	padding: var(--space-1) 7px;
	border-radius: var(--radius-sm);
	background: var(--theme-palette-color-6);
	color: var(--theme-palette-color-4);
	font-size: var(--fs-xs);
	font-weight: var(--fw-semibold);
	line-height: 1;
}

.shop-product-card__content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--space-5);
}

.shop-product-card__brand {
	min-height: calc(1em * var(--lh-normal));
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	margin-bottom: 5px;
	color: var(--theme-palette-color-3);
	font-size: calc(var(--fs-xs) - 1px);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-normal);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Keep card spacing independent of Blocksy's content-heading margins. */
.shop-product-card__content > .shop-product-card__title {
	display: block;
	margin: 0 0 var(--space-3);
	font-size: 0.875rem;
	font-weight: var(--fw-medium);
	line-height: var(--lh-snug);
	min-height: calc(var(--lh-snug) * 3em);
	overflow-wrap: break-word;
	word-break: normal;
}

.shop-product-card__title a {
	display: -webkit-box;
	min-height: inherit;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	color: var(--theme-palette-color-4);
	text-decoration: none;
	transition: color var(--transition-base);
}

.shop-product-card__title a:hover {
	color: var(--theme-palette-color-5);
}

.shop-product-card__rating {
	display: flex;
	align-items: center;
	gap: 4px;
	min-height: 16px;
	margin-bottom: var(--space-3);
	font-size: var(--fs-xs);
	line-height: 1;
}

.shop-product-card__stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	color: var(--color-star);
	line-height: 1;
	flex-shrink: 0;
}

.shop-product-card__star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 12px;
	height: 12px;
	flex: 0 0 auto;
}

.shop-product-card__star svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.shop-product-card__star.is-filled {
	color: var(--color-star);
}

.shop-product-card__star.is-empty {
	color: var(--theme-palette-color-6);
}

.shop-product-card__rating-value,
.shop-product-card__review-count {
	color: var(--theme-palette-color-3);
	flex-shrink: 0;
}

.shop-product-card__rating-value {
	font-weight: var(--fw-semibold);
}

.shop-product-card__price {
	container-type: inline-size;
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	column-gap: var(--space-2);
	margin-bottom: var(--space-4);
}

/* Let exceptionally long sale prices wrap between amounts. */
.shop-product-card__price:has(> .bm-discount-badge) {
	row-gap: var(--space-1);
	column-gap: clamp(1px, calc(4% - 3px), 6px);
	white-space: nowrap;
}

.shop-product-card__cart-control,
.shop-product-card__add-to-cart--details {
	margin-top: auto;
}

.bm-discount-badge {
	display: inline-block;
	padding: 3px 0.6em;
	border-radius: var(--radius-xs);
	background: color-mix(in srgb, var(--theme-palette-color-5) 11%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-palette-color-5) 35%, transparent);
	color: var(--theme-palette-color-5);
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
	line-height: var(--lh-tight);
	white-space: nowrap;
}

.shop-product-card__price-current {
	color: var(--theme-palette-color-4);
	font-size: clamp(0.75rem, 11cqi, var(--fs-2xl));
	font-weight: var(--fw-semibold);
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.shop-product-card__price-current:has(+ .shop-product-card__price-old),
.shop-product-card__price-current:has(del) ins {
	color: var(--theme-palette-color-2);
}

.shop-product-card__price:has(> .bm-discount-badge) :is(.shop-product-card__price-old, del) {
	font-size: clamp(0.5625rem, 8.2cqi, var(--fs-sm));
}

.shop-product-card__price > .bm-discount-badge {
	padding-block: clamp(2px, calc(8cqi - 11px), 3px);
	padding-inline: clamp(2px, 2cqi, 4px);
	font-size: clamp(0.5625rem, 8.2cqi, var(--fs-xs));
	line-height: 1;
}

.shop-product-card__price-current:has(+ .bm-discount-badge) .sale-price {
	align-items: baseline;
	justify-content: flex-start;
	gap: var(--space-1);
}

.shop-product-card__price-current del {
	color: var(--theme-palette-color-3);
}

.shop-product-card__price-old {
	color: var(--theme-palette-color-3);
	font-size: var(--fs-sm);
	font-weight: var(--fw-regular);
	line-height: 1.2;
	text-decoration: line-through;
}

.shop-product-card__cart-control {
	position: relative;
	width: 100%;
	min-height: var(--action-size-standard);
}

.shop-product-card__add-to-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--action-size-standard);
	padding: 8px var(--space-4);
	border: 0;
	border-radius: var(--radius-md);
	background: var(--theme-palette-color-2);
	color: var(--theme-palette-color-8);
	font-family: inherit;
	font-size: var(--fs-md);
	font-weight: var(--fw-semibold);
	line-height: 1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--transition-base),
		opacity var(--transition-base);
}

.shop-product-card__add-to-cart:hover {
	background: var(--theme-palette-color-5);
	color: var(--theme-palette-color-8);
}

.shop-product-card__add-to-cart:focus-visible {
	outline: var(--focus-width) solid var(--theme-palette-color-1);
	outline-offset: var(--focus-offset-tight);
}

.shop-product-card__add-to-cart--details {
	border: 1px solid var(--theme-palette-color-6);
	background: var(--theme-palette-color-8);
	color: var(--theme-palette-color-4);
	transition:
		color var(--transition-base),
		background-color var(--transition-base),
		border-color var(--transition-base);
}

.shop-product-card__add-to-cart--details:hover {
	border-color: var(--theme-palette-color-1);
	background: var(--theme-palette-color-8);
	color: var(--theme-palette-color-2);
}

.shop-product-card__quantity {
	display: none;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: var(--action-size-standard);
	padding: 0 8px;
	border-radius: var(--radius-md);
	background: var(--theme-palette-color-2);
}

.shop-product-card__cart-control.is-quantity .shop-product-card__add-to-cart {
	display: none;
}

.shop-product-card__cart-control.is-quantity .shop-product-card__quantity {
	display: flex;
}

.shop-product-card__quantity-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 28px;
	padding: var(--space-1);
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--theme-palette-color-8);
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: var(--fw-regular);
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--transition-fast);
}

.shop-product-card__quantity-button svg {
	width: 14px;
	height: 14px;
}

.shop-product-card__quantity-button:hover {
	background: rgb(255 255 255 / 0.12);
}

.shop-product-card__quantity-button:focus-visible {
	outline: var(--focus-width) solid var(--theme-palette-color-8);
	outline-offset: -2px;
}

.shop-product-card__quantity-value {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	color: var(--theme-palette-color-8);
	font-size: var(--fs-md);
	font-weight: var(--fw-semibold);
}

.shop-product-card__cart-control.is-loading {
	opacity: 0.65;
	pointer-events: none;
}

.shop-product-card:not(.product) .shop-product-card__wishlist {
	position: absolute;
	top: var(--space-3);
	right: var(--space-3);
	z-index: 4;
	width: 30px;
	height: 30px;
}

.shop-product-card__wishlist .cw-wishlist-button__icon,
.shop-product-card__wishlist svg {
	width: 15px;
	height: 15px;
}

@media (max-width: 689.98px) {
	.shop-recently-viewed__placeholder-body {
		height: 168px;
		padding: 9px;
	}

	.shop-product-card__wishlist .cw-wishlist-button__icon {
		width: 13px;
		height: 13px;
	}

	.shop-product-carousel__header {
		margin-bottom: var(--space-4);
		gap: var(--space-3);
	}

	.shop-product-carousel__title {
		font-size: var(--fs-lg);
	}

	.shop-product-carousel__button {
		width: 34px;
		height: 34px;
		padding: 6px;
	}

	article.shop-product-card,
	li.product-item {
		border-radius: var(--radius-md);
	}

	.shop-product-card__media {
		padding: 10px;
	}

	.shop-product-card__badge {
		top: var(--space-2);
		left: var(--space-2);
		min-height: 18px;
		padding: 2px 5px;
		font-size: 0.5625rem;
	}

	.shop-product-card__content {
		padding: 9px;
	}

	.shop-product-card__brand {
		margin-bottom: 2px;
		font-size: 0.5625rem;
	}

	.shop-product-card__content > .shop-product-card__title {
		margin-bottom: var(--space-2);
		font-size: 0.75rem;
		line-height: 1.25;
		min-height: calc(1.25 * 3em);
	}

	.shop-product-card__rating {
		gap: 3px;
		min-height: 12px;
		margin-bottom: var(--space-2);
		font-size: 0.625rem;
	}

	.shop-product-card__stars {
		gap: 1px;
	}

	.shop-product-card__star {
		width: 10px;
		height: 10px;
	}

	.shop-product-card__price {
		column-gap: var(--space-1);
		margin-bottom: var(--space-3);
	}


	.shop-product-card__price-current .woocommerce-Price-currencySymbol {
		font-size: 0.85em;
	}


	.shop-product-card__cart-control,
	.shop-product-card__add-to-cart,
	.shop-product-card__quantity {
		height: var(--action-size-icon);
		min-height: var(--action-size-icon);
	}

	.shop-product-card__add-to-cart {
		padding: 6px var(--space-2);
		border-radius: var(--radius-sm);
		font-size: var(--fs-sm);
	}

	.shop-product-card__quantity {
		padding: 0 4px;
		border-radius: var(--radius-sm);
	}

	.shop-product-card__quantity-value {
		min-width: 22px;
		font-size: var(--fs-sm);
	}

	.shop-product-card:not(.product) .shop-product-card__wishlist {
		top: var(--space-2);
		right: var(--space-2);
		width: 26px;
		height: 26px;
	}

	.shop-product-card:not(.product) .shop-product-card__wishlist svg {
		width: 13px;
		height: 13px;
	}
}

@media (width < 450px) {
	.shop-product-card__media-discount {
		position: absolute;
		inset-inline-end: var(--space-2);
		inset-block-end: var(--space-2);
		display: block;
		z-index: 2;
		pointer-events: none;
	}

	.shop-product-card__media-discount .bm-discount-badge {
		padding-inline: 0.45em;
		background: color-mix(in srgb, color-mix(in srgb, var(--theme-palette-color-5) 11%, var(--theme-palette-color-8)) 80%, transparent);
	}

	.shop-product-card__price-current {
		font-size: clamp(0.875rem, 13cqi, 1.125rem);
	}

	.shop-product-card__price > .bm-discount-badge {
		display: none;
	}
}

.shop-product-card__price:empty,
.woocommerce ul.products li.product .price:empty {
	display: none;
}

.shop-product-carousel__swiper .swiper-wrapper {
	display: flex;
	flex-wrap: nowrap;
}

.shop-product-card__cart-control .added_to_cart {
	display: none !important;
}

.single-product .ct-product-add-to-cart .added_to_cart,
.single-product .single_add_to_cart_button + .added_to_cart {
	display: inline-flex !important;
}

.shop-product-card__cart-error {
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% + 10px);
	z-index: 5;
	display: block;
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	background: #dc2626;
	color: #fff;
	font-size: var(--fs-xs);
	font-weight: var(--fw-semibold);
	line-height: 1.35;
	text-align: center;
	white-space: normal;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	box-shadow: 0 8px 20px rgb(0 0 0 / 0.2);
	transition:
		opacity var(--transition-base),
		transform var(--transition-base),
		visibility var(--transition-base);
}

.shop-product-card__cart-error::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	width: 0;
	height: 0;
	margin-left: -6px;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid #dc2626;
}

.shop-product-card__cart-control.is-error .shop-product-card__cart-error {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	animation: shop-cart-error-autohide 4s ease forwards;
}

@media (max-width: 689.98px) {
	.shop-product-card__cart-error {
		padding: 6px 10px;
		bottom: calc(100% + 8px);
		font-size: 0.625rem;
	}

	.shop-product-card__cart-error::after {
		border-left-width: 5px;
		border-right-width: 5px;
		border-top-width: 5px;
		margin-left: -5px;
	}
}

@keyframes shop-cart-error-autohide {
	0%,
	80% {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	100% {
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
	}
}

.shop-product-card__stock {
	margin: auto 0 var(--space-3);
	color: var(--theme-palette-color-3);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
}
