/**
 * IVISKIN Badges – frontend.
 * Every design value arrives as a CSS custom property on the element (see IVB_Renderer::style_vars()).
 * --ivb-k is the final scale: context scale (--ivb-s) × phone factor (--ivb-sm, ≤ 549 px only).
 */

/* Wrapper ---------------------------------------------------------------- */
.ivb-badges {
	--ivb-s: 1;
	--ivb-k: var(--ivb-s);
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--ivb-z, 5);
	display: block;
	margin: 0;
	padding: 0;
	line-height: 1;
	pointer-events: none;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.ivb-badges.ivb-ctx-loop {
	--ivb-s: var(--ivb-loop-s, 0.8);
}

@media (max-width: 549px) {
	.ivb-badges {
		--ivb-k: calc(var(--ivb-s) * var(--ivb-sm, 1));
	}
}

.ivb-badges.ivb-layout-inline {
	position: relative;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	z-index: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ivb-gap, 6px);
}

/* Corner stacks ---------------------------------------------------------- */
.ivb-stack {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: var(--ivb-gap, 6px);
}

.ivb-pos-top-left     { top: 0; left: 0; align-items: flex-start; --ivb-dx: 1; --ivb-dy: 1; }
.ivb-pos-top-right    { top: 0; right: 0; align-items: flex-end; --ivb-dx: -1; --ivb-dy: 1; }
.ivb-pos-bottom-left  { bottom: 0; left: 0; align-items: flex-start; flex-direction: column-reverse; --ivb-dx: 1; --ivb-dy: -1; }
.ivb-pos-bottom-right { bottom: 0; right: 0; align-items: flex-end; flex-direction: column-reverse; --ivb-dx: -1; --ivb-dy: -1; }

