/* Dorin – Pojavno okno: frontend styles */

.ds-popup-root {
	--ds-popup-bg: #FBF8F3;
	--ds-popup-accent: #8A9A5B;
	--ds-popup-text: #2B2B26;
	--ds-popup-radius: 20px;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	visibility: hidden;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ds-popup-root.ds-popup--is-visible {
	visibility: visible;
	pointer-events: auto;
}

/* ---------- Backdrop (center layout) ---------- */
.ds-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 18, 14, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.ds-popup-root.ds-popup--is-visible .ds-popup__backdrop {
	opacity: 1;
}

/* ---------- Box ---------- */
.ds-popup__box {
	position: relative;
	background: var(--ds-popup-bg);
	color: var(--ds-popup-text);
	border-radius: var(--ds-popup-radius);
	box-shadow: 0 24px 60px -12px rgba(20, 18, 14, 0.35), 0 4px 16px rgba(20, 18, 14, 0.08);
	max-width: 460px;
	width: 92%;
	overflow: hidden;
	opacity: 0;
	transform: translateY(18px) scale(0.96);
	transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-popup-root.ds-popup--is-visible .ds-popup__box {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* Centered / modal layout */
.ds-popup--center {
	align-items: center;
	justify-content: center;
}

/* Corner / slide-in layout */
.ds-popup--corner {
	align-items: flex-end;
	justify-content: flex-end;
	padding: 24px;
}

.ds-popup--corner .ds-popup__box {
	max-width: 360px;
	transform: translateY(24px) scale(0.98);
}

.ds-popup--corner.ds-popup--is-visible .ds-popup__box {
	transform: translateY(0) scale(1);
}

/* ---------- Close button ---------- */
.ds-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: rgba(20, 18, 14, 0.06);
	color: var(--ds-popup-text);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
	z-index: 2;
}

.ds-popup__close:hover {
	background: rgba(20, 18, 14, 0.12);
	transform: rotate(90deg);
}

.ds-popup__close:focus-visible {
	outline: 2px solid var(--ds-popup-accent);
	outline-offset: 2px;
}

/* ---------- Media ---------- */
.ds-popup__media {
	width: 100%;
	line-height: 0;
	background: rgba(20, 18, 14, 0.04);
}

.ds-popup__media img {
	width: 100%;
	height: auto;
	max-height: 220px;
	object-fit: cover;
	display: block;
}

/* ---------- Content ---------- */
.ds-popup__content {
	padding: 32px 32px 30px;
	text-align: left;
}

.ds-popup__title {
	margin: 0 0 12px;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--ds-popup-text);
}

.ds-popup__text {
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--ds-popup-text);
	opacity: 0.85;
}

.ds-popup__text p:first-child {
	margin-top: 0;
}

.ds-popup__text p:last-child {
	margin-bottom: 0;
}

.ds-popup__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 22px;
	padding: 13px 28px;
	background: var(--ds-popup-accent);
	color: #fff;
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	border-radius: 999px;
	box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.ds-popup__button:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px -6px rgba(0, 0, 0, 0.4);
	filter: brightness(1.05);
	color: #fff;
}

.ds-popup__button:active {
	transform: translateY(0);
}

/* ---------- Body scroll lock helper ---------- */
body.ds-popup-lock {
	overflow: hidden;
}

/* ---------- Preview (in admin) ---------- */
.ds-popup-root.ds-popup--preview {
	position: fixed;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.ds-popup__box {
		max-width: 94%;
		border-radius: 16px;
	}

	.ds-popup--corner {
		padding: 14px;
	}

	.ds-popup--corner .ds-popup__box {
		max-width: 100%;
	}

	.ds-popup__content {
		padding: 26px 22px 24px;
	}

	.ds-popup__title {
		font-size: 21px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ds-popup__box,
	.ds-popup__backdrop {
		transition: none;
	}
}
