/* ------------------------------------------------------------------------ */
/* Kastor brand palette                                                       */
/*   --kastor-c-primary       main bright blue                                */
/*   --kastor-c-primary-alt   slightly desaturated alternative                */
/*   --kastor-c-dark          dark blue for headlines / strong text           */
/*   --kastor-c-darker        even darker for hover/active                    */
/*   --kastor-c-bg-light      neutral light gray for soft backgrounds         */
/* ------------------------------------------------------------------------ */

.kastor-machine-main,
.kastor-lightbox {
	--kastor-c-primary:     #38B6FF;
	--kastor-c-primary-alt: #33A7E2;
	--kastor-c-dark:        #216192;
	--kastor-c-darker:      #175585;
	--kastor-c-bg-light:    #F5F5F5;
}

.kastor-machine-main {
	max-width: 1200px;
	margin: 40px auto;
	padding: 0 20px;
}

/* ------------------------------------------------------------------------ */
/* Breadcrumbs                                                                */
/* ------------------------------------------------------------------------ */

.kastor-machine__breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	color: #777;
	margin-bottom: 18px;
}

.kastor-machine__breadcrumbs a {
	color: var(--kastor-c-dark);
	text-decoration: none;
	transition: color 0.15s ease;
}

.kastor-machine__breadcrumbs a:hover {
	color: var(--kastor-c-darker);
	text-decoration: underline;
}

.kastor-machine__breadcrumb-sep {
	color: #aaa;
	font-size: 0.9rem;
}

.kastor-machine__breadcrumb-current {
	color: #444;
	font-weight: 500;
}


/* ------------------------------------------------------------------------ */
/* Header (title) — full-width above the hero                                 */
/* ------------------------------------------------------------------------ */

.kastor-machine__header {
	margin-bottom: 24px;
}

.kastor-machine__title {
	margin: 0;
	font-size: clamp(1.8rem, 1rem + 2vw, 2.6rem);
	line-height: 1.2;
}


/* ------------------------------------------------------------------------ */
/* Hero — image left + (optional) body right (50/50)                          */
/* When the body column is absent (e.g. multi-model machine with no simple    */
/* params), the image alone is centered with a max-width so it doesn't fill   */
/* the whole content area.                                                    */
/* ------------------------------------------------------------------------ */

.kastor-machine__hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	margin-bottom: 40px;
}

