/* ==========================================================================
   AFC PWA - ponuka inštalácie aplikácie (afc-pwa.js)
   .afc-pwa-bar--android : karta s tlačidlami Nainštalovať / Teraz nie (Chrome, Edge, Samsung)
   .afc-pwa-bar--ios     : panel v štýle iOS s postupom "Pridať na plochu" (Safari, iPhone / iPad)
   z-index nad chat okienkami (99990) a toastami (99991), pod ponukou notifikácií (99992) -
   naraz sa však nikdy neukážu obe ponuky (koordinuje JS).
   ========================================================================== */

.afc-pwa-bar {
	--kp-bg: #fff;
	--kp-text: #23282b;
	--kp-muted: #6b7579;
	--kp-line: #e5e9ea;
	--kp-soft: #eef1f2;
	--kp-teal: #0097b2;
	--kp-teal-dark: #007c93;
	--kp-orange: #ffbd59;

	position: fixed;
	left: 50%;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 99991;
	width: 420px;
	max-width: calc(100vw - 32px);
	padding: 16px;
	box-sizing: border-box;
	background: var(--kp-bg);
	border: 1px solid var(--kp-line);
	border-radius: 18px;
	box-shadow: 0 18px 44px rgba(20, 30, 32, .24), 0 2px 6px rgba(20, 30, 32, .08);
	color: var(--kp-text);
	font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	text-align: left;
	opacity: 0;
	transform: translate(-50%, 24px);
	transition: opacity .3s ease, transform .35s cubic-bezier(.2, .9, .3, 1.1);
	-webkit-font-smoothing: antialiased;
}
.afc-pwa-bar.is-in { opacity: 1; transform: translate(-50%, 0); }
.afc-pwa-bar *, .afc-pwa-bar *::before, .afc-pwa-bar *::after { box-sizing: border-box; }

.afc-pwa-head { display: flex; align-items: flex-start; gap: 12px; }
.afc-pwa-ico {
	flex: 0 0 52px;
	width: 52px !important;
	height: 52px !important;
	margin: 0 !important;
	border-radius: 12px; /* "squircle" ikony na ploche */
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.afc-pwa-text { flex: 1; min-width: 0; padding-top: 2px; font-size: 13px; line-height: 1.45; color: var(--kp-muted); }
.afc-pwa-text strong { display: block; margin: 0 0 3px; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--kp-text); }

html body .afc-pwa-x {
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	margin: -4px -4px 0 0 !important;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--kp-soft) !important;
	color: var(--kp-muted) !important;
	box-shadow: none !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.afc-pwa-x svg { width: 16px; height: 16px; fill: currentColor; }
html body .afc-pwa-x:hover { color: var(--kp-text) !important; }

/* ---------- Android / Chrome: tlačidlá ---------- */
.afc-pwa-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
html body .afc-pwa-acts button {
	min-height: 40px;
	margin: 0 !important;
	padding: 0 20px !important;
	border: 0 !important;
	border-radius: 20px !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	cursor: pointer;
	transition: background .2s ease;
	-webkit-tap-highlight-color: transparent;
}
html body .afc-pwa-no { background: var(--kp-soft) !important; color: var(--kp-text) !important; }
html body .afc-pwa-yes { background: var(--kp-teal) !important; color: #fff !important; }
html body .afc-pwa-yes:hover { background: var(--kp-teal-dark) !important; }
.afc-pwa-bar button:focus-visible { outline: 3px solid var(--kp-orange) !important; outline-offset: 2px; }

/* ---------- iOS: natívny vzhľad (SF Pro, rozmazané "materiálové" pozadie) ---------- */
.afc-pwa-bar--ios {
	--kp-bg: rgba(249, 249, 249, .9);
	--kp-text: #000;
	--kp-muted: rgba(60, 60, 67, .62);
	--kp-line: rgba(60, 60, 67, .14);
	--kp-soft: rgba(120, 120, 128, .14);
	--kp-blue: #007aff;

	width: 400px;
	padding: 18px 18px 14px;
	border: .5px solid var(--kp-line);
	border-radius: 22px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
	-webkit-backdrop-filter: saturate(180%) blur(22px);
	backdrop-filter: saturate(180%) blur(22px);
}
.afc-pwa-bar--ios .afc-pwa-text strong { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.afc-pwa-bar--ios .afc-pwa-text { font-size: 13px; letter-spacing: -.005em; }

.afc-pwa-steps {
	list-style: none !important;
	margin: 14px 0 0 !important;
	padding: 0 !important;
	border-top: .5px solid var(--kp-line);
}
.afc-pwa-step {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 46px;
	margin: 0 !important;
	padding: 8px 0 !important;
	border-bottom: .5px solid var(--kp-line);
	font-size: 15px;
	line-height: 1.35;
	letter-spacing: -.01em;
	color: var(--kp-text);
}
.afc-pwa-step::before, .afc-pwa-step::marker { content: none !important; }
.afc-pwa-step:last-child { border-bottom: 0; }
.afc-pwa-step b { font-weight: 600; }
.afc-pwa-num {
	flex: 0 0 24px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--kp-soft);
	font-size: 13px;
	font-weight: 600;
	color: var(--kp-muted);
}
.afc-pwa-step-text { flex: 1; min-width: 0; }
.afc-pwa-glyph { flex: 0 0 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--kp-blue); }
.afc-pwa-glyph svg { width: 26px; height: 26px; fill: currentColor; }

