/**
 * Style 1 — isolated CSS, namespaced under .vynox-s1-card so it can never
 * leak into or clash with other styles' markup.
 *
 * Color/typography values are NOT hardcoded. Each property reads a
 * --vynox-s1-* custom property first; that variable's fallback points at
 * the theme's own WordPress preset variables (--wp--preset--color-...,
 * --wp--preset--font-family-...). If the active theme has no theme.json
 * presets, the final fallback is a sane neutral value.
 *
 * The Elementor widget's Style tab writes to shared, style-agnostic
 * --vynox-override-* variables (see Controls::register_style_controls())
 * on the widget wrapper — every style (style-1, style-2, ...) reads the
 * SAME override variables, so per-instance color overrides keep working
 * no matter which visual style is selected, without duplicating controls
 * per style.
 */

.vynox-s1-card {
	--vynox-s1-radius: 10px;
	--vynox-s1-card-bg: var( --vynox-override-card-bg, var( --wp--preset--color-base, #ffffff ) );
	--vynox-s1-border-color: var( --vynox-override-border-color, var( --wp--preset--color-contrast-2, #e5e5e5 ) );
	--vynox-s1-title-color: var( --vynox-override-title-color, var( --wp--preset--color-contrast, #1a1a1a ) );
	--vynox-s1-price-color: var( --vynox-override-price-color, var( --wp--preset--color-primary, #2e7d32 ) );
	--vynox-s1-price-strike-color: var( --vynox-override-price-strike-color, var( --wp--preset--color-contrast-3, #999999 ) );
	--vynox-s1-badge-bg: var( --vynox-override-badge-bg, var( --wp--preset--color-primary, #2e7d32 ) );
	--vynox-s1-badge-text: var( --vynox-override-badge-text, var( --wp--preset--color-base, #ffffff ) );
	--vynox-s1-button-bg: var( --vynox-override-button-bg, var( --wp--preset--color-primary, #2e7d32 ) );
	--vynox-s1-button-text: var( --vynox-override-button-text, var( --wp--preset--color-base, #ffffff ) );
	--vynox-s1-star-color: var( --vynox-override-star-color, #f5b301 );

	position: relative;
	display: flex;
	flex-direction: column;
	background: var( --vynox-s1-card-bg );
	border-radius: var( --vynox-s1-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, border-color 0.25s ease;
	height: 100%;
    padding: 15px;

}

.vynox-s1-card:hover {
	box-shadow: #e8751824 0px 6px 24px 0px, #e8751845 0px 0px 0px 1px;
}

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

.vynox-s1-card__img-link {
	display: block;
	width: 100%;
	height: 100%;
}

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

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

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

.vynox-s1-card__wishlist {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
}

.vynox-pb-grid__item .vynox-s1-card__wishlist .vynox-wishlist-btn,
.vynox-s1-card__wishlist a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	background: var( --wp--preset--color-base, #ffffff );
	color: var( --vynox-s1-title-color );
	border: none;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.15 );
}

.vynox-s1-card__cart-overlay {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	opacity: 0;
	transform: translateY( 8px );
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.vynox-s1-card:hover .vynox-s1-card__cart-overlay,
.vynox-s1-card:focus-within .vynox-s1-card__cart-overlay {
	opacity: 1;
	transform: translateY( 0 );
}

.vynox-s1-card__cart-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background: var( --vynox-s1-button-bg );
	color: var( --vynox-s1-button-text );
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	padding: 12px 16px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
}
.vynox-s1-card__cart-btn:hover {color:#fff;}
.vynox-s1-card__body {
	padding: 15px 0 0 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.vynox-s1-card__title {
	color: var( --vynox-s1-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;

	/* Clamp to 2 lines; overflow text is cut off with an ellipsis instead of wrapping further. */
	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-s1-card__title:hover {
	color: var(--e-global-color-secondary);
}

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

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

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

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

.vynox-s1-card__rating .star-rating {
	color: var( --vynox-s1-star-color );
	font-size: 14px;
}

/* Touch devices can't hover — keep the Add to Cart button always visible. */
@media ( hover: none ) {
	.vynox-s1-card__cart-overlay {
		opacity: 1;
		transform: none;
		position: static;
		margin-top: 10px;
	}

	.vynox-s1-card__media {
		padding-bottom: 4px;
	}
}

/* Appended (not editing existing rules above): "Processing" state for the
   Add to Cart button. WooCommerce's own wc-add-to-cart.js adds/removes the
   ".loading" class on the clicked link while the AJAX request is in flight —
   this just gives that state a visual (spinner + dimmed label) instead of
   the browser's default (nothing visible changes without this). */
.vynox-s1-card__cart-btn.loading {
	position: relative;
	pointer-events: none;
	color: transparent !important;
}

.vynox-s1-card__cart-btn.loading svg {
	visibility: hidden;
}

.vynox-s1-card__cart-btn.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba( 255, 255, 255, 0.4 );
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: vynox-cart-spin 0.6s linear infinite;
}

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