/* =====================================================
	cast-iron-v3.css — страница «Хромистый чугун» (v3)
	Все классы с префиксом cx-, чтобы не пересекаться с общим styles.css
	===================================================== */

.cx-page {
	--cx-bg: #101010;
	--cx-bg-2: #171717;
	--cx-card: #1e1e1e;
	--cx-line: rgba(255, 255, 255, 0.09);
	--cx-text: #f3f3f3;
	--cx-muted: rgba(255, 255, 255, 0.68);
	--cx-ok: #5fd39a;
	--cx-r: var(--border-radius, 1.4rem);
	background: var(--cx-bg);
	color: var(--cx-text);
	font-size: 1rem;
	line-height: 1.6;
}

.cx-page h1, .cx-page h2, .cx-page h3 { color: #fff; }
.cx-page p { margin-bottom: 1rem; }
.cx-page a { color: var(--primary-light); }
.cx-page img { max-width: 100%; height: auto; }

/* ---------- Кнопки ---------- */
.cx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	padding: .95rem 1.7rem;
	border: 2px solid transparent;
	border-radius: var(--cx-r);
	font-weight: 600;
	font-size: 1.05rem;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
.cx-page .cx-btn--primary { background: var(--gradient-primary); color: #fff; box-shadow: 0 8px 22px rgba(255, 111, 0, .3); }
.cx-page .cx-btn--primary:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(255, 111, 0, .42); color: #fff; }
.cx-page .cx-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); }
.cx-page .cx-btn--ghost:hover { border-color: var(--primary); color: #fff; transform: translateY(-3px); }
.cx-btn--small { padding: .7rem 1.2rem; font-size: .95rem; margin-top: .5rem; }

/* ---------- Первый экран ---------- */
.cx-hero {
	padding: 11rem 0 5rem;
	background:
		radial-gradient(900px 520px at 88% 18%, rgba(255, 111, 0, .18), transparent 60%),
		linear-gradient(180deg, #0a0a0a, #121212);
	overflow: hidden;
}
.cx-hero__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3.5rem; align-items: center; }
.cx-eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-light); margin-bottom: 1rem; }
.cx-hero__title { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 800; line-height: 1.12; margin-bottom: 1.2rem; }
.cx-hero__lead { font-size: 1.15rem; color: var(--cx-muted); max-width: 36rem; }
.cx-facts { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 1.5rem 0 2rem; }
.cx-facts li { padding: .45rem .95rem; border: 1px solid var(--cx-line); border-radius: 999px; background: rgba(255, 255, 255, .04); font-size: .9rem; }
.cx-hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.cx-hero__media { position: relative; border-radius: var(--cx-r); overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); border: 1px solid var(--cx-line); }
.cx-hero__media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.cx-badge { position: absolute; left: 1rem; bottom: 1rem; padding: .7rem 1.1rem; border: 1px solid var(--cx-line); border-radius: 1rem; background: rgba(10, 10, 10, .82); backdrop-filter: blur(6px); }
.cx-badge b { display: block; font-family: 'Montserrat', sans-serif; font-size: 1.4rem; color: var(--primary-light); }
.cx-badge span { font-size: .85rem; color: var(--cx-muted); }

/* ---------- Секции ---------- */
.cx-section { padding: 5rem 0; background: var(--cx-bg); }
.cx-section--alt { background: var(--cx-bg-2); }
.cx-h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; line-height: 1.2; margin-bottom: .7rem; }
.cx-sub { color: var(--cx-muted); max-width: 42rem; margin-bottom: 2.2rem; }

/* ---------- Выбор изделия ---------- */
.cx-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.cx-page a.cx-choice { display: flex; flex-direction: column; background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-r); overflow: hidden; color: var(--cx-text); text-decoration: none; transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.cx-page a.cx-choice:hover { transform: translateY(-6px); border-color: rgba(255, 111, 0, .55); box-shadow: 0 18px 40px rgba(0, 0, 0, .4); color: var(--cx-text); }
.cx-choice__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.cx-choice__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cx-choice:hover .cx-choice__img img { transform: scale(1.05); }
.cx-choice__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.4rem 1.6rem 1.6rem; flex-grow: 1; }
.cx-choice__title { font-family: 'Montserrat', sans-serif; font-size: 1.5rem; font-weight: 700; color: #fff; }
.cx-choice__tag { color: var(--cx-muted); }
.cx-choice__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: .9rem; }
.cx-choice__price { padding: .3rem .8rem; border-radius: 999px; background: rgba(255, 111, 0, .14); color: var(--primary-light); font-weight: 600; }
.cx-choice__go { color: var(--primary-light); font-weight: 600; }
.cx-choice__go i { transition: transform .3s ease; }
.cx-choice:hover .cx-choice__go i { transform: translateX(5px); }

