/**
 * Xyod Products — WooCommerce product grid
 */

.xyod-products {
	--xyod-products-columns: 3;
	--xyod-products-gap-x: 30px;
	--xyod-products-gap-y: 40px;
	display: grid;
	grid-template-columns: repeat(var(--xyod-products-columns), minmax(0, 1fr));
	column-gap: var(--xyod-products-gap-x);
	row-gap: var(--xyod-products-gap-y);
	width: 100%;
}

.xyod-products-wrapper {
	width: 100%;
}

.xyod-products--empty {
	padding: 1rem 0;
	margin: 0;
}

.xyod-products__item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	position: relative;
}

.xyod-products__media {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
	margin-bottom: 16px;
}

.xyod-products__image-link {
	display: block;
	line-height: 0;
}

.xyod-products__media img,
.xyod-products__image {
	display: block;
	width: 100%;
	height: auto;
}

.xyod-products__sale {
	position: absolute;
	z-index: 3;
	top: 12px;
	left: 12px;
	padding: 0.35em 0.65em;
	background: #1f2124;
	color: #fff;
	font-size: 0.75rem;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.xyod-products__content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.xyod-products__title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	font-weight: 400;
	line-height: 1.3;
}

.xyod-products__title a {
	text-decoration: none;
	color: inherit;
}

.xyod-products__title a:hover,
.xyod-products__title a:focus {
	text-decoration: none;
}

.xyod-products__rating {
	margin: 0 0 8px;
	line-height: 1;
}

.xyod-products__price {
	margin: 0 0 12px;
	line-height: 1.4;
}

.xyod-products__price del {
	opacity: 0.55;
	margin-inline-end: 0.35em;
}

.xyod-products__price ins {
	text-decoration: none;
}

.xyod-products__actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
}

/* Classic: respect Layout → Alignment (text-align on the card). */
.xyod-products--classic .xyod-products__actions {
	display: block;
	width: 100%;
}

.xyod-products--classic .xyod-products__actions .xyod-products__button {
	vertical-align: top;
}

.xyod-products__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35em;
	margin: 0;
	padding: 0.75rem 1.25rem;
	border: 0;
	background: #1f2124;
	color: #fff;
	font: inherit;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.35s ease;
}

.xyod-products__button:hover,
.xyod-products__button:focus,
.xyod-products__button:active,
.xyod-products__button:focus-visible {
	color: #fff;
	text-decoration: none;
	opacity: 1;
	outline: none;
}

.xyod-products__button.loading {
	opacity: 0.55;
	pointer-events: none;
}

.xyod-products__button.added,
.xyod-products__button--view-cart,
.xyod-products__button--view-cart:hover,
.xyod-products__button--view-cart:focus,
.xyod-products__button--view-cart:active {
	opacity: 1 !important;
}

/* —— Classic: space “View cart” after AJAX add —— */
.xyod-products--classic .xyod-products__actions .added_to_cart,
.xyod-products--classic .xyod-products__actions a.added_to_cart {
	display: block;
	margin: 0.75rem 0 0;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
	color: inherit;
	font-size: 0.9rem;
	line-height: 1.4;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.xyod-products--classic .xyod-products__actions .added_to_cart:hover,
.xyod-products--classic .xyod-products__actions a.added_to_cart:hover {
	opacity: 0.75;
}

/* —— Hover overlay style —— */
.xyod-products--hover .xyod-products__media {
	isolation: isolate;
}

.xyod-products--hover .xyod-products__image-link {
	overflow: hidden;
}

.xyod-products--hover .xyod-products__image {
	transform: scale(1);
	transition: transform 0.55s ease;
	will-change: transform;
}

.xyod-products--hover .xyod-products__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease;
}

.xyod-products--hover .xyod-products__actions--overlay {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: auto;
	bottom: 40px;
	transform: translate(-50%, -2.5rem);
	margin: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.45s ease;
}

.xyod-products--hover .xyod-products__item:hover .xyod-products__image {
	transform: scale(1.08);
}

.xyod-products--hover .xyod-products__item:hover .xyod-products__overlay {
	opacity: 1;
}

.xyod-products--hover .xyod-products__item:hover .xyod-products__actions--overlay {
	opacity: 1;
	transform: translate(-50%, 0);
	pointer-events: auto;
}

.xyod-products--hover .xyod-products__actions--overlay .xyod-products__button,
.xyod-products--hover .xyod-products__actions--overlay .xyod-products__button.added,
.xyod-products--hover .xyod-products__actions--overlay .xyod-products__button.loading,
.xyod-products--hover .xyod-products__actions--overlay .xyod-products__button--view-cart {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0;
	white-space: nowrap;
	min-width: 0;
	width: auto;
	text-align: center;
	line-height: 1.2;
	box-sizing: border-box;
}

.xyod-products--hover .xyod-products__actions--overlay .xyod-products__button-label {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	text-align: center;
	line-height: 1.2;
}

/* Kill WooCommerce “added” / loading icons (they shift the label). */
.xyod-products--hover .xyod-products__button::before,
.xyod-products--hover .xyod-products__button::after,
.xyod-products--hover .xyod-products__button.added::before,
.xyod-products--hover .xyod-products__button.added::after,
.xyod-products--hover .xyod-products__button.loading::before,
.xyod-products--hover .xyod-products__button.loading::after,
.xyod-products--hover a.button.added::before,
.xyod-products--hover a.button.added::after,
.xyod-products--hover a.button.loading::before,
.xyod-products--hover a.button.loading::after {
	content: none !important;
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	width: 0 !important;
	height: 0 !important;
	font-size: 0 !important;
	visibility: hidden !important;
}

.xyod-products--hover .xyod-products__actions--overlay .added_to_cart,
.xyod-products--hover .xyod-products__actions--overlay a.added_to_cart.wc-forward {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.xyod-products--hover .xyod-products__price {
	margin-bottom: 0;
}

@media (hover: none) {
	.xyod-products--hover .xyod-products__overlay {
		opacity: 0.2;
	}

	.xyod-products--hover .xyod-products__actions--overlay {
		opacity: 1;
		transform: translate(-50%, 0);
		pointer-events: auto;
	}

	.xyod-products--hover .xyod-products__image {
		transform: none;
	}
}