/* iPad: tlačidlo Zdieľať je vpravo hore -> panel vpravo hore. */
.afc-pwa-bar--ipad {
	left: auto;
	right: 20px;
	bottom: auto;
	top: calc(20px + env(safe-area-inset-top, 0px));
	transform: translateY(-24px);
}
.afc-pwa-bar--ipad.is-in { transform: none; }

@media (prefers-color-scheme: dark) {
	.afc-pwa-bar--ios {
		--kp-bg: rgba(30, 30, 32, .9);
		--kp-text: #fff;
		--kp-muted: rgba(235, 235, 245, .6);
		--kp-line: rgba(84, 84, 88, .65);
		--kp-soft: rgba(118, 118, 128, .24);
		--kp-blue: #0a84ff;
	}
	.afc-pwa-bar--android {
		--kp-bg: #23282b;
		--kp-text: #f2f4f5;
		--kp-muted: #aab4b7;
		--kp-line: #343b3e;
		--kp-soft: #30373a;
	}
}

/* Prehliadač bez backdrop-filter: nepriehľadné pozadie, aby bol text čitateľný. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.afc-pwa-bar--ios { --kp-bg: #f9f9f9; }
	@media (prefers-color-scheme: dark) { .afc-pwa-bar--ios { --kp-bg: #1e1e1e; } }
}

/* ---------- mobil ---------- */
@media (max-width: 600px) {
	.afc-pwa-bar {
		left: 8px;
		right: 8px;
		width: auto;
		max-width: none;
		bottom: calc(8px + env(safe-area-inset-bottom, 0px));
		transform: translateY(24px);
	}
	.afc-pwa-bar.is-in { transform: none; }
	.afc-pwa-bar--ios { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
	.afc-pwa-acts button { flex: 1; }
	/* Kým je ponuka otvorená, toasty a chat okienka ju neprekrývajú. */
	.afc-pwa-open .afc-ntoasts { bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 360px) {
	.afc-pwa-step { font-size: 14px; }
	.afc-pwa-ico { flex-basis: 44px; width: 44px !important; height: 44px !important; }
}

@media (prefers-reduced-motion: reduce) {
	.afc-pwa-bar { transition: opacity .2s ease; transform: translate(-50%, 0); }
	.afc-pwa-bar--ipad, .afc-pwa-bar--ipad.is-in { transform: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 600px) {
	.afc-pwa-bar, .afc-pwa-bar.is-in { transform: none; }
}

@media print { .afc-pwa-bar { display: none !important; } }

/* ---------- šípky Späť / Dopredu vedľa loga (afc-pwa.js, iba aplikácia, od 768 px) ---------- */
.afc-histnav { display: none; }
@media (min-width: 768px) {
	html:is(.afc-standalone, .afc-histnav-test) #Top_bar .afc-histnav {
		float: left;
		display: flex;
		align-items: center;
		gap: 6px;
		margin: 0 0 0 -16px;
		position: relative;
		z-index: 30;
	}
}
/* iPhone (aplikácia z plochy nemá systémové Späť): šípka Späť na mieste loga, kým je kam sa vrátiť. */
@media (max-width: 767px) {
	html.afc-histnav-ios.afc-histnav-can-back #Top_bar .top_bar_left > .logo { display: none !important; }
	html.afc-histnav-ios.afc-histnav-can-back #Top_bar .afc-histnav {
		float: left;
		display: flex;
		align-items: center;
		margin: 0 0 0 15px;
		position: relative;
		z-index: 30;
	}
	html.afc-histnav-ios #Top_bar .afc-histnav-fwd { display: none !important; }
	html.afc-histnav-ios body .afc-histnav-back { width: 32px !important; height: 32px !important; }
	html.afc-histnav-ios.afc-histnav-can-back #Top_bar .afc-histnav-back { animation: afc-histnav-in .32s cubic-bezier(.2, .9, .3, 1.15) both; }
}
@keyframes afc-histnav-in {
	from { opacity: 0; transform: translateX(8px) scale(.6); }
	to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	html.afc-histnav-ios #Top_bar .afc-histnav-back { animation: none !important; }
}
html body .afc-histnav-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 34px !important;
	height: 34px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #f0f2f5 !important;
	color: #1b1d1f !important;
	box-shadow: none !important;
	line-height: 1 !important;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
	-webkit-tap-highlight-color: transparent;
}
html body .afc-histnav-btn:hover { background: #e4e6e9 !important; }
html body .afc-histnav-btn:disabled { opacity: .4; cursor: default; background: #f0f2f5 !important; }
html body .afc-histnav-btn:focus-visible { outline: 3px solid #ffbd59 !important; outline-offset: 2px; }
.afc-histnav-btn svg { width: 20px; height: 20px; fill: currentColor; display: block; }
@media print { .afc-histnav { display: none !important; } }

/* ---------- nainštalovaná aplikácia ---------- */
.afc-standalone body {
	-webkit-tap-highlight-color: transparent;
}