.kastor-machine__hero:not(:has(.kastor-machine__body)) {
	grid-template-columns: minmax(0, 1fr);
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

@media (max-width: 800px) {
	.kastor-machine__hero {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

.kastor-machine__media {
	min-width: 0;
}

.kastor-machine__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

/* ------------------------------------------------------------------------ */
/* Short description (post content)                                            */
/* ------------------------------------------------------------------------ */

.kastor-machine__description {
	font-size: 1rem;
	line-height: 1.6;
	color: #444;
}

.kastor-machine__description > *:first-child {
	margin-top: 0;
}

.kastor-machine__description > *:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------------ */
/* Highlights — 2×N grid of "wow" specs (e.g. 200т/ч)                          */
/* ------------------------------------------------------------------------ */

.kastor-machine__highlights {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

@media (max-width: 480px) {
	.kastor-machine__highlights {
		grid-template-columns: 1fr;
	}
}

.kastor-machine__highlight {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px;
	background: var(--kastor-c-bg-light);
	border-left: 3px solid var(--kastor-c-primary);
	border-radius: 4px;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kastor-machine__highlight:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(33, 97, 146, 0.12);
}

.kastor-machine__highlight-value {
	font-size: 1.5rem;
	font-weight: 700;
	color: #000000c2;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.kastor-machine__highlight-label {
	font-size: 0.85rem;
	color: #555;
	line-height: 1.35;
}

/* ------------------------------------------------------------------------ */
/* Свържете се с нас CTA button                                                       */
/* ------------------------------------------------------------------------ */

.kastor-machine__ctas {
	align-self: flex-start;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.kastor-machine__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	background: var(--kastor-c-primary);
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	border: none;
	border-radius: 32px;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 2px 8px rgba(56, 182, 255, 0.25);
}

.kastor-machine__cta-phone {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;            /* matches .kastor-machine__cta */
	background: #d8d8d8;
	color: #333;
	text-decoration: none;
	border-radius: 32px;           /* matches .kastor-machine__cta */
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.kastor-machine__cta-phone:hover,
.kastor-machine__cta-phone:focus {
	background: #bfbfbf;
	color: #111;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kastor-machine__cta-phone:active {
	transform: translateY(0);
}

.kastor-machine__cta-phone svg {
	width: 24px;
	height: 24px;
}

.kastor-machine__cta:hover,
.kastor-machine__cta:focus {
	background: var(--kastor-c-dark);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(33, 97, 146, 0.30);
	text-decoration: none;
}

.kastor-machine__cta:active {
	background: var(--kastor-c-darker);
	transform: translateY(0);
}


/* ------------------------------------------------------------------------ */
/* Related machines strip                                                     */
/* ------------------------------------------------------------------------ */

.kastor-machine__related {
	margin-top: 60px;
	padding-top: 32px;
	border-top: 1px solid #e5e5e5;
}

.kastor-machine__related-title,
.kastor-machine__specs-heading {
	margin: 0 0 20px;
	font-size: 1.4rem;
	color: #000000c2;
	font-weight: 600;
}
/* 
.kastor-machine__specs-heading {
	margin: 0 0 20px;
	font-size: 1.4rem;
	color: #000000c2;
	font-weight: 600;
} */

.kastor-machine__related-grid {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

@media (max-width: 900px) {
	.kastor-machine__related-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.kastor-machine__related-grid {
		grid-template-columns: 1fr;
	}
}

.kastor-machine__related-card {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 6px;
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kastor-machine__related-card:hover {
	transform: translateY(-2px);
	border-color: var(--kastor-c-primary);
	box-shadow: 0 8px 20px rgba(33, 97, 146, 0.10);
}

.kastor-machine__related-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.kastor-machine__related-link:hover,
.kastor-machine__related-link:focus {
	text-decoration: none;
	color: inherit;
}

.kastor-machine__related-thumb {
	/* Matches the machine-photo standard of 1600x1800 (8:9). */
	aspect-ratio: 8 / 9;
	background: var(--kastor-c-bg-light);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.kastor-machine__related-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.kastor-machine__related-placeholder {
	color: #aaa;
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.kastor-machine__related-name {
	margin: 0;
	padding: 14px 16px;
	font-size: 0.95rem;
	font-weight: 600;
	color: #222;
	line-height: 1.35;
	transition: color 0.15s ease;
}

.kastor-machine__related-card:hover .kastor-machine__related-name {
	color: var(--kastor-c-dark);
}

/* ------------------------------------------------------------------------ */
/* Image / carousel                                                           */
/* ------------------------------------------------------------------------ */

.kastor-machine__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 2px 18px rgba(0, 0, 0, 0.06);
}

.kastor-machine__image--placeholder {
	/* Matches the machine-photo standard of 1600x1800 (8:9). */
	aspect-ratio: 8 / 9;
	background: #f1f1f1;
	color: #888;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.kastor-machine__lightbox-trigger {
	display: block;
	cursor: zoom-in;
	text-decoration: none;
}

.kastor-machine__lightbox-trigger:hover .kastor-machine__image {
	opacity: 0.95;
}

.kastor-machine__carousel {
	width: 100%;
}

.kastor-machine__swiper {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 18px rgba(0, 0, 0, 0.06);
	/* Matches the machine-photo standard of 1600x1800 (8:9). */
	aspect-ratio: 8 / 9;
}

.kastor-machine__swiper .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.kastor-machine__swiper .kastor-machine__lightbox-trigger {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
}

.kastor-machine__swiper .kastor-machine__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 0;
	box-shadow: none;
}

/* Thumbnail strip */

.kastor-machine__thumbs {
	margin-top: 10px;
}

.kastor-machine__thumbs .swiper-slide {
	width: 80px;
	height: 60px;
	opacity: 0.55;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
	background: #f1f1f1;
}

.kastor-machine__thumbs .swiper-slide:hover {
	opacity: 0.85;
}

.kastor-machine__thumbs .swiper-slide-thumb-active {
	opacity: 1;
	outline: 2px solid var(--kastor-c-primary);
	outline-offset: -2px;
}

.kastor-machine__thumb-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ------------------------------------------------------------------------ */
/* Specs section (full width, below the hero)                                 */
/* ------------------------------------------------------------------------ */

.kastor-machine__specs {
	margin-top: 8px;
}

.kastor-machine__specs--full,
.kastor-machine__long-desc {
	margin-top: 60px;
	padding-top: 32px;
	border-top: 1px solid #e5e5e5;
}

.kastor-machine__long-desc-body {
	font-size: 1rem;
	line-height: 1.7;
	color: #333;
}

.kastor-machine__long-desc-body p:first-child {
	margin-top: 0;
}

.kastor-machine__long-desc-body p:last-child {
	margin-bottom: 0;
}

.kastor-machine__long-desc-body ul,
.kastor-machine__long-desc-body ol {
	padding-left: 1.4em;
}

.kastor-machine__specs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.kastor-machine__specs-table tr {
	border-bottom: 1px solid #ececec;
}

.kastor-machine__specs-table tr:last-child {
	border-bottom: none;
}

.kastor-machine__specs-table th,
.kastor-machine__specs-table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
}

.kastor-machine__specs-table th {
	width: 40%;
	font-weight: 600;
	color: #555;
	background: #fafafa;
}

.kastor-machine__specs-table td {
	color: #1a1a1a;
}


/* ------------------------------------------------------------------------ */
/* Multi-model comparison table                                               */
/* ------------------------------------------------------------------------ */

.kastor-machine__specs-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Mobile-only scroll hint above the comparison table.                        */
/* The arrow nudges right to make the affordance obvious for older users.     */

.kastor-machine__specs-scroll-hint {
	display: none;
}

@media (max-width: 800px) {
	.kastor-machine__specs-scroll-hint {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		margin: 0 0 12px;
		padding: 8px 14px;
		background: var(--kastor-c-bg-light);
		border-radius: 6px;
		color: #444;
		font-size: 0.9rem;
		font-style: italic;
		line-height: 1.3;
	}

	.kastor-machine__specs-scroll-hint svg {
		flex-shrink: 0;
		color: var(--kastor-c-dark);
	}
}

@media (max-width: 800px) and (prefers-reduced-motion: no-preference) {
	@keyframes kastor-scroll-hint-nudge {
		0%, 100% { transform: translateX(0); }
		50%      { transform: translateX(6px); }
	}

	.kastor-machine__specs-scroll-hint svg {
		animation: kastor-scroll-hint-nudge 1.4s ease-in-out infinite;
	}
}

.kastor-machine__specs-comparison {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	background: #fff;
}

.kastor-machine__specs-comparison th,
.kastor-machine__specs-comparison td {
	border: 1px solid #e5e5e5;
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
}

.kastor-machine__specs-comparison thead th {
	background: var(--kastor-c-bg-light);
	color: #333;
	font-weight: 600;
	white-space: nowrap;
}

.kastor-machine__specs-comparison .kastor-machine__specs-model-col {
	text-align: center;
	background: var(--kastor-c-dark);
	color: #fff;
}

.kastor-machine__specs-comparison .kastor-machine__specs-unit-col {
	width: 80px;
	text-align: center;
}

.kastor-machine__specs-group {
	background: #fafafa;
	font-weight: 600;
	color: #444;
	vertical-align: middle;
	text-align: left;
}

.kastor-machine__specs-group--standalone {
	background: #fafafa;
	font-weight: 600;
}

.kastor-machine__specs-group--empty {
	background: transparent;
	border-right: none;
	padding: 0;
}

.kastor-machine__specs-label {
	font-weight: 500;
	color: #333;
}

.kastor-machine__specs-unit {
	text-align: center;
	color: #666;
	white-space: nowrap;
	width: 80px;
}

.kastor-machine__specs-value {
	text-align: center;
	font-variant-numeric: tabular-nums;
	color: #1a1a1a;
}

.kastor-machine__specs-comparison tr:nth-child(even) .kastor-machine__specs-value,
.kastor-machine__specs-comparison tr:nth-child(even) .kastor-machine__specs-label {
	background: #fcfcfc;
}

.kastor-machine__specs-note {
	margin-top: 12px;
	font-size: 0.85rem;
	color: #666;
	font-style: italic;
	line-height: 1.5;
}

@media (max-width: 600px) {
	.kastor-machine__specs-comparison th,
	.kastor-machine__specs-comparison td {
		padding: 6px 8px;
		font-size: 0.85rem;
	}
}


/* ------------------------------------------------------------------------ */
/* Lightbox                                                                   */
/* ------------------------------------------------------------------------ */

.kastor-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.kastor-lightbox.is-open {
	display: flex;
}

.kastor-lightbox__stage {
	flex: 1;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kastor-lightbox__img {
	max-width: 100%;
	max-height: calc(100vh - 80px);
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.kastor-lightbox__close,
.kastor-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: none;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.kastor-lightbox__close:hover,
.kastor-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: translateY(-50%) scale(1.05);
}

/* CSS-drawn chevrons — perfectly centered regardless of font glyph metrics. */

.kastor-lightbox__nav::before {
	content: '';
	display: block;
	width: 12px;
	height: 12px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.kastor-lightbox__nav--prev::before {
	transform: rotate(-135deg);
	margin-left: 4px; /* compensate for visual centering of rotated square */
}

.kastor-lightbox__nav--next::before {
	transform: rotate(45deg);
	margin-right: 4px;
}

/* CSS-drawn × for the close button */

.kastor-lightbox__close::before,
.kastor-lightbox__close::after {
	content: '';
	position: absolute;
	width: 22px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}

.kastor-lightbox__close::before { transform: rotate(45deg); }
.kastor-lightbox__close::after  { transform: rotate(-45deg); }

.kastor-lightbox__close {
	top: 20px;
	right: 20px;
	transform: none;
}

.kastor-lightbox__close:hover {
	transform: scale(1.05);
}

.kastor-lightbox__nav--prev {
	left: 20px;
}

.kastor-lightbox__nav--next {
	right: 20px;
}

.kastor-lightbox.is-single .kastor-lightbox__nav,
.kastor-lightbox.is-single .kastor-lightbox__counter {
	display: none;
}

.kastor-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.9rem;
	background: rgba(0, 0, 0, 0.4);
	padding: 4px 12px;
	border-radius: 12px;
}

@media (max-width: 600px) {
	.kastor-lightbox__close,
	.kastor-lightbox__nav {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}
	.kastor-lightbox__nav--prev { left: 8px; }
	.kastor-lightbox__nav--next { right: 8px; }
	.kastor-lightbox__close { top: 8px; right: 8px; }
}


/* ------------------------------------------------------------------------ */
/* Entrance animations                                                        */
/*   - Hero elements animate on page load (CSS animation)                     */
/*   - Below-fold sections animate when they enter the viewport (.is-revealed */
/*     toggled by animations.js via IntersectionObserver)                     */
/*   - All disabled when prefers-reduced-motion is set                        */
/* ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {

	@keyframes kastor-fade-up {
		from { opacity: 0; transform: translateY(20px); }
		to   { opacity: 1; transform: translateY(0); }
	}

	@keyframes kastor-slide-from-left {
		from { opacity: 0; transform: translateX(-40px); }
		to   { opacity: 1; transform: translateX(0); }
	}

	/* Hero — animates on page load with a small stagger */

	.kastor-machine__title {
		animation: kastor-fade-up 0.5s ease-out both;
	}

	.kastor-machine__media {
		animation: kastor-slide-from-left 0.6s 0.1s ease-out both;
	}

	.kastor-machine__body {
		animation: kastor-slide-from-left 0.6s 0.25s ease-out both;
	}

	/* Scroll-revealed sections — initial hidden state */

	[data-kastor-reveal] {
		opacity: 0;
		transition: opacity 0.6s ease-out, transform 0.6s ease-out;
		will-change: opacity, transform;
	}

	[data-kastor-reveal="from-right"] {
		transform: translateX(40px);
	}

	[data-kastor-reveal="up"] {
		transform: translateY(30px);
	}

	[data-kastor-reveal].is-revealed {
		opacity: 1;
		transform: translate(0, 0);
	}

	/* Related-machine cards stagger on reveal */

	.kastor-machine__related[data-kastor-reveal].is-revealed
		.kastor-machine__related-card {
		animation: kastor-fade-up 0.5s ease-out both;
	}

	.kastor-machine__related[data-kastor-reveal].is-revealed
		.kastor-machine__related-card:nth-child(1) { animation-delay: 0.05s; }
	.kastor-machine__related[data-kastor-reveal].is-revealed
		.kastor-machine__related-card:nth-child(2) { animation-delay: 0.15s; }
	.kastor-machine__related[data-kastor-reveal].is-revealed
		.kastor-machine__related-card:nth-child(3) { animation-delay: 0.25s; }
	.kastor-machine__related[data-kastor-reveal].is-revealed
		.kastor-machine__related-card:nth-child(4) { animation-delay: 0.35s; }
}
