/* Advanced Header Footer Pro — базовые стили */

.ahfp-wrapper {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.ahfp-wrapper * {
	box-sizing: border-box;
}

/* Видимость по устройствам (резерв, основные медиа-запросы генерируются динамически) */
@media (max-width: 767px) {
	.ahfp-hide-mobile { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1024px) {
	.ahfp-hide-tablet { display: none !important; }
}
@media (min-width: 1025px) {
	.ahfp-hide-desktop { display: none !important; }
}

/* Sticky */
.ahfp-wrapper.ahfp-sticky {
	will-change: transform, box-shadow, background-color;
}
.ahfp-wrapper.ahfp-sticky.ahfp-is-stuck {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
}
.ahfp-wrapper.ahfp-type-footer.ahfp-sticky.ahfp-is-stuck {
	top: auto;
	bottom: 0;
}
.ahfp-wrapper.ahfp-sticky-spacer {
	display: none;
}
.ahfp-wrapper.ahfp-sticky.ahfp-is-stuck ~ .ahfp-sticky-spacer-active {
	display: block;
}

/* Скрытие при прокрутке вниз */
.ahfp-hide-on-scroll-down {
	transition: transform .3s ease;
}
.ahfp-hide-on-scroll-down.ahfp-scrolled-down {
	transform: translateY(-100%);
}
.ahfp-type-footer.ahfp-hide-on-scroll-down.ahfp-scrolled-down {
	transform: translateY(100%);
}

/* Прозрачность до прокрутки */
.ahfp-transparent-until-scroll:not(.ahfp-is-stuck) {
	background-color: transparent !important;
	box-shadow: none !important;
}

/* Уменьшение (shrink) */
.ahfp-wrapper .elementor-container {
	transition: padding .3s ease, min-height .3s ease;
}
.ahfp-wrapper.ahfp-is-shrink .elementor-container {
	padding-top: 6px;
	padding-bottom: 6px;
}

/* Анимации появления */
.ahfp-anim-fade {
	animation-name: ahfpFade;
	animation-fill-mode: both;
	animation-timing-function: ease;
}
.ahfp-anim-slide-down {
	animation-name: ahfpSlideDown;
	animation-fill-mode: both;
	animation-timing-function: ease;
}
.ahfp-anim-slide-up {
	animation-name: ahfpSlideUp;
	animation-fill-mode: both;
	animation-timing-function: ease;
}
.ahfp-anim-zoom-in {
	animation-name: ahfpZoomIn;
	animation-fill-mode: both;
	animation-timing-function: ease;
}

@keyframes ahfpFade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes ahfpSlideDown {
	from { opacity: 0; transform: translateY(-40px); }
	to { opacity: 1; transform: translateY(0); }
}
@keyframes ahfpSlideUp {
	from { opacity: 0; transform: translateY(40px); }
	to { opacity: 1; transform: translateY(0); }
}
@keyframes ahfpZoomIn {
	from { opacity: 0; transform: scale(.92); }
	to { opacity: 1; transform: scale(1); }
}

/* Попап-шаблоны */
.ahfp-popup-hidden {
	display: none;
}
.ahfp-popup-hidden.ahfp-popup-open {
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0,0,0,.5);
}

/* Кнопка бургер */
.ahfp-burger {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 32px;
	height: 32px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
}
.ahfp-burger span {
	display: block;
	width: 100%;
	height: 2px;
	background-color: #222;
	border-radius: 2px;
	transition: transform .25s ease, opacity .25s ease;
}
.ahfp-burger-dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
}
.ahfp-burger.ahfp-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.ahfp-burger.ahfp-active span:nth-child(2) { opacity: 0; }
.ahfp-burger.ahfp-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Мобильное меню — off-canvas */
.ahfp-mobile-menu-active .ahfp-offcanvas-panel {
	transform: translateX(0) !important;
}
.ahfp-offcanvas-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	width: min(320px, 85vw);
	background: #fff;
	transition: transform .3s ease;
	z-index: 100000;
	overflow-y: auto;
}
.ahfp-offcanvas-right { right: 0; transform: translateX(100%); }
.ahfp-offcanvas-left { left: 0; transform: translateX(-100%); }

/* Мобильное меню — fullscreen */
.ahfp-mobile-menu-active .ahfp-fullscreen-panel {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}
.ahfp-fullscreen-panel {
	position: fixed;
	inset: 0;
	background: #fff;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .3s ease;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* iOS: отключение bounce-эффекта */
.ahfp-ios-no-bounce {
	overscroll-behavior-y: none;
}

/* iOS: корректная высота вьюпорта через custom property --ahfp-vh, задаётся в JS */
.ahfp-ios-vh-fix {
	height: calc(var(--ahfp-vh, 1vh) * 100);
}

/* =========================================================
   AHFP — Виджеты для построения шапки
   ========================================================= */

/* ---------- Меню навигации ---------- */
.ahfp-nav-menu-wrap {
	width: 100%;
}
.ahfp-nav-menu {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 24px;
}
.ahfp-nav-layout-vertical .ahfp-nav-menu {
	flex-direction: column;
	align-items: flex-start;
}
.ahfp-nav-menu li {
	position: relative;
}
.ahfp-nav-menu a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	white-space: nowrap;
}
.ahfp-nav-arrow-yes .ahfp-nav-menu li.menu-item-has-children > a::after,
.ahfp-nav-arrow-yes .ahfp-nav-menu li.ahfp-has-children > a::after {
	content: '';
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s ease;
}
.ahfp-nav-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0,0,0,.12);
	border-radius: 4px;
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.ahfp-nav-menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
}
.ahfp-nav-menu li:hover > .sub-menu,
.ahfp-nav-menu li.ahfp-submenu-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.ahfp-nav-menu .sub-menu a {
	display: block;
	padding: 8px 16px;
	width: 100%;
}
.ahfp-submenu-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 8px;
	margin-left: auto;
}

