/* Telestar Katalog 1.0.1 */
.tsk {
	--tsk-blue: #186CAC;
	--tsk-red: #CD1D30;
	--tsk-ink: #1d2433;
	--tsk-muted: #5f6b7d;
	--tsk-bg: #eef2f6;
	--tsk-line: #dfe4ea;
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: var(--tsk-h, 85vh);
	min-height: 460px;
	background: var(--tsk-bg);
	color: var(--tsk-ink);
	font-family: Poppins, Roboto, -apple-system, "Segoe UI", sans-serif;
	overflow: hidden;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}
.tsk *, .tsk-zoom * { box-sizing: border-box; }
.tsk button, .tsk-zoom button { font: inherit; }

/* Gornja traka */
.tsk-bar {
	position: relative;
	z-index: 5;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	height: 60px;
	padding: 0 16px;
	background: #fff;
}
.tsk-title {
	flex: 1 1 0;
	min-width: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--tsk-blue);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tsk .tsk-count {
	flex: 0 0 auto;
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--tsk-ink);
	font-size: 16px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 4px;
	cursor: pointer;
	white-space: nowrap;
}
.tsk .tsk-count:hover { background: var(--tsk-bg); }
.tsk-count span { color: var(--tsk-blue); font-weight: 600; }
.tsk-tools {
	flex: 1 1 0;
	display: flex;
	justify-content: flex-end;
	gap: 2px;
}
.tsk .tsk-btn, .tsk-zoom .tsk-btn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 64px;
	height: 52px;
	margin: 0;
	padding: 4px 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--tsk-ink);
	font-size: 12px;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.tsk .tsk-btn:hover, .tsk-zoom .tsk-btn:hover { background: var(--tsk-bg); color: var(--tsk-blue); }
.tsk-btn svg, .tsk-nav svg, .tsk-x svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Traka napretka */
.tsk-progress {
	flex: 0 0 auto;
	height: 4px;
	background: var(--tsk-line);
}
.tsk-progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--tsk-blue);
	transition: width .4s ease;
}

/* Knjiga */
.tsk-stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px 84px;
}
.tsk-book-wrap {
	position: relative;
	flex: 0 0 auto;
	max-width: 100%;
	transition: transform .7s cubic-bezier(.4, 0, .2, 1);
}
/* Naslovnica (desna polovina) i zadnja stranica (lijeva) pomaknute u sredinu */
.tsk-at-start .tsk-book-wrap { transform: translateX(-25%); }
.tsk-at-end .tsk-book-wrap { transform: translateX(25%); }
.tsk-book-wrap::before {
	content: "";
	position: absolute;
	inset: 2% 1% -1%;
	box-shadow: 0 12px 34px rgba(20, 35, 60, .22);
	pointer-events: none;
}
.tsk-at-start .tsk-book-wrap::before { left: 50%; }
.tsk-at-end .tsk-book-wrap::before { right: 50%; }
.tsk-portrait .tsk-book-wrap::before { left: 1%; right: 1%; }
.tsk-page { background: #fff; }
/* Pregib u sredini */
.tsk-page-in::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 1;
	width: 7%;
	pointer-events: none;
}
.tsk-page-l .tsk-page-in::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0)); }
.tsk-page-r .tsk-page-in::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .13), rgba(0, 0, 0, 0)); }
.tsk-portrait .tsk-page-in::after, .tsk-page[data-density="hard"] .tsk-page-in::after { display: none; }
.tsk-page-in {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #fff linear-gradient(110deg, #f3f5f8 30%, #fafbfc 50%, #f3f5f8 70%) 0 0 / 300% 100%;
	animation: tsk-shine 1.4s linear infinite;
}
.tsk-page-in.tsk-loaded { animation: none; background: #fff; }
.tsk-page-in img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}
@keyframes tsk-shine { to { background-position: -150% 0; } }

