/* ==========================================================================
   Novixa - Image Hotspot
   Loaded only on pages that contain the widget (see get_style_depends()).
   Every class is prefixed with `novixa-addons-image-hotspot`.
   Colours are CSS variables so the Style Preset and the Style-tab colour
   controls can both drive them (a control always wins over a preset:
   Elementor's {{WRAPPER}} selectors are more specific than the preset
   selectors below).
   ========================================================================== */

.novixa-addons-image-hotspot {
	/* --- marker --- */
	--novixa-hs-size: 30px;
	--novixa-hs-icon-size: 13px;
	--novixa-hs-bg: #2563eb;
	--novixa-hs-icon: #ffffff;
	--novixa-hs-border: #ffffff;
	--novixa-hs-bw: 2px;
	--novixa-hs-hover-bg: #1d4ed8;
	--novixa-hs-hover-icon: #ffffff;
	--novixa-hs-hover-border: #ffffff;
	--novixa-hs-hover-scale: 1.12;
	--novixa-hs-pulse: rgba(37, 99, 235, 0.55);
	--novixa-hs-speed: 2.2s;
	--novixa-hs-float: 4px;
	--novixa-hs-radius: 50%;
	/* --- tooltip --- */
	--novixa-tip-w: 260px;
	--novixa-tip-bg: #ffffff;
	--novixa-tip-border: rgba(15, 23, 42, 0.08);
	--novixa-tip-bw: 1px;
	--novixa-tip-title: #0f172a;
	--novixa-tip-text: #475569;
	--novixa-tip-link-bg: #2563eb;
	--novixa-tip-link-color: #ffffff;
	--novixa-tip-link-hover-bg: #1d4ed8;
	--novixa-tip-link-hover-color: #ffffff;
	--novixa-tip-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.35), 0 4px 10px rgba(15, 23, 42, 0.08);

	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* ---------- Presets ---------- */
.novixa-addons-image-hotspot--preset-luxury-gold .novixa-addons-image-hotspot {
	--novixa-hs-bg: #c9a45c;
	--novixa-hs-icon: #1a1408;
	--novixa-hs-border: #fff3d4;
	--novixa-hs-hover-bg: #e0bd6f;
	--novixa-hs-hover-icon: #1a1408;
	--novixa-hs-hover-border: #ffffff;
	--novixa-hs-pulse: rgba(201, 164, 92, 0.6);
	--novixa-tip-bg: #14110b;
	--novixa-tip-border: rgba(201, 164, 92, 0.45);
	--novixa-tip-title: #e8c987;
	--novixa-tip-text: #d8cdb4;
	--novixa-tip-link-bg: #c9a45c;
	--novixa-tip-link-color: #1a1408;
	--novixa-tip-link-hover-bg: #e0bd6f;
	--novixa-tip-link-hover-color: #1a1408;
	--novixa-tip-shadow: 0 18px 44px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(201, 164, 92, 0.12);
}

.novixa-addons-image-hotspot--preset-minimal-light .novixa-addons-image-hotspot {
	--novixa-hs-bg: #ffffff;
	--novixa-hs-icon: #111111;
	--novixa-hs-border: #e5e7eb;
	--novixa-hs-hover-bg: #111111;
	--novixa-hs-hover-icon: #ffffff;
	--novixa-hs-hover-border: #111111;
	--novixa-hs-pulse: rgba(17, 17, 17, 0.28);
	--novixa-tip-bg: #ffffff;
	--novixa-tip-border: #e5e7eb;
	--novixa-tip-title: #111111;
	--novixa-tip-text: #555555;
	--novixa-tip-link-bg: #111111;
	--novixa-tip-link-color: #ffffff;
	--novixa-tip-link-hover-bg: #333333;
	--novixa-tip-link-hover-color: #ffffff;
	--novixa-tip-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.28);
}