/* ---------- Товар ---------- */
.cx-product__head { margin-bottom: 2rem; }
.cx-product__title { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.cx-product__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2.5rem; align-items: start; }

/* Фото */
.cx-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.cx-gallery__item { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 1rem; background: #1a1a1a; border: 1px solid var(--cx-line); }
.cx-gallery__item:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.cx-gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cx-gallery__item:hover img { transform: scale(1.06); }
.cx-gallery__more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .62); color: #fff; font-family: 'Montserrat', sans-serif; font-size: 1.4rem; font-weight: 700; }
.cx-gallery__hidden { display: none; }

/* ---------- Калькулятор ---------- */
.cx-calc { background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-r); padding: 1.8rem; }
.cx-calc__title { font-size: 1.35rem; font-weight: 700; margin-bottom: .3rem; }
.cx-calc__sub { color: var(--cx-muted); font-size: .95rem; margin-bottom: 0; }

/* Чертёж: длина изделия растёт вместе с ползунком */
.cx-draw { margin: 1.4rem 0 1.6rem; padding: 1.5rem 1rem 1.1rem; border: 1px dashed rgba(255, 255, 255, .16); border-radius: 1rem; background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent); }
.cx-draw__inner { width: calc(var(--cx-len, 70) * 1%); margin: 0 auto; transition: width .28s ease; }
.cx-piece { height: 44px; background: linear-gradient(180deg, #a3a3a3 0%, #555 42%, #2a2a2a 100%); }
.cx-piece--bar { height: 40px; border-radius: 22px; }
.cx-piece--grate { height: 50px; border-radius: 4px 4px 0 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 94% 100%, 88% 62%, 12% 62%, 6% 100%, 0 100%); }
.cx-dim { position: relative; height: 1px; margin-top: .9rem; background: var(--primary-light); }
.cx-dim::before, .cx-dim::after { content: ""; position: absolute; top: -6px; width: 1px; height: 13px; background: var(--primary-light); }
.cx-dim::before { left: 0; }
.cx-dim::after { right: 0; }
.cx-dim span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 0 .6rem; background: var(--cx-card); color: var(--primary-light); font-weight: 700; font-size: .9rem; white-space: nowrap; }

/* Ползунки */
.cx-ctrl { margin-bottom: 1.4rem; }
.cx-ctrl__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .6rem; }
.cx-ctrl__top label { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--cx-muted); margin: 0; }
.cx-ctrl__top output { font-family: 'Montserrat', sans-serif; font-size: 1.25rem; font-weight: 700; color: #fff; }
.cx-ctrl__row { display: flex; align-items: center; gap: .8rem; }
.cx-ctrl__scale { display: flex; justify-content: space-between; margin: 0 2.9rem; font-size: .75rem; color: rgba(255, 255, 255, .4); }
.cx-step { flex: 0 0 2.1rem; height: 2.1rem; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: transparent; color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.cx-step:hover { background: var(--primary); border-color: var(--primary); }

.cx-page input[type="range"].cx-range { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 6px; margin: 0; border-radius: 3px; background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--fill, 0%), #3a3a3a var(--fill, 0%), #3a3a3a 100%); outline: none; cursor: pointer; }
.cx-page input[type="range"].cx-range:focus-visible { box-shadow: 0 0 0 3px rgba(255, 159, 64, .45); }
.cx-page input[type="range"].cx-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-light); border: 3px solid var(--cx-card); box-shadow: 0 0 0 2px var(--primary); cursor: pointer; transition: transform .15s ease; }
.cx-page input[type="range"].cx-range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.cx-page input[type="range"].cx-range::-moz-range-track { height: 6px; border-radius: 3px; background: #3a3a3a; }
.cx-page input[type="range"].cx-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--primary); }
.cx-page input[type="range"].cx-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); border: 3px solid var(--cx-card); box-shadow: 0 0 0 2px var(--primary); cursor: pointer; }

/* Результат */
.cx-result { margin-top: 1.6rem; border: 1px solid var(--cx-line); border-radius: 1rem; overflow: hidden; }
.cx-row { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--cx-line); color: var(--cx-muted); }
.cx-row b { color: var(--cx-text); font-weight: 600; white-space: nowrap; }
.cx-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem 1.1rem; background: linear-gradient(135deg, rgba(255, 111, 0, .2), rgba(255, 111, 0, .05)); }
.cx-total span { font-weight: 600; }
.cx-total b { font-family: 'Montserrat', sans-serif; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; color: var(--primary-light); white-space: nowrap; }