/* Klikabilni proizvodi */
.tsk-hot {
	position: absolute;
	z-index: 2;
	display: block;
	border-radius: 4px;
	cursor: pointer;
	transition: background .15s, box-shadow .15s;
}
.tsk-hot:hover, .tsk-hot:focus-visible {
	background: rgba(24, 108, 172, .12);
	box-shadow: 0 0 0 2px var(--tsk-blue, #186CAC);
	outline: none;
}
.tsk-hot span {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 6px);
	transform: translateX(-50%);
	padding: 5px 10px;
	border-radius: 6px;
	background: var(--tsk-blue, #186CAC);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s;
}
.tsk-hot:hover span { opacity: 1; }

/* Strelice */
.tsk .tsk-nav, .tsk-zoom .tsk-nav {
	position: absolute;
	top: 50%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 64px;
	margin: -32px 0 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: #fff;
	color: var(--tsk-blue, #186CAC);
	box-shadow: 0 2px 10px rgba(20, 35, 60, .14);
	cursor: pointer;
	transition: background .15s, color .15s, opacity .2s;
}
.tsk-nav svg { width: 28px; height: 28px; stroke-width: 2; }
.tsk .tsk-nav:hover, .tsk-zoom .tsk-nav:hover { background: var(--tsk-blue, #186CAC); color: #fff; }
.tsk .tsk-nav:disabled, .tsk-zoom .tsk-nav:disabled { opacity: 0; pointer-events: none; }
.tsk-prev { left: 16px; }
.tsk-next { right: 16px; }

/* Sve stranice */
.tsk-grid {
	position: absolute;
	inset: 64px 0 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	background: rgba(238, 242, 246, .98);
	animation: tsk-in .2s ease;
}
.tsk-grid-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	font-size: 16px;
}
.tsk .tsk-x {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--tsk-ink);
	cursor: pointer;
}
.tsk .tsk-x:hover { color: var(--tsk-red); }
.tsk-grid-list {
	flex: 1 1 auto;
	overflow-y: auto;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 22px 18px;
	padding: 4px 20px 24px;
	align-content: start;
}
.tsk .tsk-thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--tsk-muted);
	font-size: 13px;
	cursor: pointer;
}
.tsk-thumb-img {
	display: flex;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1.4;
	border: 3px solid transparent;
	border-radius: 4px;
	transition: border-color .15s;
}
.tsk-thumb-img img {
	display: block;
	height: 100%;
	width: auto;
	max-width: 50%;
	object-fit: contain;
	background: #fff;
	box-shadow: 0 2px 8px rgba(20, 35, 60, .14);
}
.tsk-portrait .tsk-thumb-img { aspect-ratio: .7; }
.tsk-portrait .tsk-thumb-img img { max-width: 100%; }
.tsk .tsk-thumb:hover .tsk-thumb-img { border-color: rgba(24, 108, 172, .4); }
.tsk .tsk-thumb.tsk-on .tsk-thumb-img { border-color: var(--tsk-blue); }
.tsk .tsk-thumb.tsk-on { color: var(--tsk-blue); font-weight: 600; }
@keyframes tsk-in { from { opacity: 0; transform: translateY(8px); } }

/* Cijeli zaslon */
.tsk[data-tsk-fit] {
	height: calc(100vh - var(--tsk-top, 0px));
	height: calc(100svh - var(--tsk-top, 0px));
}
.tsk:fullscreen { height: 100vh; height: 100dvh; }
.tsk:-webkit-full-screen { height: 100vh; }
.tsk.tsk-pseudo-full {
	position: fixed;
	inset: 0;
	z-index: 99999;
	height: 100vh;
	height: 100dvh;
}
html.tsk-noscroll, html.tsk-noscroll body { overflow: hidden; }

/* Uvećanje */
.tsk-zoom {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: rgba(22, 28, 38, .94);
	font-family: Poppins, Roboto, -apple-system, "Segoe UI", sans-serif;
	animation: tsk-fade .2s ease;
}
.tsk-zoom-bar {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 60px;
	padding: 0 12px;
	background: #fff;
	color: #1d2433;
}
.tsk-zoom-lvl { min-width: 52px; text-align: center; font-size: 14px; font-weight: 500; }
.tsk-zoom-sp { flex: 1; }
.tsk-zoom .tsk-btn { color: #1d2433; }
.tsk-zoom .tsk-btn:hover { background: #eef2f6; color: #186CAC; }
.tsk-zoom-area {
	flex: 1 1 auto;
	overflow: auto;
	cursor: grab;
	touch-action: pan-x pan-y pinch-zoom;
	-webkit-overflow-scrolling: touch;
}
.tsk-zoom-area.tsk-drag { cursor: grabbing; }
.tsk-zoom-area.tsk-drag .tsk-hot { pointer-events: none; }
.tsk-zoom-pages {
	display: flex;
	margin: 12px auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
.tsk-zpage { position: relative; flex: 1 1 0; height: 100%; background: #fff; }
.tsk-zpage img {
	display: block;
	width: 100%;
	height: 100%;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}
.tsk-zoom .tsk-nav { top: calc(50% + 30px); }
@keyframes tsk-fade { from { opacity: 0; } }

/* Tablet / mobitel */
@media (max-width: 900px) {
	.tsk-stage { padding: 14px 64px; }
	.tsk-prev { left: 8px; }
	.tsk-next { right: 8px; }
	.tsk .tsk-btn { min-width: 52px; }
}
@media (max-width: 640px) {
	.tsk { min-height: 420px; }
	.tsk-bar { height: 52px; padding: 0 6px 0 10px; gap: 4px; }
	.tsk-title { display: none; }
	.tsk .tsk-count { font-size: 15px; padding: 6px 4px; }
	.tsk-tools { flex: 0 0 auto; margin-left: auto; }
	.tsk-bar .tsk-btn span, .tsk-zoom-bar .tsk-btn span { display: none; }
	.tsk .tsk-btn, .tsk-zoom .tsk-btn { min-width: 42px; height: 44px; padding: 4px; }
	.tsk-grid { inset: 56px 0 0; }
	.tsk-grid-list { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; padding: 4px 12px 20px; }
	.tsk-stage { padding: 10px 10px; }
	.tsk .tsk-nav, .tsk-zoom .tsk-nav { width: 36px; height: 52px; margin-top: -26px; background: rgba(255, 255, 255, .88); }
	.tsk-prev { left: 4px; }
	.tsk-next { right: 4px; }
	.tsk-hot span { display: none; }
}
