/* ==========================================================================
   RUBINAPHARM — замена функций Elementor Pro
   Цвета: primary #fff, secondary #54595f, accent #61ce70, активный пункт #781c1d
   Брейкпоинты Elementor: планшет ≤1024px, телефон ≤767px
   ========================================================================== */
:root {
	--rp-primary: #fff;
	--rp-secondary: #54595f;
	--rp-accent: #61ce70;
	--rp-active: #781c1d;
	--rp-font: 'Montserrat', sans-serif;
	--rp-bar-h: 70px;
}

/* ---------- Якоря меню (бывший CSS элемента «Menu Anchor») ---------- */
body:not(.elementor-editor-active) .elementor-widget-menu-anchor {
	position: relative;
	z-index: -1;
}
body:not(.elementor-editor-active) .elementor-menu-anchor:before {
	content: "";
	display: block;
	height: 200px; /* высота фиксированной шапки */
	margin: -200px 0 0;
	visibility: hidden;
	pointer-events: none;
}

/* ---------- Ширины блоков на главной (бывший CSS элемента, Pro) ---------- */
@media (max-width: 768px) and (min-width: 600px) {
	.elementor-30 .elementor-element.elementor-element-3c9bbae { --width: 25%; }
	.elementor-30 .elementor-element.elementor-element-a3769b4 { --width: 50%; }
}
@media (max-width: 600px) and (min-width: 430px) {
	.elementor-30 .elementor-element.elementor-element-3c9bbae { --width: 20%; }
	.elementor-30 .elementor-element.elementor-element-a3769b4 { --width: 60%; }
}

/* ---------- Сброс стилей родительской темы (Hello: розовые рамки у button, цвета ссылок) ---------- */
.rp-header button, .rp-popup button {
	appearance: none; -webkit-appearance: none;
	background: none; border: 0; border-radius: 0; box-shadow: none;
	padding: 0; margin: 0; font: inherit; color: inherit; text-transform: none; display: inline-block;
}
.rp-header button:hover, .rp-header button:focus, .rp-popup button:hover, .rp-popup button:focus {
	background: none; color: inherit; outline-offset: 2px;
}
.rp-header a, .rp-footer a { background: none; text-decoration: none; }

/* ---------- Шапка ---------- */
/* Шапка лежит поверх первого экрана и занимает в потоке всего 5px (как в Elementor: высота 70px, отступ -65px) */
.rp-header { position: relative; z-index: 200; height: 5px; font-family: var(--rp-font); }
.rp-bar { box-sizing: border-box; }

/* Верхняя полоса (бывший header-1) */
.rp-bar--top {
	position: absolute;
	top: 0; left: 0; right: 0;
	z-index: 200;
	min-height: var(--rp-bar-h);
	display: flex;
	align-items: center;
	justify-content: center;
}
.rp-header--solid .rp-bar--top { background: var(--rp-secondary); }

/* Липкие шапки */
.rp-bar--sticky {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 250;
	min-height: var(--rp-bar-h);
	background: var(--rp-secondary);
	display: flex;
	align-items: center;
	justify-content: center;
	transform: translateY(-140%);
	visibility: hidden;
	transition: transform .3s ease, visibility 0s linear .3s;
}
body.admin-bar .rp-bar--sticky { top: 32px; }
@media (max-width: 782px) { body.admin-bar .rp-bar--sticky { top: 46px; } }
.rp-header.is-stuck .rp-bar--sticky {
	transform: translateY(0);
	visibility: visible;
	transition: transform .3s ease, visibility 0s;
}
.rp-header.is-stuck .rp-bar--top { visibility: hidden; }

/* Какая шапка на каком экране */
.rp-bar--sticky-mobile { display: none; }
@media (min-width: 1025px) {
	.rp-header .rp-bar--top .rp-burger { display: none; }
}
@media (max-width: 1024px) {
	.rp-bar--sticky-desktop { display: none; }
	.rp-bar--sticky-mobile { display: flex; justify-content: space-between; padding: 10px; }
}

/* ---------- Меню ---------- */
.rp-nav { font-family: var(--rp-font); }
.rp-menu, .rp-menu ul { list-style: none; margin: 0; padding: 0; }
.rp-nav .rp-menu a {
	display: block;
	color: var(--rp-primary);
	font-size: 16px;
	font-weight: 600;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1.3;
	padding: 5px 7px;
	position: relative;
}
.rp-nav .rp-menu a:hover, .rp-nav .rp-menu a:focus, .rp-nav .rp-menu a:visited { color: var(--rp-primary); }
.rp-menu a img { display: block; max-height: 50px; width: auto; }

