/* СХЕМА: услуги — вид как у pr-services + плавное раскрытие */

.shema-service {
	--shema-svc-bg: #f3f3f3;
	--shema-svc-bg-open: #e9204f;
	--shema-svc-title: #101010;
	--shema-svc-title-open: #ffffff;
	--shema-svc-body: rgba(255, 255, 255, 0.92);
	--shema-svc-label: #ffffff;
	--shema-svc-arrow: #747474;
	--shema-svc-arrow-open: #ffffff;
	--shema-svc-arrow-size: 24px;
	--shema-svc-icon: rgba(255, 255, 255, 0.22);
	--shema-svc-icon-size: 66px;
	--shema-svc-icon-left: -20px;
	--shema-svc-pad-t: 40px;
	--shema-svc-pad-r: 30px;
	--shema-svc-pad-b: 40px;
	--shema-svc-pad-l: 30px;
	--shema-svc-ease: cubic-bezier(0.17, 0.67, 0, 1.01);
	--shema-svc-duration: 0.7s;

	position: relative;
	display: flex;
	flex-direction: column;
	height: auto;
	box-sizing: border-box;
	background: var(--shema-svc-bg);
	overflow: hidden;
	isolation: isolate;
	transition: background-color var(--shema-svc-duration) var(--shema-svc-ease);
}

.shema-service:hover,
.shema-service.is-open,
.shema-service.is-modal-open {
	background: var(--shema-svc-bg-open);
}

.shema-service__summary {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: var(--shema-svc-pad-t) var(--shema-svc-pad-r) var(--shema-svc-pad-b) var(--shema-svc-pad-l);
	border: 0;
	background: transparent;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
	appearance: none;
	-webkit-appearance: none;
	overflow: hidden;
}

.shema-service__summary:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -6px;
}

/* Watermark icon — like .pr-service-box-icon-wrap */
.shema-service__icon-wrap {
	position: absolute;
	left: var(--shema-svc-icon-left);
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 0;
	transition: left 0.4s var(--shema-svc-ease);
}

.shema-service__icon-wrap i,
.shema-service__icon-wrap svg {
	display: inline-flex;
	font-size: var(--shema-svc-icon-size);
	line-height: 1;
	width: 1em;
	height: 1em;
	color: var(--shema-svc-icon);
	fill: var(--shema-svc-icon);
	opacity: 0;
	transform: scale(0.7);
	transition:
		opacity var(--shema-svc-duration) var(--shema-svc-ease),
		transform var(--shema-svc-duration) var(--shema-svc-ease),
		color 0.3s var(--shema-svc-ease);
}

.shema-service:hover .shema-service__icon-wrap i,
.shema-service:hover .shema-service__icon-wrap svg,
.shema-service.is-open .shema-service__icon-wrap i,
.shema-service.is-open .shema-service__icon-wrap svg,
.shema-service.is-modal-open .shema-service__icon-wrap i,
.shema-service.is-modal-open .shema-service__icon-wrap svg {
	opacity: 1;
	transform: scale(1);
}

.shema-service__title {
	position: relative;
	z-index: 1;
	margin: 0;
	flex: 1 1 auto;
	font-size: 19px;
	line-height: 24px;
	font-weight: 700;
	color: var(--shema-svc-title);
	transition: color 0.3s var(--shema-svc-ease);
}

.shema-service:hover .shema-service__title,
.shema-service.is-open .shema-service__title,
.shema-service.is-modal-open .shema-service__title {
	color: var(--shema-svc-title-open);
}

/* Thin right arrow — same glyph as original (iconfont) */
.shema-service__arrow {
	position: relative;
	z-index: 1;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: var(--shema-svc-arrow-size);
	line-height: 1;
	color: var(--shema-svc-arrow);
	transition:
		color 0.3s var(--shema-svc-ease),
		transform 0.45s var(--shema-svc-ease);
}

.shema-service:hover .shema-service__arrow,
.shema-service.is-open .shema-service__arrow,
.shema-service.is-modal-open .shema-service__arrow {
	color: var(--shema-svc-arrow-open);
}

.shema-service.is-open .shema-service__arrow {
	transform: rotate(90deg);
}

/* Modal mode: content lives in the popup, not in the card */
.shema-service--modal .shema-service__panel {
	display: none !important;
}

/* Smooth height via grid 0fr → 1fr */
.shema-service__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.48s cubic-bezier(0.22, 1, 0.36, 1);
	position: relative;
	z-index: 1;
}

.shema-service.is-open .shema-service__panel {
	grid-template-rows: 1fr;
}

.shema-service:not(.is-open) .shema-service__panel {
	pointer-events: none;
}

/* Клип без padding — иначе 0fr не схлопывается (на демо закрытая карточка = 104px) */
.shema-service__panel-inner {
	overflow: hidden;
	min-height: 0;
}

