/**
 * Стили фронтенда EHFP Pro RU
 */

/* ==========================================================================
   1. НЕЗАВИСИМОЕ РАЗДЕЛЕНИЕ ШАПОК И ПОДВАЛОВ ПО УСТРОЙСТВАМ
   ========================================================================== */
@media (max-width: 767px) {
	.ehfp-device-desktop,
	.ehfp-device-tablet,
	.ehfp-device-desktop_tablet,
	.ehfp-logo-desktop-only {
		display: none !important;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.ehfp-device-desktop,
	.ehfp-device-mobile,
	.ehfp-logo-mobile-only {
		display: none !important;
	}
}

@media (min-width: 1025px) {
	.ehfp-device-tablet,
	.ehfp-device-mobile,
	.ehfp-device-tablet_mobile,
	.ehfp-logo-mobile-only {
		display: none !important;
	}
}

/* ==========================================================================
   2. ЛИПКАЯ ШАПКА (STICKY HEADER & SMART SCROLL)
   ========================================================================== */
.ehfp-sticky-header {
	position: relative;
	width: 100%;
	z-index: 9999;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ehfp-sticky-active {
	position: fixed !important;
	top: 0;
	left: 0;
	width: 100%;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	animation: ehfpStickySlideDown 0.35s ease forwards;
}

.ehfp-smart-hidden {
	transform: translateY(-100%);
}

@keyframes ehfpStickySlideDown {
	0% {
		transform: translateY(-100%);
	}
	100% {
		transform: translateY(0);
	}
}

/* ==========================================================================
   3. НАВИГАЦИОННОЕ МЕНЮ (NAV MENU)
   ========================================================================== */
.ehfp-nav-menu ul.menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 24px;
}

.ehfp-nav-menu.ehfp-nav-layout-vertical ul.menu {
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.ehfp-nav-menu ul.menu li {
	position: relative;
	margin: 0;
}

.ehfp-nav-menu ul.menu li a {
	display: block;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s ease;
}

/* Выпадающие подменю на десктопе */
.ehfp-nav-menu ul.menu li ul.sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	padding: 10px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all 0.25s ease;
	z-index: 999;
	flex-direction: column;
	gap: 0;
}

.ehfp-nav-menu ul.menu li:hover > ul.sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ehfp-nav-menu ul.menu li ul.sub-menu li a {
	padding: 8px 20px;
	font-size: 14px;
	color: #333;
}

.ehfp-nav-menu ul.menu li ul.sub-menu li a:hover {
	background: #f8f9fa;
	color: #007cba;
}

/* Бургер иконка */
.ehfp-menu-toggle-btn {
	display: none;
	background: transparent;
	border: none;
	padding: 8px 12px;
	cursor: pointer;
	align-items: center;
	gap: 8px;
}

.ehfp-burger-icon {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 24px;
	height: 18px;
}

.ehfp-burger-icon span {
	display: block;
	width: 100%;
	height: 2px;
	background-color: currentColor;
	border-radius: 2px;
	transition: all 0.3s ease;
}

.ehfp-menu-toggle-btn.active .ehfp-burger-icon span:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}
.ehfp-menu-toggle-btn.active .ehfp-burger-icon span:nth-child(2) {
	opacity: 0;
}
.ehfp-menu-toggle-btn.active .ehfp-burger-icon span:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* Мобильный брейкпоинт меню */
@media (max-width: 1024px) {
	.ehfp-has-mobile-toggle.ehfp-breakpoint-tablet .ehfp-menu-toggle-btn,
	.ehfp-has-mobile-toggle.ehfp-breakpoint-always .ehfp-menu-toggle-btn {
		display: inline-flex;
	}
	.ehfp-has-mobile-toggle.ehfp-breakpoint-tablet .ehfp-menu-container,
	.ehfp-has-mobile-toggle.ehfp-breakpoint-always .ehfp-menu-container {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		background: #fff;
		box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
		padding: 20px;
		z-index: 9999;
	}
	.ehfp-has-mobile-toggle.ehfp-breakpoint-tablet .ehfp-menu-container.open,
	.ehfp-has-mobile-toggle.ehfp-breakpoint-always .ehfp-menu-container.open {
		display: block;
	}
	.ehfp-has-mobile-toggle.ehfp-breakpoint-tablet ul.menu,
	.ehfp-has-mobile-toggle.ehfp-breakpoint-always ul.menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
	.ehfp-has-mobile-toggle.ehfp-breakpoint-tablet ul.sub-menu,
	.ehfp-has-mobile-toggle.ehfp-breakpoint-always ul.sub-menu {
		position: static;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		padding-left: 15px;
	}
}

/* ==========================================================================
   4. МОБИЛЬНЫЕ ШТОРКИ / DRAWER OFF-CANVAS
   ========================================================================== */