.novixa-addons-image-hotspot--preset-dark-premium .novixa-addons-image-hotspot {
	--novixa-hs-bg: #0b0b0f;
	--novixa-hs-icon: #ffffff;
	--novixa-hs-border: rgba(255, 255, 255, 0.85);
	--novixa-hs-hover-bg: #ffffff;
	--novixa-hs-hover-icon: #0b0b0f;
	--novixa-hs-hover-border: #ffffff;
	--novixa-hs-pulse: rgba(255, 255, 255, 0.4);
	--novixa-tip-bg: #111218;
	--novixa-tip-border: rgba(255, 255, 255, 0.12);
	--novixa-tip-title: #ffffff;
	--novixa-tip-text: #b4b7c2;
	--novixa-tip-link-bg: #ffffff;
	--novixa-tip-link-color: #0b0b0f;
	--novixa-tip-link-hover-bg: #e5e7eb;
	--novixa-tip-link-hover-color: #0b0b0f;
	--novixa-tip-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.7);
}

/* ---------- Marker shapes ---------- */
.novixa-addons-image-hotspot--shape-circle  { --novixa-hs-radius: 50%; }
.novixa-addons-image-hotspot--shape-rounded { --novixa-hs-radius: 28%; }
.novixa-addons-image-hotspot--shape-square  { --novixa-hs-radius: 4px; }
.novixa-addons-image-hotspot--shape-diamond { --novixa-hs-radius: 14%; }

