/* ==========================================================================
   Херо-слайдер: 4 сцени една върху друга, S-линия при смяна, навигация
   ========================================================================== */

.nd-hs {
	--hs-ui: 104px;           /* място за навигацията под съдържанието */
	--hs-dur: 10s;            /* колко стои всяка сцена */
	position: relative; isolation: isolate; overflow: hidden;
	touch-action: pan-y;
	background: var(--paper);
}
.nd-hs__track { display: grid; }
.nd-hs__slide { grid-area: 1 / 1; position: relative; min-width: 0; visibility: hidden; z-index: 0; }
.nd-hs__slide.is-active { visibility: visible; z-index: 2; }
.nd-hs__slide.is-leaving { visibility: visible; z-index: 1; }
.nd-hs__slide.is-leaving > .nd-scene { filter: brightness(.78) saturate(.9); transition: filter 1.4s var(--ease-io); }

/* общото за всяка сцена */
.nd-scene {
	position: relative; isolation: isolate; overflow: hidden;
	display: flex; align-items: center; height: 100%;
	min-height: calc(100svh - var(--topbar-h) - var(--bar-h));
	padding: clamp(28px, 4vh, 56px) 0 var(--hs-ui);
	transform-origin: 50% 40%;
}
.nd-scene > .nd-wrap { width: 100%; }