.ehfp-mobile-drawer-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	z-index: 99998;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.ehfp-mobile-drawer-overlay.active {
	opacity: 1;
	visibility: visible;
}

.ehfp-mobile-drawer-container {
	position: fixed;
	top: 0;
	right: -420px;
	width: 100%;
	max-width: 380px;
	height: 100%;
	background: #fff;
	z-index: 99999;
	box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
	overflow-y: auto;
	transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
}

.ehfp-mobile-drawer-container.active {
	right: 0;
}

.ehfp-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
	border-bottom: 1px solid #eee;
}

.ehfp-drawer-title {
	font-weight: 700;
	font-size: 18px;
	color: #111;
}

.ehfp-drawer-close {
	background: #f1f3f5;
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #495057;
	transition: all 0.2s;
}

.ehfp-drawer-close:hover {
	background: #e9ecef;
	color: #111;
}

.ehfp-drawer-content {
	padding: 20px;
	flex: 1;
}

.ehfp-drawer-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	background: #007cba;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.ehfp-drawer-trigger-btn:hover {
	opacity: 0.9;
}

/* ==========================================================================
   5. ФОРМА ПОИСКА (SEARCH FORM)
   ========================================================================== */
.ehfp-search-form.ehfp-search-inline {
	display: flex;
	align-items: center;
}

.ehfp-search-input {
	padding: 10px 16px;
	border: 1px solid #ddd;
	border-radius: 6px 0 0 6px;
	font-size: 14px;
	outline: none;
	flex: 1;
}

.ehfp-search-submit {
	padding: 10px 20px;
	background: #007cba;
	color: #fff;
	border: 1px solid #007cba;
	border-radius: 0 6px 6px 0;
	font-weight: 600;
	cursor: pointer;
}

.ehfp-search-modal-trigger {
	background: transparent;
	border: none;
	font-size: 22px;
	cursor: pointer;
	color: inherit;
	padding: 8px;
}

.ehfp-search-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.98);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.ehfp-search-modal.active {
	opacity: 1;
	visibility: visible;
}

.ehfp-search-modal-content {
	position: relative;
	width: 90%;
	max-width: 600px;
}

.ehfp-search-modal-content .ehfp-search-input {
	width: 100%;
	padding: 18px 24px;
	font-size: 24px;
	border: 2px solid #007cba;
	border-radius: 10px;
}

.ehfp-search-modal-close {
	position: absolute;
	top: -60px;
	right: 0;
	background: transparent;
	border: none;
	font-size: 32px;
	cursor: pointer;
}

/* ==========================================================================
   6. КОРЗИНА WOOCOMMERCE
   ========================================================================== */
.ehfp-cart-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: inherit;
	font-weight: 600;
}

.ehfp-cart-icon {
	position: relative;
	display: inline-flex;
	font-size: 24px;
}

.ehfp-cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	background: #e02b20;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 12px;
	line-height: 1;
}

/* ==========================================================================
   7. КНОПКА "НАВЕРХ" (BACK TO TOP)
   ========================================================================== */
.ehfp-back-to-top {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	background: #333;
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
	transition: all 0.3s ease;
}

.ehfp-back-to-top.pos-floating {
	position: fixed;
	bottom: 30px;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px);
}

.ehfp-back-to-top.pos-floating.align-right { right: 30px; }
.ehfp-back-to-top.pos-floating.align-left { left: 30px; }

.ehfp-back-to-top.pos-floating.show {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ehfp-back-to-top:hover {
	background: #007cba;
	transform: translateY(-3px);
}

.ehfp-progress-circle {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.ehfp-progress-circle path {
	fill: none;
	stroke: #007cba;
	stroke-width: 4;
	stroke-linecap: round;
	transition: stroke-dasharray 0.1s linear;
}

/* ==========================================================================
   8. КОНТАКТЫ И КРОШКИ
   ========================================================================== */
.ehfp-contact-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
}

.ehfp-contact-list.layout-horizontal {
	flex-wrap: wrap;
	gap: 20px;
}

.ehfp-contact-list.layout-vertical {
	flex-direction: column;
	gap: 10px;
}

.ehfp-contact-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ehfp-breadcrumbs {
	font-size: 14px;
}
.ehfp-breadcrumbs a {
	text-decoration: none;
	color: #007cba;
}
.ehfp-breadcrumbs-sep {
	margin: 0 6px;
	color: #888;
}

/* ==========================================================================
   9. СОЦСЕТИ И ТЕЛЕФОНЫ (МУЛЬТИ-КОНТАКТ)
   ========================================================================== */
.ehfp-social-phones-container {
	display: flex;
	flex-direction: column;
}

.ehfp-social-phones-container.pos-left {
	flex-direction: row;
	align-items: flex-start;
}

.ehfp-social-phones-container.pos-right {
	flex-direction: row-reverse;
	align-items: flex-start;
}

.ehfp-social-icons-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.ehfp-social-icon-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: #1d2327;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ehfp-social-icon-link i {
	font-size: 22px;
}