/* Badge ------------------------------------------------------------------ */
.ivb-badge {
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: calc(var(--ivb-w, 70px) * var(--ivb-k));
	height: calc(var(--ivb-h, 70px) * var(--ivb-k));
	margin: 0;
	padding: 0 calc(6px * var(--ivb-k));
	color: var(--ivb-c, #fff);
	font-family: inherit;
	font-size: calc(var(--ivb-fs, 19px) * var(--ivb-k));
	font-weight: var(--ivb-fw, 700);
	font-style: normal;
	line-height: 1.05;
	letter-spacing: -0.01em;
	text-align: center;
	text-transform: none;
	white-space: nowrap;
	transform:
		translate(
			calc(var(--ivb-x, 0px) * var(--ivb-k) * var(--ivb-dx, 1)),
			calc(var(--ivb-y, 0px) * var(--ivb-k) * var(--ivb-dy, 1))
		)
		rotate(var(--ivb-rot, 0deg));
	pointer-events: none;
}

.ivb-layout-inline .ivb-badge {
	transform: rotate(var(--ivb-rot, 0deg));
}

.ivb-badge[hidden] {
	display: none !important;
}

.ivb-badge__bg {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	border-radius: inherit;
	background: var(--ivb-bg, transparent);
}

.ivb-badge__text {
	position: relative;
	display: block;
}

/* Shapes ----------------------------------------------------------------- */
.ivb-shape-circle {
	border-radius: 50%;
}

.ivb-shape-rectangle {
	border-radius: calc(var(--ivb-r, 0px) * var(--ivb-k));
}

.ivb-shape-seal .ivb-badge__bg {
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0.9 51.9 1.5 53.7 2.9 55.4 4.6 57 6.1 58.6 6.9 60.4 6.8 62.4 6 64.6 5 66.8 4.4 68.8 4.7 70.3 5.9 71.5 7.9 72.3 10.1 73.2 12.1 74.4 13.5 76.1 14.1 78.3 14.1 80.7 14 83 14.3 84.7 15.3 85.7 17 86 19.3 85.9 21.7 85.9 23.9 86.5 25.6 87.9 26.8 89.9 27.7 92.1 28.5 94.1 29.7 95.3 31.2 95.6 33.2 95 35.4 94 37.6 93.2 39.6 93.1 41.4 93.9 43 95.4 44.6 97.1 46.3 98.5 48.1 99.1 50 98.5 51.9 97.1 53.7 95.4 55.4 93.9 57 93.1 58.6 93.2 60.4 94 62.4 95 64.6 95.6 66.8 95.3 68.8 94.1 70.3 92.1 71.5 89.9 72.3 87.9 73.2 86.5 74.4 85.9 76.1 85.9 78.3 86 80.7 85.7 83 84.7 84.7 83 85.7 80.7 86 78.3 85.9 76.1 85.9 74.4 86.5 73.2 87.9 72.3 89.9 71.5 92.1 70.3 94.1 68.8 95.3 66.8 95.6 64.6 95 62.4 94 60.4 93.2 58.6 93.1 57 93.9 55.4 95.4 53.7 97.1 51.9 98.5 50 99.1 48.1 98.5 46.3 97.1 44.6 95.4 43 93.9 41.4 93.1 39.6 93.2 37.6 94 35.4 95 33.2 95.6 31.2 95.3 29.7 94.1 28.5 92.1 27.7 89.9 26.8 87.9 25.6 86.5 23.9 85.9 21.7 85.9 19.3 86 17 85.7 15.3 84.7 14.3 83 14 80.7 14.1 78.3 14.1 76.1 13.5 74.4 12.1 73.2 10.1 72.3 7.9 71.5 5.9 70.3 4.7 68.8 4.4 66.8 5 64.6 6 62.4 6.8 60.4 6.9 58.6 6.1 57 4.6 55.4 2.9 53.7 1.5 51.9 0.9 50 1.5 48.1 2.9 46.3 4.6 44.6 6.1 43 6.9 41.4 6.8 39.6 6 37.6 5 35.4 4.4 33.2 4.7 31.2 5.9 29.7 7.9 28.5 10.1 27.7 12.1 26.8 13.5 25.6 14.1 23.9 14.1 21.7 14 19.3 14.3 17 15.3 15.3 17 14.3 19.3 14 21.7 14.1 23.9 14.1 25.6 13.5 26.8 12.1 27.7 10.1 28.5 7.9 29.7 5.9 31.2 4.7 33.2 4.4 35.4 5 37.6 6 39.6 6.8 41.4 6.9 43 6.1 44.6 4.6 46.3 2.9 48.1 1.5Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0.9 51.9 1.5 53.7 2.9 55.4 4.6 57 6.1 58.6 6.9 60.4 6.8 62.4 6 64.6 5 66.8 4.4 68.8 4.7 70.3 5.9 71.5 7.9 72.3 10.1 73.2 12.1 74.4 13.5 76.1 14.1 78.3 14.1 80.7 14 83 14.3 84.7 15.3 85.7 17 86 19.3 85.9 21.7 85.9 23.9 86.5 25.6 87.9 26.8 89.9 27.7 92.1 28.5 94.1 29.7 95.3 31.2 95.6 33.2 95 35.4 94 37.6 93.2 39.6 93.1 41.4 93.9 43 95.4 44.6 97.1 46.3 98.5 48.1 99.1 50 98.5 51.9 97.1 53.7 95.4 55.4 93.9 57 93.1 58.6 93.2 60.4 94 62.4 95 64.6 95.6 66.8 95.3 68.8 94.1 70.3 92.1 71.5 89.9 72.3 87.9 73.2 86.5 74.4 85.9 76.1 85.9 78.3 86 80.7 85.7 83 84.7 84.7 83 85.7 80.7 86 78.3 85.9 76.1 85.9 74.4 86.5 73.2 87.9 72.3 89.9 71.5 92.1 70.3 94.1 68.8 95.3 66.8 95.6 64.6 95 62.4 94 60.4 93.2 58.6 93.1 57 93.9 55.4 95.4 53.7 97.1 51.9 98.5 50 99.1 48.1 98.5 46.3 97.1 44.6 95.4 43 93.9 41.4 93.1 39.6 93.2 37.6 94 35.4 95 33.2 95.6 31.2 95.3 29.7 94.1 28.5 92.1 27.7 89.9 26.8 87.9 25.6 86.5 23.9 85.9 21.7 85.9 19.3 86 17 85.7 15.3 84.7 14.3 83 14 80.7 14.1 78.3 14.1 76.1 13.5 74.4 12.1 73.2 10.1 72.3 7.9 71.5 5.9 70.3 4.7 68.8 4.4 66.8 5 64.6 6 62.4 6.8 60.4 6.9 58.6 6.1 57 4.6 55.4 2.9 53.7 1.5 51.9 0.9 50 1.5 48.1 2.9 46.3 4.6 44.6 6.1 43 6.9 41.4 6.8 39.6 6 37.6 5 35.4 4.4 33.2 4.7 31.2 5.9 29.7 7.9 28.5 10.1 27.7 12.1 26.8 13.5 25.6 14.1 23.9 14.1 21.7 14 19.3 14.3 17 15.3 15.3 17 14.3 19.3 14 21.7 14.1 23.9 14.1 25.6 13.5 26.8 12.1 27.7 10.1 28.5 7.9 29.7 5.9 31.2 4.7 33.2 4.4 35.4 5 37.6 6 39.6 6.8 41.4 6.9 43 6.1 44.6 4.6 46.3 2.9 48.1 1.5Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.ivb-shape-starburst .ivb-badge__bg {
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 1 55.4 9.2 62.7 2.7 65.8 12 74.5 7.6 75.1 17.3 84.6 15.4 82.7 24.9 92.4 25.5 88 34.2 97.3 37.3 90.8 44.6 99 50 90.8 55.4 97.3 62.7 88 65.8 92.4 74.5 82.7 75.1 84.6 84.6 75.1 82.7 74.5 92.4 65.8 88 62.7 97.3 55.4 90.8 50 99 44.6 90.8 37.3 97.3 34.2 88 25.5 92.4 24.9 82.7 15.4 84.6 17.3 75.1 7.6 74.5 12 65.8 2.7 62.7 9.2 55.4 1 50 9.2 44.6 2.7 37.3 12 34.2 7.6 25.5 17.3 24.9 15.4 15.4 24.9 17.3 25.5 7.6 34.2 12 37.3 2.7 44.6 9.2Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 1 55.4 9.2 62.7 2.7 65.8 12 74.5 7.6 75.1 17.3 84.6 15.4 82.7 24.9 92.4 25.5 88 34.2 97.3 37.3 90.8 44.6 99 50 90.8 55.4 97.3 62.7 88 65.8 92.4 74.5 82.7 75.1 84.6 84.6 75.1 82.7 74.5 92.4 65.8 88 62.7 97.3 55.4 90.8 50 99 44.6 90.8 37.3 97.3 34.2 88 25.5 92.4 24.9 82.7 15.4 84.6 17.3 75.1 7.6 74.5 12 65.8 2.7 62.7 9.2 55.4 1 50 9.2 44.6 2.7 37.3 12 34.2 7.6 25.5 17.3 24.9 15.4 15.4 24.9 17.3 25.5 7.6 34.2 12 37.3 2.7 44.6 9.2Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* Effects ---------------------------------------------------------------- */
.ivb-has-ring .ivb-badge__bg::after {
	content: "";
	position: absolute;
	top: 9%;
	right: 9%;
	bottom: 9%;
	left: 9%;
	box-sizing: border-box;
	border: max(1px, calc(1.5px * var(--ivb-k))) solid var(--ivb-ring, rgba(255, 255, 255, 0.25));
	border-radius: 50%;
}

.ivb-shape-starburst.ivb-has-ring .ivb-badge__bg::after {
	top: 19%;
	right: 19%;
	bottom: 19%;
	left: 19%;
}

.ivb-shape-rectangle.ivb-has-ring .ivb-badge__bg::after {
	top: calc(3px * var(--ivb-k));
	right: calc(3px * var(--ivb-k));
	bottom: calc(3px * var(--ivb-k));
	left: calc(3px * var(--ivb-k));
	border-radius: max(0px, calc((var(--ivb-r, 0px) - 3px) * var(--ivb-k)));
}

.ivb-has-shadow {
	filter: drop-shadow(0 calc(2px * var(--ivb-k)) calc(4px * var(--ivb-k)) rgba(0, 0, 0, 0.28));
}

/* Flatsome product cards: make sure the image box is the positioning context. */
.product-small .box-image {
	position: relative;
}

/* Elementor widget -------------------------------------------------------- */
.elementor-widget-ivb-product-badges.ivb-el-layout-overlay {
	position: absolute !important;
	top: var(--ivb-it, 0) !important;
	right: var(--ivb-ir, 0) !important;
	bottom: var(--ivb-ib, 0) !important;
	left: var(--ivb-il, 0) !important;
	z-index: var(--ivb-z, 10);
	width: auto !important;
	max-width: none !important;
	height: auto;
	margin: 0 !important;
	padding: 0;
	pointer-events: none;
}

.elementor-widget-ivb-product-badges.ivb-el-layout-overlay > .elementor-widget-container {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
	padding: 0;
}

.elementor-widget-ivb-product-badges.ivb-el-layout-overlay .ivb-badges {
	z-index: auto;
}

/* In the editor the badges must be clickable to select the widget. */
.elementor-editor-active .elementor-widget-ivb-product-badges .ivb-badge,
.elementor-editor-active .elementor-widget-ivb-product-badges .ivb-el-placeholder {
	pointer-events: auto;
	cursor: pointer;
}

.ivb-el-placeholder {
	display: inline-block;
	margin: 8px;
	padding: 6px 10px;
	border: 1px dashed rgba(0, 0, 0, 0.35);
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.85);
	color: #333;
	font-size: 12px;
	line-height: 1.4;
}