.shema-service__panel-content {
	padding: 0 var(--shema-svc-pad-r) 36px var(--shema-svc-pad-l);
	opacity: 0;
	transform: translateY(-8px);
	transition:
		opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.shema-service.is-open .shema-service__panel-content {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.05s;
}

.shema-service__block {
	opacity: 0;
	transform: translateY(12px);
	transition:
		opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.shema-service.is-open .shema-service__block {
	opacity: 1;
	transform: translateY(0);
}

.shema-service.is-open .shema-service__block[data-index="0"] {
	transition-delay: 0.08s;
}

.shema-service.is-open .shema-service__block[data-index="1"] {
	transition-delay: 0.16s;
}

.shema-service.is-open .shema-service__block[data-index="2"] {
	transition-delay: 0.24s;
}

.shema-service__block + .shema-service__block {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.shema-service__label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--shema-svc-label);
}

.shema-service__label::before {
	content: "";
	width: 18px;
	height: 2px;
	background: currentColor;
	opacity: 0.85;
}

.shema-service__text {
	font-size: 15px;
	line-height: 1.7;
	color: var(--shema-svc-body);
}

.shema-service__text p {
	margin: 0 0 0.65em;
}

.shema-service__text p:last-child {
	margin-bottom: 0;
}

.shema-service__text strong {
	display: inline-block;
	margin-bottom: 0.15em;
	font-size: 1.05em;
	letter-spacing: 0.02em;
	color: #fff;
}

.shema-service__block--result .shema-service__text strong:first-child {
	display: block;
	margin-bottom: 0.35em;
	font-size: 16px;
	line-height: 1.35;
}

/*
 * In a grid/flex parent: grow only the current row (auto row tracks).
 * align-self:start — closed siblings in that row keep their own height
 * instead of stretching to the open card.
 */
.elementor-widget-shema-service {
	align-self: start;
	height: auto;
}

.elementor-widget-shema-service .elementor-widget-container {
	height: auto;
}

/* Prefer auto row tracks when Elementor left equal 1fr rows on the host */
.e-grid:has(> .elementor-widget-shema-service),
.e-grid:has(> .e-con-inner > .elementor-widget-shema-service),
.section__flex.e-grid {
	grid-template-rows: none;
	grid-auto-rows: auto;
	align-items: start;
}

.e-grid:has(> .elementor-widget-shema-service) > .e-con-inner,
.section__flex.e-grid > .e-con-inner {
	grid-template-rows: none;
	grid-auto-rows: auto;
	align-items: start;
}

/* ——— Popup modal ——— */
.shema-service-modal {
	--shema-svc-bg-open: #e9204f;
	--shema-svc-title-open: #ffffff;
	--shema-svc-body: rgba(255, 255, 255, 0.92);
	--shema-svc-label: #ffffff;
	--shema-svc-pad-r: 30px;
	--shema-svc-pad-l: 30px;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.22s ease,
		visibility 0.22s ease;
}

.shema-service-modal.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.shema-service-modal[hidden] {
	display: none !important;
}

.shema-service-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 16, 16, 0.62);
	backdrop-filter: blur(2px);
}

.shema-service-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(720px, 100%);
	max-height: min(86vh, 820px);
	overflow: auto;
	box-sizing: border-box;
	padding: 36px 36px 40px;
	background: var(--shema-svc-bg-open);
	color: var(--shema-svc-body);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.shema-service-modal.is-visible .shema-service-modal__dialog {
	transform: translateY(0) scale(1);
}

.shema-service-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.shema-service-modal__close:hover,
.shema-service-modal__close:focus-visible {
	opacity: 1;
}

.shema-service-modal__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.shema-service-modal__title {
	margin: 0 40px 24px 0;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--shema-svc-title-open);
}

.shema-service-modal__body .shema-service__panel-content {
	padding: 0;
	opacity: 1;
	transform: none;
}

.shema-service-modal__body .shema-service__block {
	opacity: 1;
	transform: none;
}

.shema-service-modal__body .shema-service__block + .shema-service__block {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.shema-service-modal__body .shema-service__label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--shema-svc-label);
}

.shema-service-modal__body .shema-service__label::before {
	content: "";
	width: 18px;
	height: 2px;
	background: currentColor;
	opacity: 0.85;
}

.shema-service-modal__body .shema-service__text {
	font-size: 15px;
	line-height: 1.7;
	color: var(--shema-svc-body);
}

.shema-service-modal__body .shema-service__text p {
	margin: 0 0 0.65em;
}

.shema-service-modal__body .shema-service__text p:last-child {
	margin-bottom: 0;
}

.shema-service-modal__body .shema-service__text strong {
	display: inline-block;
	margin-bottom: 0.15em;
	font-size: 1.05em;
	letter-spacing: 0.02em;
	color: #fff;
}

.shema-service-modal__body .shema-service__block--result .shema-service__text strong:first-child {
	display: block;
	margin-bottom: 0.35em;
	font-size: 16px;
	line-height: 1.35;
}

html.shema-service-modal-open,
html.shema-service-modal-open body {
	overflow: hidden;
}

@media (max-width: 600px) {
	.shema-service-modal__dialog {
		padding: 28px 22px 32px;
		max-height: 90vh;
	}

	.shema-service-modal__title {
		font-size: 19px;
		margin-right: 36px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shema-service,
	.shema-service__summary,
	.shema-service__panel,
	.shema-service__panel-content,
	.shema-service__block,
	.shema-service__arrow,
	.shema-service__title,
	.shema-service__icon-wrap i,
	.shema-service__icon-wrap svg,
	.shema-service-modal,
	.shema-service-modal__dialog {
		transition: none !important;
	}
}