.ehfp-phones-col {
	display: flex;
	flex-direction: column;
}

.ehfp-phone-row-item {
	display: flex;
	align-items: center;
}

.ehfp-phone-item-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: #1d2327;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.4;
	transition: color 0.2s ease;
}

.ehfp-phone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ehfp-phone-label {
	font-size: 13px;
	font-weight: 400;
	color: #646970;
	margin-left: 6px;
}

/* ==========================================================================
   10. ПОЛНАЯ АДАПТАЦИЯ ПОД ЭКРАНЫ: ПК, ПЛАНШЕТ, МОБИЛЬНЫЙ, IOS SAFARI
   ========================================================================== */

/* --- АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ (768px - 1024px) --- */
@media (min-width: 768px) and (max-width: 1024px) {
	.ehfp-template-wrapper {
		padding-left: 15px;
		padding-right: 15px;
	}
	.ehfp-mobile-drawer-container {
		width: 360px;
	}
	.ehfp-nav-menu ul.menu {
		gap: 16px;
	}
}

/* --- АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ТЕЛЕФОНОВ (< 768px) --- */
@media (max-width: 767px) {
	.ehfp-template-wrapper {
		padding-left: 10px;
		padding-right: 10px;
	}
	
	/* Шторка на весь экран или почти весь на смартфонах */
	.ehfp-mobile-drawer-container {
		width: 100%;
		max-width: 100vw;
		right: -100%;
	}
	
	/* Если соцсети и телефоны были слева/справа в ряд — на мобильном перестраиваем в аккуратную колонку или перенос */
	.ehfp-social-phones-container.pos-left,
	.ehfp-social-phones-container.pos-right {
		flex-direction: column !important;
		align-items: flex-start !important;
	}
	
	.ehfp-social-phones-container.pos-left .ehfp-social-icons-row,
	.ehfp-social-phones-container.pos-right .ehfp-social-icons-row {
		margin-right: 0 !important;
		margin-left: 0 !important;
		margin-bottom: 12px !important;
	}

	/* Предотвращение вылезания длинных номеров на узких экранах (320px-380px) */
	.ehfp-phone-item-link {
		flex-wrap: wrap;
		word-break: break-word;
	}
	
	/* Увеличение тач-зон (Touch Targets) до стандартов Apple iOS Human Interface Guidelines (мин. 44x44px) */
	.ehfp-menu-toggle-btn,
	.ehfp-drawer-trigger-btn,
	.ehfp-drawer-close,
	.ehfp-search-modal-trigger,
	.ehfp-back-to-top {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
	
	.ehfp-social-icon-link {
		padding: 6px;
	}
}

/* --- СПЕЦИАЛЬНАЯ АДАПТАЦИЯ И ОПТИМИЗАЦИЯ ПОД IOS (SAFARI, IPHONE, IPAD) --- */
.ehfp-is-ios .ehfp-template-wrapper,
.ehfp-is-ios .ehfp-sticky-active {
	/* Учет выреза (Notch/Dynamic Island) и безопасной зоны Safe Area Insets на iPhone X/14/15/16 */
	padding-top: max(env(safe-area-inset-top), 0px);
	padding-left: max(env(safe-area-inset-left), 0px);
	padding-right: max(env(safe-area-inset-right), 0px);
}

.ehfp-is-ios .ehfp-mobile-drawer-container {
	/* Использование современных единиц высоты 100dvh для корректной работы с адресной строкой iOS Safari */
	height: 100dvh;
	height: -webkit-fill-available;
	padding-top: max(env(safe-area-inset-top), 20px);
	padding-bottom: max(env(safe-area-inset-bottom), 20px);
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.ehfp-is-ios .ehfp-sticky-active {
	/* Аппаратное ускорение на iOS для устранения дрожания (jitter) при прокрутке */
	-webkit-transform: translate3d(0, 0, 0);
	transform: translate3d(0, 0, 0);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.ehfp-is-ios .ehfp-search-input {
	/* Фикс известного бага iOS Safari: размер шрифта не менее 16px предотвращает принудительное авто-зумирование экрана при клике на поле ввода */
	font-size: 16px !important;
}

.ehfp-is-ios .ehfp-menu-toggle-btn,
.ehfp-is-ios .ehfp-drawer-trigger-btn,
.ehfp-is-ios .ehfp-drawer-close,
.ehfp-is-ios .ehfp-search-modal-trigger,
.ehfp-is-ios .ehfp-social-icon-link,
.ehfp-is-ios .ehfp-phone-item-link,
.ehfp-is-ios .ehfp-back-to-top {
	/* Отключение задержки двойного тапа (300ms double-tap delay) на iOS */
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}