/* Мобильный вид меню внутри offcanvas / fullscreen панелей */
.ahfp-offcanvas-panel .ahfp-nav-menu,
.ahfp-fullscreen-panel .ahfp-nav-menu {
	flex-direction: column;
	align-items: stretch;
	padding: 24px;
	gap: 4px;
}
.ahfp-offcanvas-panel .ahfp-nav-menu .sub-menu,
.ahfp-fullscreen-panel .ahfp-nav-menu .sub-menu {
	position: static;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
	max-height: 0;
	overflow: hidden;
	padding: 0;
	transition: max-height .25s ease;
}
.ahfp-offcanvas-panel .ahfp-nav-menu li.ahfp-submenu-open > .sub-menu,
.ahfp-fullscreen-panel .ahfp-nav-menu li.ahfp-submenu-open > .sub-menu {
	max-height: 800px;
	padding: 4px 0 4px 16px;
}
.ahfp-offcanvas-panel .ahfp-submenu-toggle,
.ahfp-fullscreen-panel .ahfp-submenu-toggle {
	display: inline-flex;
}

/* ---------- Поиск ---------- */
.ahfp-search-toggle {
	background: none;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
}
.ahfp-search-icon-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
}
.ahfp-search-form {
	display: flex;
	align-items: center;
	overflow: hidden;
}
.ahfp-search-form-collapsed {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	opacity: 0;
	pointer-events: none;
	transition: width .3s ease, opacity .3s ease;
	background: #fff;
	box-shadow: 0 4px 16px rgba(0,0,0,.1);
	border-radius: 4px;
	z-index: 10;
}
.ahfp-search-expand-left .ahfp-search-form-collapsed { right: 100%; margin-right: 8px; }
.ahfp-search-expand-right .ahfp-search-form-collapsed { left: 100%; margin-left: 8px; }
.ahfp-search-expand-down .ahfp-search-form-collapsed {
	position: fixed;
	top: 0; left: 0; right: 0;
	transform: none;
	width: 100% !important;
	height: 72px;
	border-radius: 0;
	justify-content: center;
	padding: 0 24px;
	z-index: 100000;
}
.ahfp-search-icon-wrap.ahfp-search-active .ahfp-search-form-collapsed {
	width: 260px;
	opacity: 1;
	pointer-events: auto;
	padding: 6px 10px;
}
.ahfp-search-expand-down.ahfp-search-active .ahfp-search-form-collapsed {
	width: 100% !important;
}
.ahfp-search-input {
	border: none;
	background: transparent;
	flex: 1;
	min-width: 0;
	padding: 6px 8px;
	outline: none;
}
.ahfp-search-submit {
	background: none;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 8px;
}
.ahfp-search-form:not(.ahfp-search-form-collapsed) {
	background: #f5f5f5;
	border-radius: 4px;
	padding: 4px 4px 4px 12px;
}

/* ---------- Логотип ---------- */
.ahfp-logo-wrap {
	display: inline-flex;
}
.ahfp-logo-link {
	display: inline-flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
}
.ahfp-logo-image {
	display: block;
	max-width: 100%;
	height: auto;
}
.ahfp-logo-text {
	font-weight: 700;
	font-size: 22px;
	line-height: 1.2;
}
.ahfp-logo-tagline {
	font-size: 12px;
	opacity: .8;
}

/* ---------- Контакты ---------- */
.ahfp-contacts-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}
.ahfp-contact-item {
	display: inline-flex;
	align-items: center;
}
.ahfp-contact-item svg,
.ahfp-contact-item i {
	flex-shrink: 0;
}
.ahfp-contact-item a {
	text-decoration: none;
}

/* ---------- Соцсети ---------- */
.ahfp-socials-list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}
.ahfp-social-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.ahfp-socials-shape-circle .ahfp-social-item { border-radius: 50%; }
.ahfp-socials-shape-square .ahfp-social-item { border-radius: 0; }
.ahfp-socials-shape-rounded .ahfp-social-item { border-radius: 8px; }
.ahfp-socials-shape-text .ahfp-social-item { background: transparent !important; }
.ahfp-social-item:hover {
	transform: translateY(-2px);
}

/* ---------- Корзина ---------- */
.ahfp-cart-widget {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}
.ahfp-cart-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.ahfp-cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
	font-weight: 700;
}
.ahfp-cart-subtotal {
	white-space: nowrap;
}

/* ---------- Топбар ---------- */
.ahfp-topbar {
	width: 100%;
	overflow: hidden;
	max-height: 200px;
	transition: max-height .3s ease, padding .3s ease, opacity .3s ease;
}
.ahfp-topbar.ahfp-topbar-closed {
	max-height: 0;
	opacity: 0;
}
.ahfp-topbar-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 20px;
	position: relative;
}
.ahfp-topbar-text {
	flex: 1 1 auto;
}
.ahfp-topbar-text p {
	margin: 0;
}
.ahfp-topbar-button {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	padding: 6px 16px;
	text-decoration: none;
	white-space: nowrap;
	font-weight: 600;
}
.ahfp-topbar-close {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 0 4px;
}

/* ---------- Хлебные крошки ---------- */
.ahfp-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
.ahfp-breadcrumbs a {
	text-decoration: none;
}
.ahfp-crumb-sep {
	opacity: .7;
}

/* ---------- Общее: подсказки в редакторе ---------- */
.ahfp-editor-notice {
	padding: 8px 12px;
	background: #fff3cd;
	border: 1px solid #ffe08a;
	border-radius: 4px;
	font-size: 12px;
	margin-top: 8px;
}