/* Шкала до минимального заказа */
.cx-minbar { margin-top: 1.2rem; }
.cx-minbar__track { height: 8px; border-radius: 4px; background: #333; overflow: hidden; }
.cx-minbar__fill { width: 0; height: 100%; border-radius: 4px; background: var(--primary-light); transition: width .3s ease, background .3s ease; }
.cx-minbar[data-state="ok"] .cx-minbar__fill { background: var(--cx-ok); }
.cx-minbar__text { margin: .6rem 0 0; font-size: .92rem; color: var(--primary-light); }
.cx-minbar[data-state="ok"] .cx-minbar__text { color: var(--cx-ok); }
.cx-minbar__fix { margin-top: .5rem; padding: .45rem .9rem; border: 1px solid var(--primary-light); border-radius: 999px; background: transparent; color: var(--primary-light); font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .2s ease, color .2s ease; }
.cx-minbar__fix:hover { background: var(--primary-light); color: #111; }
.cx-minbar__fix[hidden] { display: none; }

/* Модельные работы */
.cx-model { margin-top: 1.2rem; border: 1px solid var(--cx-line); border-radius: .9rem; background: rgba(255, 255, 255, .02); }
.cx-model summary { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1.1rem; list-style: none; cursor: pointer; color: var(--primary-light); font-weight: 600; }
.cx-model summary::-webkit-details-marker { display: none; }
.cx-model summary::after { content: "+"; font-size: 1.3rem; line-height: 1; }
.cx-model[open] summary::after { content: "\2013"; }
.cx-model__body { padding: 0 1.1rem 1.1rem; color: var(--cx-muted); font-size: .95rem; }
.cx-tiers { width: 100%; border-collapse: collapse; }
.cx-tiers th, .cx-tiers td { padding: .5rem .2rem; border-bottom: 1px solid var(--cx-line); text-align: left; }
.cx-tiers th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .5); font-weight: 600; }
.cx-tiers td { color: var(--cx-text); }

/* Кнопка заказа */
.cx-page .cx-call { width: 100%; justify-content: center; margin-top: 1.4rem; padding: 1.05rem 1.4rem; font-size: 1.15rem; font-weight: 700; }
.cx-page .cx-call--wide { width: auto; margin-top: 0; padding: 1.05rem 2.2rem; }
.cx-calc__foot { margin: .8rem 0 0; font-size: .82rem; text-align: center; color: rgba(255, 255, 255, .45); }
.cx-calc--simple { text-align: center; }

/* ---------- Описание, схема ---------- */
.cx-info { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 2.5rem; margin-top: 3rem; align-items: start; }
.cx-info__text { color: var(--cx-muted); font-size: 1.05rem; line-height: 1.75; }
.cx-info__text strong { color: var(--cx-text); }
.cx-scheme { margin: 0; padding: 1rem; border-radius: 1rem; background: #f2f2f2; }
.cx-scheme img { display: block; width: 100%; height: auto; }
.cx-scheme figcaption { margin-top: .7rem; text-align: center; font-size: .9rem; color: #555; }
.cx-prose--extra { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--cx-line); }

/* ---------- Почему хромистый чугун ---------- */
.cx-why__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.cx-why__card { padding: 1.6rem; border: 1px solid var(--cx-line); border-radius: var(--cx-r); background: var(--cx-card); }
.cx-why__icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; margin-bottom: 1rem; border-radius: .9rem; background: rgba(255, 111, 0, .14); color: var(--primary-light); font-size: 1.2rem; }
.cx-why__title { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.cx-why__card p { margin: 0; color: var(--cx-muted); font-size: .95rem; }

/* ---------- Как заказать ---------- */
.cx-steps__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: cxstep; }
.cx-steps__item { position: relative; padding: 2.2rem 1.6rem 1.6rem; border: 1px solid var(--cx-line); border-radius: var(--cx-r); background: var(--cx-card); counter-increment: cxstep; }
.cx-steps__item::before { content: counter(cxstep); position: absolute; top: -1.2rem; left: 1.4rem; display: flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--gradient-primary); color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 800; }
.cx-steps__item h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; }
.cx-steps__item p { margin: 0; color: var(--cx-muted); }