/* ---------- Image ---------- */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__stage {
	position: relative;
	display: block;
	width: 100%;
	/* Positions are % of this box, which hugs the image - that is what
	   keeps every hotspot on the same point of the picture at any size. */
	line-height: 0;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__media {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__media img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0;
}

/* ---------- Hotspot anchor (zero-size, positioned by left/top %) ---------- */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 2;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
	line-height: normal;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot:hover,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot:focus-within,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot.is-open {
	z-index: 6;
}

/* ---------- Marker (button / link) ---------- */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker:hover,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker:focus,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker:active {
	position: absolute;
	left: 0;
	top: 0;
	display: block;
	width: var(--novixa-hs-size);
	height: var(--novixa-hs-size);
	margin: calc(var(--novixa-hs-size) / -2) 0 0 calc(var(--novixa-hs-size) / -2);
	padding: 0;
	border: 0;
	border-radius: var(--novixa-hs-radius);
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

/* Invisible hit area so tiny markers are still a comfortable touch target. */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker::after {
	content: '';
	position: absolute;
	inset: min(0px, calc((var(--novixa-hs-size) - 44px) / 2));
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__core {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border: var(--novixa-hs-bw) solid var(--novixa-hs-border);
	border-radius: var(--novixa-hs-radius);
	background: var(--novixa-hs-bg);
	color: var(--novixa-hs-icon);
	font-size: var(--novixa-hs-icon-size);
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, scale 0.2s ease;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__glyph {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__glyph i {
	font-size: 1em;
	line-height: 1;
	color: inherit;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__glyph svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__dot {
	display: block;
	width: calc(var(--novixa-hs-size) * 0.3);
	height: calc(var(--novixa-hs-size) * 0.3);
	border-radius: 50%;
	background: currentColor;
}

/* Diamond: rotate the box, counter-rotate what is inside it. Uses the
   individual `rotate` / `scale` properties so hover scale never fights it. */
.novixa-addons-image-hotspot--shape-diamond .novixa-addons-image-hotspot__core,
.novixa-addons-image-hotspot--shape-diamond .novixa-addons-image-hotspot__ring {
	rotate: 45deg;
}

.novixa-addons-image-hotspot--shape-diamond .novixa-addons-image-hotspot__glyph {
	rotate: -45deg;
}

/* Hover / open / keyboard focus */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot:hover .novixa-addons-image-hotspot__core,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot.is-open .novixa-addons-image-hotspot__core,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker:focus-visible .novixa-addons-image-hotspot__core {
	background: var(--novixa-hs-hover-bg);
	color: var(--novixa-hs-hover-icon);
	border-color: var(--novixa-hs-hover-border);
	scale: var(--novixa-hs-hover-scale);
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker:focus-visible .novixa-addons-image-hotspot__core {
	outline: 2px solid var(--novixa-hs-pulse);
	outline-offset: 3px;
}

/* ---------- Marker animation (rings + floating) ---------- */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__ring {
	position: absolute;
	inset: 0;
	display: none;
	border-radius: var(--novixa-hs-radius);
	pointer-events: none;
	opacity: 0;
}

.novixa-addons-image-hotspot--anim-pulse .novixa-addons-image-hotspot__ring:not(.novixa-addons-image-hotspot__ring--two),
.novixa-addons-image-hotspot--anim-pulse-float .novixa-addons-image-hotspot__ring:not(.novixa-addons-image-hotspot__ring--two) {
	display: block;
	background: var(--novixa-hs-pulse);
	animation: novixa-hs-pulse var(--novixa-hs-speed) ease-out infinite;
}

.novixa-addons-image-hotspot--anim-ripple .novixa-addons-image-hotspot__ring,
.novixa-addons-image-hotspot--anim-ripple-float .novixa-addons-image-hotspot__ring {
	display: block;
	border: 2px solid var(--novixa-hs-pulse);
	box-sizing: border-box;
	animation: novixa-hs-ripple var(--novixa-hs-speed) ease-out infinite;
}

.novixa-addons-image-hotspot--anim-ripple .novixa-addons-image-hotspot__ring--two,
.novixa-addons-image-hotspot--anim-ripple-float .novixa-addons-image-hotspot__ring--two {
	animation-delay: calc(var(--novixa-hs-speed) / 2);
}

.novixa-addons-image-hotspot--anim-float .novixa-addons-image-hotspot__marker,
.novixa-addons-image-hotspot--anim-pulse-float .novixa-addons-image-hotspot__marker,
.novixa-addons-image-hotspot--anim-ripple-float .novixa-addons-image-hotspot__marker {
	animation: novixa-hs-float calc(var(--novixa-hs-speed) * 1.6) ease-in-out infinite;
}

/* Calm the marker once its tooltip is open. */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot.is-open .novixa-addons-image-hotspot__ring,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot.is-open .novixa-addons-image-hotspot__marker {
	animation: none;
}

@keyframes novixa-hs-pulse {
	0%   { transform: scale(1);   opacity: 0.7; }
	100% { transform: scale(2.4); opacity: 0; }
}

@keyframes novixa-hs-ripple {
	0%   { transform: scale(1);   opacity: 0.85; }
	100% { transform: scale(2.8); opacity: 0; }
}

@keyframes novixa-hs-float {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(calc(var(--novixa-hs-float) * -1)); }
}

/* ---------- Tooltip ---------- */
/* position:fixed + JS placement: the tooltip is never clipped by the image,
   the column or an overflow:hidden ancestor, and can be kept inside the
   viewport. */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip {
	--novixa-tx: 0px;
	--novixa-ty: 0px;
	--novixa-ts: 1;
	position: fixed;
	left: 0;
	top: 0;
	z-index: 99999;
	box-sizing: border-box;
	width: min(var(--novixa-tip-w), calc(100vw - 16px));
	max-width: calc(100vw - 16px);
	border: var(--novixa-tip-bw) solid var(--novixa-tip-border);
	border-radius: 12px;
	background: var(--novixa-tip-bg);
	box-shadow: var(--novixa-tip-shadow);
	color: var(--novixa-tip-text);
	font-size: 14px;
	line-height: 1.55;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translate(var(--novixa-tx), var(--novixa-ty)) scale(var(--novixa-ts));
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__spot.is-open .novixa-addons-image-hotspot__tip {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: none;
	transition-delay: 0s;
}

/* Hover bridge: keeps the tooltip open while the pointer crosses the gap. */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip::before {
	content: '';
	position: absolute;
	inset: -14px;
}

/* Entry animation direction (set from the placement JS picked). */
.novixa-addons-image-hotspot--tip-slide .novixa-addons-image-hotspot__tip[data-placement='top']    { --novixa-ty: 8px; }
.novixa-addons-image-hotspot--tip-slide .novixa-addons-image-hotspot__tip[data-placement='bottom'] { --novixa-ty: -8px; }
.novixa-addons-image-hotspot--tip-slide .novixa-addons-image-hotspot__tip[data-placement='left']   { --novixa-tx: 8px; }
.novixa-addons-image-hotspot--tip-slide .novixa-addons-image-hotspot__tip[data-placement='right']  { --novixa-tx: -8px; }
.novixa-addons-image-hotspot--tip-zoom .novixa-addons-image-hotspot__tip { --novixa-ts: 0.92; }
.novixa-addons-image-hotspot--tip-none .novixa-addons-image-hotspot__tip { transition: none; }

/* Arrow */
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip::after {
	content: '';
	position: absolute;
	width: 12px;
	height: 12px;
	box-sizing: border-box;
	background: var(--novixa-tip-bg);
	border: var(--novixa-tip-bw) solid var(--novixa-tip-border);
	transform: rotate(45deg);
}

.novixa-addons-image-hotspot--no-arrow .novixa-addons-image-hotspot__tip::after {
	display: none;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip[data-placement='top']::after {
	bottom: -7px;
	left: var(--novixa-ax, 50%);
	margin-left: -6px;
	border-top-color: transparent;
	border-left-color: transparent;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip[data-placement='bottom']::after {
	top: -7px;
	left: var(--novixa-ax, 50%);
	margin-left: -6px;
	border-bottom-color: transparent;
	border-right-color: transparent;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip[data-placement='left']::after {
	right: -7px;
	top: var(--novixa-ay, 50%);
	margin-top: -6px;
	border-bottom-color: transparent;
	border-left-color: transparent;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip[data-placement='right']::after {
	left: -7px;
	top: var(--novixa-ay, 50%);
	margin-top: -6px;
	border-top-color: transparent;
	border-right-color: transparent;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-inner {
	position: relative;
	z-index: 1;
	border-radius: inherit;
	overflow: auto;
	max-height: calc(100vh - 24px);
	scrollbar-width: thin;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-media {
	display: block;
	margin: 0;
	line-height: 0;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-media img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 140px;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-body {
	padding: 16px 18px;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-title {
	margin: 0 0 6px;
	padding: 0;
	color: var(--novixa-tip-title);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-title:last-child {
	margin-bottom: 0;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-desc {
	margin: 0;
	color: var(--novixa-tip-text);
	font-size: 14px;
	line-height: 1.55;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-desc p {
	margin: 0 0 0.6em;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-desc p:last-child {
	margin-bottom: 0;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-link,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-link:visited {
	display: inline-block;
	margin-top: 12px;
	padding: 8px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--novixa-tip-link-bg);
	color: var(--novixa-tip-link-color);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-link:hover,
.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-link:focus-visible {
	background: var(--novixa-tip-link-hover-bg);
	color: var(--novixa-tip-link-hover-color);
	text-decoration: none;
}

.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip-link:focus-visible {
	outline: 2px solid var(--novixa-tip-link-bg);
	outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */
@media ( prefers-reduced-motion: reduce ) {
	.novixa-addons-image-hotspot .novixa-addons-image-hotspot__ring,
	.novixa-addons-image-hotspot .novixa-addons-image-hotspot__marker {
		animation: none !important;
	}

	.novixa-addons-image-hotspot .novixa-addons-image-hotspot__tip,
	.novixa-addons-image-hotspot .novixa-addons-image-hotspot__core {
		transition: none !important;
	}
}