/* златната S-линия, която минава при смяна */
.nd-hs__seam { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; opacity: 0; overflow: visible; }
.nd-hs.is-moving .nd-hs__seam { opacity: 1; }
.nd-hs__seam path { fill: none; stroke: url(#ndHsGold); }
.nd-hs__seam-line { stroke-width: 2; }
.nd-hs__seam-glow { stroke-width: 14; opacity: .35; filter: blur(8px); }

/* --- навигацията --- */
.nd-hs__ui {
	position: absolute; left: 0; right: 0; bottom: clamp(22px, 3.4vh, 40px); z-index: 5;
	display: flex; align-items: center; gap: clamp(16px, 2vw, 28px);
	color: var(--ink); pointer-events: none;
	transition: color .8s var(--ease);
}
.nd-hs__ui > * { pointer-events: auto; }
.nd-hs[data-tone="dark"] .nd-hs__ui { color: #f3efe4; }

.nd-hs__arrows { display: flex; gap: 8px; }
.nd-hs__arrow, .nd-hs__pause {
	display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(255, 253, 248, .82); color: inherit; font-size: 1.15rem; cursor: pointer;
	box-shadow: inset 0 0 0 1px rgba(19, 35, 28, .14);
	transition: background-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease), color .35s;
}
.nd-hs[data-tone="dark"] .nd-hs__arrow, .nd-hs[data-tone="dark"] .nd-hs__pause { background: rgba(12, 24, 19, .55); box-shadow: inset 0 0 0 1px rgba(230, 203, 140, .32); }
.nd-hs__arrow:hover, .nd-hs__pause:hover { background: var(--jade-800); color: var(--gold-300); box-shadow: inset 0 0 0 1px var(--jade-800); }
.nd-hs[data-tone="dark"] .nd-hs__arrow:hover, .nd-hs[data-tone="dark"] .nd-hs__pause:hover { background: var(--gold-300); color: var(--jade-950); }
.nd-hs__arrow--prev .nd-i { transform: scaleX(-1); }
.nd-hs__arrow:active { transform: scale(.94); }

.nd-hs__tabs { display: flex; gap: clamp(14px, 1.8vw, 26px); }
.nd-hs__tab {
	display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; row-gap: 9px;
	min-width: 0; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
	font-size: .84rem; line-height: 1.2;
}
.nd-hs__bar { grid-column: 1 / -1; position: relative; display: block; height: 2px; width: clamp(64px, 6vw, 96px); border-radius: 2px; background: currentColor; opacity: .22; overflow: hidden; transition: opacity .35s; }
.nd-hs__tab.is-on .nd-hs__bar, .nd-hs__tab:hover .nd-hs__bar { opacity: 1; background: rgba(127, 127, 127, .3); }
.nd-hs__bar i { position: absolute; inset: 0; background: var(--gold-grad); transform: scaleX(0); transform-origin: 0 50%; }
.nd-hs__tab.is-on .nd-hs__bar i { animation: hsProgress var(--hs-dur) linear forwards; }
.nd-hs.is-paused .nd-hs__bar i, .nd-hs.is-hover .nd-hs__bar i, .nd-hs.is-hidden .nd-hs__bar i { animation-play-state: paused; }
.nd-hs.is-still .nd-hs__tab.is-on .nd-hs__bar i { animation: none; transform: scaleX(1); }
@keyframes hsProgress { to { transform: scaleX(1); } }
.nd-hs__num { font-size: .72rem; font-weight: 600; letter-spacing: .06em; opacity: .55; font-variant-numeric: tabular-nums; }
.nd-hs__lbl { font-weight: 480; opacity: .62; white-space: nowrap; transition: opacity .35s; }
.nd-hs__tab.is-on .nd-hs__lbl, .nd-hs__tab:hover .nd-hs__lbl { opacity: 1; }
.nd-hs__tab.is-on .nd-hs__num { opacity: 1; color: var(--gold-600); }
.nd-hs[data-tone="dark"] .nd-hs__tab.is-on .nd-hs__num { color: var(--gold-300); }
.nd-hs__tab:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 6px; border-radius: 4px; }

.nd-hs__pause { width: 38px; height: 38px; font-size: 1.2rem; }
.nd-hs__pi { display: grid; place-items: center; }
.nd-hs__pi--play, .nd-hs.is-paused .nd-hs__pi--pause, .nd-hs.is-still .nd-hs__pi--pause { display: none; }
.nd-hs.is-paused .nd-hs__pi--play, .nd-hs.is-still .nd-hs__pi--play { display: grid; }

/* --- предимствата под слайдера --- */
.nd-benefits { position: relative; z-index: 1; background: #fbf8f1; border-bottom: 1px solid var(--line); }
.nd-benefits__in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: clamp(22px, 3vw, 34px); }
.nd-benefits li {
	display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 18px;
	border-left: 1px solid var(--line); font-size: 1rem; line-height: 1.3; color: var(--ink);
}
.nd-benefits li:first-child { border-left: 0; }
.nd-benefits__ic {
	display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #fffdf6, #f3e9d2); color: var(--gold-700); font-size: 1.6rem;
	box-shadow: inset 0 0 0 1px rgba(173, 129, 48, .38), 0 6px 16px -10px rgba(122, 87, 24, .6);
	transition: transform .5s var(--ease);
}
.nd-benefits li:hover .nd-benefits__ic { transform: translateY(-3px) rotate(-6deg); }
.nd-anim .nd-benefits li[data-reveal].is-in { transition-delay: calc(var(--i) * 90ms); }

/* --- отзивчивост --- */
@media (max-width: 1240px) {
	.nd-hs__lbl { font-size: .8rem; }
	.nd-hs__bar { width: 56px; }
	.nd-benefits li { flex-direction: column; text-align: center; gap: 10px; }
}
@media (max-width: 1100px) {
	.nd-hs { --hs-ui: 96px; }
	.nd-hs__ui { justify-content: center; }
}
@media (max-width: 760px) {
	.nd-hs { --hs-ui: 84px; }
	.nd-hs__ui { gap: 10px; bottom: 18px; }
	.nd-hs__arrow { width: 40px; height: 40px; }
	.nd-hs__arrows { display: contents; }
	.nd-hs__arrow--prev { order: -1; }
	.nd-hs__tabs { gap: 8px; align-items: center; }
	.nd-hs__tab { display: block; }
	.nd-hs__bar { width: 26px; height: 3px; }
	.nd-hs__tab.is-on .nd-hs__bar { width: 54px; }
	.nd-hs__num, .nd-hs__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
	.nd-hs__pause { position: absolute; right: 16px; width: 34px; height: 34px; }
	.nd-benefits__in { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
	.nd-benefits li { padding: 0 10px; font-size: .92rem; }
	.nd-benefits li:nth-child(3) { border-left: 0; }
	.nd-benefits__ic { width: 50px; height: 50px; font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
	.nd-hs__slide.is-leaving > .nd-scene { filter: none; transition: none; }
}
