.sgad-root {
	--sgad-z: 9999;
}

.sgad-position,
.sgad-position *,
.sgad-position *::before,
.sgad-position *::after {
	box-sizing: border-box;
}

.sgad-position {
	position: fixed;
	z-index: var(--sgad-z);
	font-family: inherit;
	line-height: 1.45;
	opacity: 0;
	transition: opacity .3s ease;
}

.sgad-position.is-visible {
	opacity: 1;
}

.sgad-position[hidden],
.sgad-unit[hidden],
.sgad-overlay[hidden] {
	display: none !important;
}

.sgad-box {
	position: relative;
	transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}

.sgad-position.is-visible .sgad-box {
	transform: none;
}

.sgad-anim-slide .sgad-box {
	transform: translateY(22px);
}

.sgad-anim-zoom .sgad-box {
	transform: scale(.9);
}

.sgad-anim-none,
.sgad-anim-none .sgad-box {
	transition: none;
}

.sgad-close {
	position: absolute;
	top: -12px;
	right: -12px;
	z-index: 3;
	width: 28px;
	height: 28px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(16, 26, 48, .85);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(10, 20, 40, .3);
	transition: background .2s ease, box-shadow .2s ease;
}

.sgad-close svg {
	display: block;
	width: 13px;
	height: 13px;
	transition: transform .25s ease;
}

.sgad-close:hover,
.sgad-close:focus {
	background: rgba(16, 26, 48, .92);
	box-shadow: 0 6px 18px rgba(10, 20, 40, .38);
}

.sgad-close:hover svg {
	transform: rotate(90deg);
}

.sgad-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.sgad-units {
	position: relative;
}

.sgad-unit {
	position: relative;
	width: min(var(--sgad-w), var(--sgad-mobile-w));
	max-width: 100%;
	height: var(--sgad-h);
	overflow: hidden;
	border-radius: 14px;
	background: var(--sgad-bg, #fff);
	color: var(--sgad-fg, #333);
	box-shadow: 0 16px 45px rgba(15, 28, 60, .22), 0 2px 8px rgba(15, 28, 60, .1);
	transition: box-shadow .3s ease;
}

.sgad-box:hover .sgad-unit {
	box-shadow: 0 22px 58px rgba(15, 28, 60, .32);
}

.sgad-unit--auto {
	height: auto;
	aspect-ratio: var(--sgad-ar);
}

.sgad-link {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.sgad-link:focus,
.sgad-link:hover {
	color: inherit;
	text-decoration: none;
}

.sgad-link img {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.sgad-link:focus-visible {
	outline: 2px solid #4c9aff;
	outline-offset: -2px;
}

.sgad-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	padding: 2px 7px;
	border-radius: 3px;
	background: rgba(10, 18, 38, .68);
	color: #fff;
	font-size: 10px;
	line-height: 1.6;
	letter-spacing: .04em;
	pointer-events: none;
}

.sgad-text {
	width: 100%;
	height: 100%;
	padding: 16px 26px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 7px;
	text-align: center;
	overflow: hidden;
}

.sgad-text-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .01em;
}

.sgad-text-desc {
	font-size: 14px;
	opacity: .82;
}

.sgad-text-desc p {
	margin: 0;
}

.sgad-text-btn {
	display: inline-block;
	margin-top: 2px;
	padding: 7px 16px;
	border-radius: 3px;
	background: var(--sgad-fg, #333);
	color: var(--sgad-bg, #fff);
	font-size: 13px;
	font-weight: 600;
}

.sgad-box:hover .sgad-text-btn {
	opacity: .88;
}

.sgad-placeholder {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
	color: #fff;
}

.sgad-placeholder-bg {
	position: absolute;
	inset: 0;
}

.sgad-placeholder-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	padding: 8px 16px;
	text-align: center;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}

.sgad-placeholder-icon {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, .48);
	border-radius: 4px;
	background: rgba(255, 255, 255, .13);
}

.sgad-placeholder-icon svg {
	width: 20px;
	height: 20px;
}

.sgad-placeholder-title {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.2;
}

.sgad-placeholder-sub {
	font-size: 11px;
	letter-spacing: .22em;
	opacity: .82;
}

.sgad-unit--slim .sgad-placeholder-icon,
.sgad-unit--slim .sgad-placeholder-sub {
	display: none;
}

.sgad-unit--slim .sgad-placeholder-inner {
	gap: 0;
	padding: 4px 12px;
}

.sgad-unit--slim .sgad-placeholder-title {
	font-size: clamp(14px, 2.2vw, 20px);
	letter-spacing: .12em;
}

.sgad-position--bottom {
	width: auto;
	width: max-content;
	max-width: 100%;
	bottom: calc(var(--sgad-offset, 0px) + var(--sgad-nav-offset, 0px) + env(safe-area-inset-bottom, 0px));
}

.sgad-position--float {
	top: 0;
	left: 0;
	will-change: transform;
}

.sgad-position--popup {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-bottom: var(--sgad-nav-offset, 0px);
}

.sgad-overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: var(--sgad-overlay-bg, rgba(0, 0, 0, .6));
}

.sgad-position--popup .sgad-box {
	z-index: 1;
	max-width: 100%;
}

.sgad-position--popup .sgad-unit {
	box-shadow: 0 30px 80px rgba(0, 0, 0, .38);
}

@media (prefers-reduced-motion: reduce) {
	.sgad-position,
	.sgad-box,
	.sgad-text-btn,
	.sgad-close svg {
		transition: none;
	}
}