/* ---------- Текст из редактора ---------- */
.cx-prose { max-width: 52rem; color: var(--cx-muted); font-size: 1.05rem; line-height: 1.75; }
.cx-prose h2 { font-size: 1.5rem; color: #fff; margin-bottom: 1rem; }
.cx-prose strong { color: var(--cx-text); }

/* ---------- Вопросы ---------- */
.cx-faq__list { max-width: 52rem; margin-top: 1.8rem; }
.cx-faq__item { border: 1px solid var(--cx-line); border-radius: 1rem; background: var(--cx-card); margin-bottom: .8rem; }
.cx-faq__item summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; list-style: none; cursor: pointer; font-weight: 600; color: #fff; }
.cx-faq__item summary::-webkit-details-marker { display: none; }
.cx-faq__item summary::after { content: "+"; flex: 0 0 auto; color: var(--primary-light); font-size: 1.5rem; line-height: 1; }
.cx-faq__item[open] summary::after { content: "\2013"; }
.cx-faq__answer { padding: 0 1.3rem 1.2rem; color: var(--cx-muted); }
.cx-faq__answer p:last-child { margin-bottom: 0; }

/* ---------- Финал ---------- */
.cx-final__box { padding: 3.5rem 2rem; text-align: center; border: 1px solid rgba(255, 111, 0, .35); border-radius: var(--cx-r); background: radial-gradient(700px 300px at 50% 0%, rgba(255, 111, 0, .2), transparent 70%), var(--cx-card); }
.cx-final__box .cx-sub { margin-left: auto; margin-right: auto; }
.cx-final__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem; margin-bottom: 1.6rem; }
.cx-page a.cx-final__phone { font-family: 'Montserrat', sans-serif; font-size: 1.7rem; font-weight: 700; color: #fff; text-decoration: none; }
.cx-page a.cx-final__phone:hover { color: var(--primary-light); }
.cx-page a.cx-final__link { font-weight: 600; text-decoration: none; }
.cx-final__link i { transition: transform .3s ease; }
.cx-final__link:hover i { transform: translateX(5px); }

/* ---------- Модальное окно с таблицей ---------- */
.cx-modal .modal-content { background: var(--cx-card, #1e1e1e); color: #eee; border: 1px solid rgba(255, 255, 255, .15); }
.cx-modal .modal-header { background: transparent; border-bottom: 1px solid rgba(255, 255, 255, .12); color: #fff; }
.cx-modal .modal-header .modal-title { font-size: 1.2rem; color: var(--primary-light); }
.cx-modal .modal-body { padding: 1.2rem; background: transparent; overflow-x: auto; }
.cx-modal .table { --bs-table-bg: transparent; --bs-table-color: #eee; --bs-table-border-color: rgba(255, 255, 255, .12); color: #eee; margin: 0; font-size: .92rem; }
.cx-modal .table th, .cx-modal .table td { color: #eee; }

/* ---------- Панель звонка на телефоне ---------- */
.cx-callbar { display: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1199px) {
	.cx-why__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
	.cx-hero { padding: 7.5rem 0 3.5rem; }
	.cx-hero__grid { grid-template-columns: 1fr; gap: 2.2rem; }
	.cx-product__grid, .cx-info { grid-template-columns: 1fr; }
	.cx-steps__list { grid-template-columns: 1fr; gap: 2rem; }
	.cx-section { padding: 3.5rem 0; }
}

@media (max-width: 767px) {
	.cx-hero { padding-top: 6rem; }
	.cx-choice-grid { grid-template-columns: 1fr; }
	.cx-calc { padding: 1.3rem; }
	.cx-hero__actions .cx-btn { flex: 1 1 100%; }
	.cx-final__box { padding: 2.5rem 1.2rem; }
	.cx-page .cx-call--wide { width: 100%; }
	.cx-callbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 900;
		display: flex;
		gap: .6rem;
		padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom));
		background: rgba(12, 12, 12, .96);
		backdrop-filter: blur(8px);
		border-top: 1px solid var(--cx-line);
	}
	.cx-page .cx-callbar a { display: flex; align-items: center; justify-content: center; gap: .5rem; flex: 1; padding: .8rem; border-radius: 1rem; font-weight: 700; text-decoration: none; }
	.cx-page .cx-callbar__call { background: var(--gradient-primary); color: #fff; }
	.cx-page .cx-callbar__calc { border: 1px solid rgba(255, 255, 255, .28); color: #fff; }
	body.page-template-page-castiron-v3 .main-footer { padding-bottom: 6.5rem; }
}

@media (max-width: 575px) {
	.cx-why__grid { grid-template-columns: 1fr; }
	.cx-ctrl__scale { margin: 0 2.9rem; }
}

@media (prefers-reduced-motion: reduce) {
	.cx-draw__inner, .cx-minbar__fill, .cx-gallery__item img, .cx-choice, .cx-choice__img img, .cx-btn { transition: none; }
}