/* Горизонтальный ряд на ПК */
@media (min-width: 1025px) {
	.rp-nav { display: block; }
	.rp-menu { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
	.rp-menu > li { position: relative; }
	/* точечные разделители между пунктами */
	.rp-menu > li:not(:last-child)::after {
		content: ""; position: absolute; right: 0; top: 25%; height: 50%;
		border-right: 1px dotted var(--rp-primary);
	}
	.rp-nav .rp-menu > li > a { padding: 8px 14px; }
	/* подчёркивание при наведении (pointer: underline) */
	.rp-menu > li > a::before {
		content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px;
		background: var(--rp-primary); transform: scaleX(0); transition: transform .25s ease;
	}
	.rp-menu > li > a:hover::before,
	.rp-menu > li:focus-within > a::before,
	.rp-menu > li.is-active > a::before { transform: scaleX(1); background: var(--rp-active); }
	.rp-menu > li > a:hover::before,
	.rp-menu > li.is-active > a:hover::before,
	.rp-menu > li:focus-within > a:focus::before { transform: scaleX(1); background: var(--rp-primary); }

	/* выпадающие списки (до 3 уровней) */
	.rp-menu .sub-menu {
		position: absolute; left: 0; top: 100%;
		min-width: 260px;
		background: #fff;
		border: 1px solid #000;
		box-shadow: 0 8px 24px rgba(0,0,0,.18);
		opacity: 0; visibility: hidden; transform: translateY(6px);
		transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
		z-index: 10;
	}
	.rp-menu li:hover > .sub-menu,
	.rp-menu li:focus-within > .sub-menu,
	.rp-menu li.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
	.rp-menu .sub-menu li { position: relative; }
	.rp-menu .sub-menu li + li { border-top: 1px dashed #000; }
	.rp-nav .rp-menu .sub-menu a, .rp-nav .rp-menu .sub-menu a:visited {
		color: #33373d; font-weight: 400; text-transform: none; padding: 7px 14px;
	}
	.rp-nav .rp-menu .sub-menu a:hover, .rp-nav .rp-menu .sub-menu a:focus, .rp-menu .sub-menu li:focus-within > a { background: var(--rp-secondary); color: #fff; }
	.rp-menu .sub-menu .sub-menu { left: 100%; top: -1px; }
	/* у крайних справа пунктов вложенные списки открываем влево, чтобы не выходить за экран */
	.rp-menu > li:nth-last-child(-n+2) .sub-menu .sub-menu { left: auto; right: 100%; }
	/* у меню «моб.» первый пункт — логотип, он не кликабелен (как было в Elementor) */
	.rp-nav--sticky .rp-menu > li:first-child > a { pointer-events: none; }
	.rp-nav--sticky .rp-menu > li:first-child::after { display: none; }
}

/* Бургер и выезжающее меню на планшете и телефоне */
.rp-sub-toggle { display: none !important; }
.rp-header .rp-burger {
	display: none;
	background: none; border: 0; cursor: pointer; padding: 10px;
	width: 50px; height: 50px; position: relative; color: var(--rp-primary);
}
.rp-burger span, .rp-burger span::before, .rp-burger span::after {
	content: ""; display: block; position: absolute; left: 12px; right: 12px; height: 3px;
	background: currentColor; border-radius: 2px; transition: transform .25s ease, opacity .2s ease;
}
.rp-burger span { top: 23px; }
.rp-burger span::before { left: 0; right: 0; top: -9px; }
.rp-burger span::after { left: 0; right: 0; top: 9px; }
.rp-burger[aria-expanded="true"] span { background: transparent; }
.rp-burger[aria-expanded="true"] span::before { transform: translateY(9px) rotate(45deg); }
.rp-burger[aria-expanded="true"] span::after { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 1024px) {
	.rp-header .rp-burger { display: block; }
	.rp-bar--top { justify-content: flex-end; padding: 10px; }
	.rp-header .rp-bar--top .rp-nav,
	.rp-header .rp-bar__menu .rp-nav {
		position: absolute; left: 0; right: 0; top: 100%;
		background: var(--rp-secondary);
		max-height: calc(100vh - var(--rp-bar-h)); overflow-y: auto;
		display: none;
	}
	.rp-bar--top .rp-nav { top: 100%; }
	.rp-burger[aria-expanded="true"] + .rp-nav { display: block; }
	.rp-bar__menu { position: static; }
	.rp-bar__logo img { height: 50px; width: auto; }
	.rp-nav .rp-menu a { padding: 12px 20px; text-align: center; }
	.rp-menu > li + li { border-top: 1px dotted rgba(255,255,255,.6); }
	.rp-menu .sub-menu { display: none; background: rgba(0,0,0,.12); }
	.rp-menu li.is-open > .sub-menu { display: block; }
	.rp-nav .rp-menu .sub-menu a { font-weight: 400; text-transform: none; padding: 10px 20px; }
	.rp-nav .rp-menu .menu-item-has-children > a { padding-right: 44px; padding-left: 44px; }
	.rp-menu .menu-item-has-children > .rp-sub-toggle {
		display: block !important;
		position: absolute; right: 0; top: 0; width: 44px; height: 46px; background: none; border: 0; color: #fff; cursor: pointer;
	}
	.rp-menu .menu-item-has-children { position: relative; }
	.rp-menu .menu-item-has-children > .rp-sub-toggle::before { content: "+"; font-size: 22px; line-height: 1; }
	.rp-menu .menu-item-has-children.is-open > .rp-sub-toggle::before { content: "\2212"; }
	/* логотип — первый пункт «меню моб.» — на телефоне не нужен, он есть в липкой шапке */
}


/* ---------- Подвал ---------- */
.rp-footer {
	background: var(--rp-secondary);
	padding: 14px 10px;
	font-family: var(--rp-font);
	position: relative; z-index: 200;
}
.rp-nav--footer .rp-menu { display: flex; flex-wrap: wrap; justify-content: center; }
.rp-nav--footer .rp-menu a { font-size: 12px; font-weight: 500; text-transform: none; padding: 5px 7px; }
.rp-nav--footer .rp-menu > li:not(:last-child)::after {
	content: ""; position: absolute; right: 0; top: 25%; height: 50%; border-right: 1px dotted #fff;
}
.rp-nav--footer .rp-menu > li { position: relative; }
.rp-nav--footer .rp-menu > li > a::before { display: none; }
@media (max-width: 767px) {
	.rp-nav--footer .rp-menu { flex-direction: column; align-items: center; }
	.rp-nav--footer .rp-menu > li::after { display: none; }
}

/* ---------- Попап «Связаться с нами» ---------- */
.rp-popup {
	width: min(400px, calc(100vw - 30px));
	box-sizing: border-box;
	padding: 23px;
	border: 1px solid rgba(255,255,255,.49);
	border-radius: 50px;
	background: #fff;
	color: var(--rp-secondary);
	text-align: center;
	box-shadow: 0 10px 50px rgba(0,0,0,.35);
	animation: rp-popup-in .5s ease both;
}
.rp-popup::backdrop { background: rgba(0,0,0,.5); animation: rp-popup-in .5s ease both; }
.rp-popup__title { margin: 12px 0 0; font-family: 'Roboto Slab', serif; font-weight: 400; color: var(--rp-secondary); }
.rp-popup__note { margin: 15px 0 0; font-family: var(--rp-font); font-weight: 600; font-size: 14px; line-height: 20px; color: #7a7a7a; }
.rp-popup__mail { display: inline-flex; flex-direction: column; align-items: center; margin-top: 15px; font-family: var(--rp-font); color: var(--rp-secondary); text-decoration: none; }
.rp-popup__close {
	position: absolute; top: 16px; right: 26px;
	background: none; border: 0; font-size: 28px; line-height: 1; color: var(--rp-secondary); cursor: pointer;
}
@keyframes rp-popup-in { from { opacity: 0; } to { opacity: 1; } }
body.rp-lock { overflow: hidden; }

/* ---------- Анимации при прокрутке полностью отключены ----------
   Классы rp-fx-* могли остаться в данных страниц от прежней версии темы — нейтрализуем их.
   Входные анимации Elementor (fadeIn и т.п.) тоже запускаются при прокрутке, поэтому гасим и их. */
.rp-fx, [class*="rp-fx-"] { animation: none !important; opacity: 1 !important; filter: none; translate: none; scale: none; }
.elementor-element.animated, .elementor-invisible { animation: none !important; }
.elementor-invisible { visibility: visible !important; opacity: 1 !important; }

/* ---------- Архив: красная плашка «Продукция, которую мы больше не выпускаем…» ----------
   Поведение «sticky bottom» реализует site.js: плашка закреплена внизу экрана, а в конце страницы встаёт над подвалом.
   В закреплённом виде она находится в обёртке .rp-strip-wrap (прямо в <body>) с теми же классами .elementor.elementor-2092,
   поэтому все её стили Elementor остаются в силе. Белый контур сверху и снизу добавляем сами. */
.rp-strip-wrap {
	position: fixed !important;
	left: 0; right: 0; bottom: 0;
	width: 100%;
	z-index: 1000;
	margin: 0; padding: 0;
	border-top: 2px solid #fff;
	border-bottom: 2px solid #fff;
	background: #fff;
}
.rp-strip-wrap > .elementor-element {
	position: relative !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
}
.rp-strip-ph { height: 0; }
