/**
 * Style 3 â€” isolated CSS, namespaced under .vynox-s3-card. Same card body
 * (title/price/rating) as Styles 1/2; the difference is the action icons:
 * a single horizontal row centered over the middle of the image, with a
 * dark overlay behind them (so white icon circles stay legible against
 * any product photo) â€” both hidden until hover/focus (always visible on
 * touch devices, which can't hover â€” see @media (hover: none) below).
 * "View Cart" appears ABOVE the cart icon instead of beside it (Style 2).
 *
 * Reads the SAME --vynox-override-* variables the other styles do (see
 * Controls::register_style_controls()), so the Style tab's color/
 * typography controls affect whichever style is actually selected, and
 * the same --vynox-cart-pill-bg the "View Cart Button" section controls
 * (see Controls::register_cart_button_controls()).
 */

.vynox-s3-card {
	--vynox-s3-radius: 10px;
	--vynox-s3-card-bg: var( --vynox-override-card-bg, var( --wp--preset--color-base, #ffffff ) );
	--vynox-s3-border-color: var( --vynox-override-border-color, var( --wp--preset--color-contrast-2, #e5e5e5 ) );
	--vynox-s3-title-color: var( --vynox-override-title-color, var( --wp--preset--color-contrast, #1a1a1a ) );
	--vynox-s3-price-color: var( --vynox-override-price-color, var( --wp--preset--color-primary, #2e7d32 ) );
	--vynox-s3-price-strike-color: var( --vynox-override-price-strike-color, var( --wp--preset--color-contrast-3, #999999 ) );
	--vynox-s3-badge-bg: var(--vynox-override-badge-bg, var(--wp--preset--color-primary, #2e7d32));
	--vynox-s3-badge-text: var( --vynox-override-badge-text, var( --wp--preset--color-base, #ffffff ) );
	--vynox-s3-icon-color: var( --vynox-override-title-color, var( --wp--preset--color-contrast, #1a1a1a ) );
	--vynox-s3-icon-active-color: var( --vynox-override-price-color, var( --wp--preset--color-primary, #2e7d32 ) );
	--vynox-s3-star-color: var( --vynox-override-star-color, #f5b301 );
	position: relative;
	display: flex;
	flex-direction: column;
	background: var( --vynox-s3-card-bg );
	border-radius: var( --vynox-s3-radius );
	overflow: hidden;
	box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
	transition: box-shadow 0.25s ease;
	height: 100%;
	padding: 15px;
}

.vynox-s3-card:hover {
	box-shadow: #ff7a0030 0px 6px 24px 0px, #ff7a004a 0px 0px 0px 1px;
}

.vynox-s3-card__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.vynox-s3-card__img-link {
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
    border-radius: 10px;
}

.vynox-s3-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 10px !important;
	transition: transform 0.35s ease;
}

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

.vynox-s3-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var( --vynox-s3-badge-bg );
	color: var( --vynox-s3-badge-text );
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	padding: 6px 10px;
	border-radius: 999px;
	z-index: 2;
}

/* ---------- Dark overlay + centered icon row (hover only) ---------- */

.vynox-s3-card__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.32 );
	opacity: 0;
	transition: opacity 0.25s ease;
	z-index: 1;
	border-radius: 10px;
}

.vynox-s3-card:hover .vynox-s3-card__overlay,
.vynox-s3-card:focus-within .vynox-s3-card__overlay {
	opacity: 1;
}

.vynox-s3-card__icons {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	z-index: 2;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.vynox-s3-card:hover .vynox-s3-card__icons,
.vynox-s3-card:focus-within .vynox-s3-card__icons {
	opacity: 1;
	pointer-events: auto;
}

.vynox-s3-card__icon-btn {
	position: relative;
	display: inline-flex;
}

/* :not(.added_to_cart) â€” see style-2/style.css for why this exclusion is
   required: without it this rule also matches the "View Cart" link
   WooCommerce injects as a sibling inside .vynox-s3-card__icon-btn--cart. */
.vynox-s3-card .vynox-s3-card__icon-btn a:not( .added_to_cart ),
.vynox-s3-card .vynox-s3-card__icon-btn button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	background: var( --wp--preset--color-base, #ffffff );
	color: var( --vynox-s3-icon-color );
	border: none;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.25 );
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.vynox-s3-card__icon-btn a:not( .added_to_cart ):hover,
.vynox-s3-card__icon-btn button:hover {
	transform: translateY( -2px );
}

.vynox-s3-card__icon-btn--compare button.is-active {
	background: var( --vynox-s3-icon-active-color );
	color: var( --wp--preset--color-base, #ffffff );
}

/* "View Cart" flyout, ABOVE the cart icon (unlike Style 2's beside-icon
   placement) â€” same shared --vynox-cart-pill-bg custom property, so the
   "View Cart Button" Style-tab section drives both styles' pill from one
   set of controls. */
.vynox-s3-card__icon-btn--cart .added_to_cart {
	--vynox-cart-pill-bg: #000;
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX( -50% );
	margin-bottom: 10px;
	width: auto;
	height: auto;
	display: inline-block;
	background: var( --vynox-cart-pill-bg );
	color: #fff;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	padding: 9px 16px;
	border-radius: 999px;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.25 );
	z-index: 3;
}

.vynox-s3-card__icon-btn--cart .added_to_cart::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX( -50% );
	border: 5px solid transparent;
	border-top-color: var( --vynox-cart-pill-bg );
}

/* Touch devices can't hover â€” keep the overlay/icons visible and tappable,
   matching Styles 1/2's own touch handling. */
@media ( hover: none ) {
	.vynox-s3-card__overlay,
	.vynox-s3-card__icons {
		opacity: 1;
		pointer-events: auto;
	}
}

/* "Processing" state for the icon-only Add to Cart button. */
.vynox-s3-card__icon-btn--cart a.loading {
	position: relative;
	pointer-events: none;
}

.vynox-s3-card__icon-btn--cart a.loading svg {
	visibility: hidden;
}

.vynox-s3-card__icon-btn--cart a.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba( 0, 0, 0, 0.15 );
	border-top-color: var( --vynox-s3-icon-color );
	border-radius: 50%;
	animation: vynox-s3-cart-spin 0.6s linear infinite;
}

@keyframes vynox-s3-cart-spin {
	to { transform: rotate( 360deg ); }
}

/* ---------- Body (identical structure/behavior to Styles 1/2) ---------- */

.vynox-s3-card__body {
	padding: 15px 0 0 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.vynox-pb-grid .vynox-pb-grid__item .vynox-s3-card .vynox-s3-card__body .vynox-s3-card__title {
	color: var( --vynox-s3-title-color );
	text-decoration: none;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	/* display: -webkit-box; */
	/* -webkit-line-clamp: 2; */
	/* -webkit-box-orient: vertical; */
	/* overflow: hidden; */
	/* text-overflow: ellipsis; */

	/* Reserve space for exactly 2 lines so cards with short titles still align. */
	/* min-height: calc( 16px * 1.35 * 2 ); */
}

.vynox-s3-card__title:hover {
	color: var( --vynox-s3-price-color );
}

.vynox-s3-card__price {
	font-size: 16px;
	font-weight: 700;
	color: var( --vynox-s3-price-color );
}

.vynox-s3-card__price del {
	color: var( --vynox-s3-price-strike-color );
	font-weight: 400;
	font-size: 14px;
	margin-right: 6px;
	text-decoration: line-through;
}

.vynox-s3-card__price ins {
	text-decoration: none;
}

.vynox-s3-card__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var( --vynox-s3-price-strike-color );
}

.vynox-s3-card__rating .star-rating {
	overflow:visible;
	color: var( --vynox-s3-star-color );
	font-size: 14px;
}
a.ajax_add_to_cart.add_to_cart_button:hover {background: var(--e-global-color-secondary);}
a.ajax_add_to_cart.add_to_cart_button:hover svg {color:#fff;}