/* ============================================================
   KudoBiz Marketing — banners
   Slots stay invisible until ads.js fills them (.is-filled).
   !important is used where themes restyle buttons/links/images.
   ============================================================ */

.kudobiz-ad-slot[hidden] { display: none !important; }

.kudobiz-ad-slot.is-filled {
	display: block;
	clear: both;
	margin: 28px auto;
	animation: kadFadeIn 0.4s ease both;
}

@keyframes kadFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.kad {
	max-width: 100%;
	margin: 0 auto;
	line-height: 1.3;
	text-align: center;
	box-sizing: border-box;
}
.kad *, .kad *::before, .kad *::after { box-sizing: border-box; }

/* ── Label + rotation progress ─────────────────────────────── */

.kad-head {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 auto 7px;
	min-height: 12px;
}

.kad-label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #94a3b8;
	line-height: 1;
}

.kad-nav {
	display: flex;
	align-items: center;
	gap: 4px;
}

/* One pill per advertiser; the active one fills while its seconds run */
.kad .kad-dot {
	position: relative;
	display: block !important;
	width: 22px !important;
	height: 4px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 4px !important;
	background: #e2e8f0 !important;
	box-shadow: none !important;
	overflow: visible;
	cursor: pointer;
	font-size: 0 !important;
	line-height: 0 !important;
	transition: background 0.2s ease;
}
.kad .kad-dot::before {          /* comfortable hit area around the thin pill */
	content: '';
	position: absolute;
	top: -10px; right: -2px; bottom: -10px; left: -2px;
}
.kad .kad-dot:hover { background: #cbd5e1 !important; }
.kad .kad-dot:focus-visible { outline: 2px solid #0891b2; outline-offset: 3px; }

.kad-dot-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 4px;
	background: #0891b2;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.2s linear;
}
.kad-dot:not(.is-active) .kad-dot-fill { transition: none; }

/* ── Stage: slides share one grid cell, so the slot never jumps ── */

.kad-stage {
	display: grid;
	max-width: var(--kad-dw, 100%);
	margin: 0 auto;
}

.kad-slide {
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.kad-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
	transition: opacity 0.5s ease;
}

.kad .kad-link {
	display: block;
	line-height: 0;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none !important;
	box-shadow: none !important;
}
.kad .kad-link:focus-visible { outline: 2px solid #0891b2; outline-offset: 3px; }

.kad picture { display: block; }
/* Fill the slot up to the format width, but never beyond the image's own pixels (--kad-iw) */
.kad-slide img {
	display: block;
	width: 100%;
	max-width: min(var(--kad-dw, 100%), var(--kad-iw, 100%));
	height: auto !important;
	margin: 0 auto;
	border-radius: 8px;
}

@media (max-width: 767px) {
	.kad-stage { max-width: 100%; }
	.kad-slide img { max-width: min(100%, var(--kad-iw, 100%)); }
	.kad-slide.has-mobile img { max-width: var(--kad-mw, 100%); }
}

/* ── HTML5 (sandboxed iframe, scaled by ads.js) ────────────── */

.kad-html5 {
	position: relative;
	overflow: hidden;
	margin: 0 auto;
	border-radius: 8px;
	max-width: 100%;
}
.kad-html5 iframe {
	display: block;
	border: 0;
	max-width: none !important;
	transform-origin: 0 0;
}
@media (max-width: 767px) { .kad-html5--desktop { display: none; } }
@media (min-width: 768px) { .kad-html5--mobile  { display: none; } }

/* ── Placement: top of the site ─────────────────────────────── */

.kudobiz-ad-slot--site_top.is-filled {
	margin: 0;
	padding: 10px 12px 12px;
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7;
}

/* ── Placement: inside articles ─────────────────────────────── */

.kudobiz-ad-slot--in-article.is-filled {
	margin: 30px auto;
	padding: 14px 0 16px;
	border-top: 1px solid #eef2f7;
	border-bottom: 1px solid #eef2f7;
}

/* ── Placement: listing sidebar ─────────────────────────────── */

.kudobiz-ad-slot--listing_sidebar.is-filled { margin: 18px auto 0; }

/* ── Placement: side banners (ads.js sets left/top/width) ──── */

.kudobiz-ad-slot--rail.is-filled {
	display: none;          /* until ads.js finds enough room beside the content */
	position: fixed;
	z-index: 40;
	top: 0;
	left: 0;
	width: 160px;
	margin: 0;
	animation: none;
}
.kudobiz-ad-slot--rail.is-filled.is-placed {
	display: block;
	animation: kadFadeIn 0.4s ease both;
}
.kudobiz-ad-slot--rail .kad-head { flex-direction: column; gap: 5px; margin-bottom: 6px; }
.kudobiz-ad-slot--rail .kad-stage { max-width: 100%; }
@media (max-width: 1023px) {
	.kudobiz-ad-slot--rail { display: none !important; }
}

/* ── Placement: sticky bottom bar ───────────────────────────── */

.kudobiz-ad-slot--sticky_bottom.is-filled {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	margin: 0;
	padding: 6px 44px 6px 12px;
	padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
	background: rgba(255, 255, 255, 0.97);
	border-top: 1px solid #e2e8f0;
	box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.14);
	animation: kadSlideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes kadSlideUp {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}
.kudobiz-ad-slot--sticky_bottom .kad-head { margin-bottom: 4px; }
.kudobiz-ad-slot--sticky_bottom .kad-label { font-size: 9px; }

.kudobiz-ad-slot .kad-close {
	position: absolute !important;
	top: 50% !important;
	right: 8px !important;
	transform: translateY(-50%);
	width: 30px !important;
	height: 30px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #f1f5f9 !important;
	color: #475569 !important;
	font-size: 20px !important;
	line-height: 30px !important;
	text-align: center;
	cursor: pointer;
	box-shadow: none !important;
}
.kudobiz-ad-slot .kad-close:hover { background: #e2e8f0 !important; color: #0f172a !important; }

html.kad-has-sticky body { padding-bottom: var(--kad-sticky-h, 72px); }

/* ── Native card (in-feed, looks like a listing card) ───────── */

.kudobiz-ad-slot--infeed.is-filled {
	display: flex;
	margin: 0;
	min-width: 0;
}
.kudobiz-ad-slot--infeed .kad,
.kad--native {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	text-align: left;
}
.kad--native .kad-stage {
	flex: 1;
	width: 100%;
	max-width: none;
}
.kad--native .kad-slide { align-items: stretch; }

/* Placed by shortcode outside a listing grid: keep it card-sized instead of full width */
.kudobiz-ad-slot:not(.kudobiz-ad-slot--infeed) > .kad--native { max-width: 420px; }

/* Label lives inside the card ("Sponsorizuar"); only the progress pills float on the image */
.kad--native .kad-head {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	margin: 0;
	padding: 5px 7px;
	border-radius: 20px;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(4px);
}
.kad--native:not(.kad--rotating) .kad-head { display: none; }
.kad--native .kad-label { display: none; }
.kad--native .kad-dot { background: rgba(255, 255, 255, 0.4) !important; width: 16px !important; }
.kad--native .kad-dot-fill { background: #fff; }

.kad .kad-native {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #fff;
	border: 1.5px solid #eef2f7;
	border-radius: 16px;
	overflow: hidden;
	color: inherit !important;
	text-decoration: none !important;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05), 0 4px 18px rgba(15, 23, 42, 0.06);
	transition: box-shadow 0.25s ease, transform 0.22s ease, border-color 0.22s ease;
}
.kad .kad-native:hover {
	transform: translateY(-3px);
	border-color: rgba(8, 145, 178, 0.25);
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 14px 40px rgba(8, 145, 178, 0.14);
}
.kad .kad-native:focus-visible { outline: 2px solid #0891b2; outline-offset: 3px; }

.kad-native-media {
	display: block;
	aspect-ratio: 1200 / 628;
	background: #f1f5f9;
	overflow: hidden;
}
.kad-native-media picture { height: 100%; }
.kad-native-media img {
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	object-fit: cover;
	border-radius: 0;
}

.kad-native-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px 18px;
}
.kad-native-sponsor {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
}
.kad-native-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #0f172a;
}
.kad-native-text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.5;
	color: #64748b;
}
.kad-native-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	padding-top: 10px;
	font-size: 13px;
	font-weight: 700;
	color: #0e7490;
}
.kad-native-cta svg { transition: transform 0.2s ease; }
.kad-native:hover .kad-native-cta svg { transform: translateX(4px); }

/* ── Elementor editor: show where a shortcode slot sits ─────── */

.kudobiz-ad-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 90px;
	margin: 16px auto;
	padding: 16px;
	border: 2px dashed #94a3b8;
	border-radius: 10px;
	background: #f8fafc;
	color: #475569;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
}

/* ── Accessibility / print ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.kudobiz-ad-slot.is-filled,
	.kudobiz-ad-slot--sticky_bottom.is-filled { animation: none; }
	.kad-slide, .kad-slide.is-active, .kad .kad-native, .kad-native-cta svg { transition: none; }
}

@media print {
	.kudobiz-ad-slot { display: none !important; }
	html.kad-has-sticky body { padding-bottom: 0; }
}
