/* ── Slider ── */
.main-slider:not(.is-loaded) .main-slider__skeleton {
	display: block;
}

.main-slider.is-loaded .main-slider__skeleton {
	display: none !important;
}

.js-slider-main:not(.slick-initialized) .main-slider__item:not(:first-child) {
	display: none !important;
}

/* ── Product images (ниже первого экрана) ── */
.ptb-skeleton-shimmer:not(.has-loaded),
.ptb-img-skeleton:not(.has-loaded),
.products-list__img:not(.has-loaded),
.online-vitrina-background:not(.has-loaded),
.online-vitrina-item:not(.has-loaded),
.take-present:not(.has-loaded) {
	position: relative;
	overflow: hidden;
	background-color: #ececef;
}

.ptb-skeleton-shimmer:not(.has-loaded)::before,
.ptb-img-skeleton:not(.has-loaded)::before,
.products-list__img:not(.has-loaded)::before,
.online-vitrina-background:not(.has-loaded)::before,
.online-vitrina-item:not(.has-loaded)::before,
.take-present:not(.has-loaded)::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, #e9ecef 0%, #f5f5f7 50%, #e9ecef 100%);
	background-size: 200% 100%;
	animation: ptb-skeleton-shimmer 1.2s ease-in-out infinite;
	z-index: 1;
	pointer-events: none;
}

.ptb-skeleton-shimmer:not(.has-loaded) img[data-src],
.ptb-img-skeleton:not(.has-loaded) img[data-src],
.products-list__img:not(.has-loaded) img[data-src],
.online-vitrina-background:not(.has-loaded) img[data-src],
.take-present:not(.has-loaded) .take-present-img {
	opacity: 0;
}

.ptb-skeleton-shimmer.has-loaded img,
.ptb-img-skeleton.has-loaded img,
.products-list__img.has-loaded img,
.online-vitrina-background.has-loaded img,
.take-present.has-loaded .take-present-img {
	opacity: 1;
}

.ptb-img-skeleton--wrap {
	display: inline-block;
	max-width: 100%;
	vertical-align: top;
}

@keyframes ptb-skeleton-shimmer {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

/* ══════════════════════════════════════════════════════════
   Главная: skeleton → chrome (шапка разом) → done (баннер)
   ══════════════════════════════════════════════════════════ */
html.ptb-home-pending,
html[data-ptb-fold="skeleton"] {
	--ptb-sk: linear-gradient(90deg, #e9ecef 0%, #f5f5f7 50%, #e9ecef 100%);
	--ptb-sk-h: 46px;
	--ptb-site-max: 1230px;
	--ptb-site-pad: 15px;
}

/* Мобильные: без fold — только скролл и видимый контент */
@media screen and (max-width: 767px) {
	html[data-ptb-mobile-lite="1"],
	html[data-ptb-mobile-lite="1"] body,
	html[data-ptb-first-screen="1"] body {
		overflow-y: auto !important;
		height: auto !important;
		touch-action: pan-y;
		-webkit-overflow-scrolling: touch;
	}

	html[data-ptb-mobile-lite="1"] body.overflow-hidden,
	html[data-ptb-first-screen="1"] body.overflow-hidden {
		overflow-y: auto !important;
		padding-right: 0 !important;
	}

	html[data-ptb-mobile-lite="1"].ptb-home-pending:not([data-ptb-first-screen="1"]):not(.ptb-fcp-shell-off) #ptb-fcp-shell {
		display: flex !important;
		visibility: visible !important;
		min-height: 100vh;
	}

	html[data-ptb-mobile-lite="1"].ptb-fcp-shell-off #ptb-fcp-shell,
	html[data-ptb-mobile-lite="1"][data-ptb-first-screen="1"] #ptb-fcp-shell {
		display: none !important;
	}

	html[data-ptb-mobile-lite="1"] .preloader {
		display: none !important;
	}

	html[data-ptb-mobile-lite="1"] img,
	html[data-ptb-mobile-lite="1"] .main-slider__img,
	html[data-ptb-mobile-lite="1"] .js-home-products-section,
	html[data-ptb-mobile-lite="1"] #vintrina-tabs-carousel,
	html[data-ptb-mobile-lite="1"] .recomend,
	html[data-ptb-mobile-lite="1"] main.content > .container[data-scope="main-page-bottom"] {
		visibility: visible !important;
		opacity: 1 !important;
		pointer-events: auto !important;
	}

	html[data-ptb-mobile-lite="1"] .main-slider .main-slider__skeleton {
		display: none !important;
	}

	html[data-ptb-mobile-lite="1"] .main-slider .js-slider-main {
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
	}

	/* Мобильный lite: не зависаем на fold=skeleton */
	html[data-ptb-mobile-lite="1"] .header__center__container::before,
	html[data-ptb-mobile-lite="1"] .header__bottom nav.header__nav.nav::before,
	html[data-ptb-mobile-lite="1"] .mobile-header::before,
	html[data-ptb-mobile-lite="1"] .ptb-category-chips::before {
		display: none !important;
	}

	html[data-ptb-mobile-lite="1"] .mobile-header > .header__nav-btn,
	html[data-ptb-mobile-lite="1"] .mobile-header > .header__logo,
	html[data-ptb-mobile-lite="1"] .mobile-header > .mobile-search,
	html[data-ptb-mobile-lite="1"] .mobile-header > .header-cart {
		position: static !important;
		width: auto !important;
		height: auto !important;
		overflow: visible !important;
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
	}

	html[data-ptb-mobile-lite="1"] .products-list__img:not(.has-loaded),
	html[data-ptb-first-screen="1"] .products-list__img:not(.has-loaded) {
		background-color: transparent;
	}

	html[data-ptb-mobile-lite="1"] .products-list__img:not(.has-loaded)::before,
	html[data-ptb-first-screen="1"] .products-list__img:not(.has-loaded)::before {
		display: none !important;
	}

	html[data-ptb-mobile-lite="1"] .products-list__img img,
	html[data-ptb-first-screen="1"] .products-list__img img {
		opacity: 1 !important;
	}
}

/* Верхняя строка — один скелетон на всю ширину контейнера */
html[data-ptb-fold="skeleton"] .header__center__container {
	position: relative;
	display: block;
	width: 100%;
	min-height: var(--ptb-sk-h);
}

html[data-ptb-fold="skeleton"] .header__center__container > * {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	margin: 0 !important;
	padding: 0 !important;
	flex: none !important;
}

html[data-ptb-fold="skeleton"] .header__center__container::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	border-radius: 12px;
	background: var(--ptb-sk);
	background-size: 200% 100%;
	animation: ptb-skeleton-shimmer 1.2s ease-in-out infinite;
}

html[data-ptb-fold="skeleton"] .header__bottom nav.header__nav.nav {
	position: relative;
	display: block !important;
	float: none !important;
	clear: both;
	width: 100% !important;
	min-height: 48px;
	padding: 8px 0;
	overflow: visible;
}

@media screen and (min-width: 768px) {
	html[data-ptb-fold="skeleton"] .header__bottom .mobile-header {
		display: block;
		width: 100%;
	}
}

html[data-ptb-fold="skeleton"] .ptb-category-chips {
	position: relative;
	min-height: 60px;
	margin-top: 12px;
}

html[data-ptb-fold="skeleton"] .ptb-category-chips > * {
	opacity: 1 !important;
	visibility: visible !important;
}

/* Меню: opacity, не visibility — иначе navigationResize() считает ширину неверно */
html[data-ptb-fold="skeleton"] .header__bottom .nav .nav__list,
html[data-ptb-fold="skeleton"] .header__bottom .nav .nav__list-item,
html[data-ptb-fold="skeleton"] .header__bottom .nav #overflow {
	opacity: 0 !important;
	visibility: visible !important;
	pointer-events: none !important;
}

/* Меню — одна полоса на всю ширину (явная высота: inset:0 ломался при float) */
html[data-ptb-fold="skeleton"] .header__bottom nav.header__nav.nav::before {
	content: "";
	position: absolute;
	z-index: 3;
	left: 0;
	top: 50%;
	width: 100%;
	height: 38px;
	transform: translateY(-50%);
	border-radius: 12px;
	background: var(--ptb-sk);
	background-size: 200% 100%;
	animation: ptb-skeleton-shimmer 1.2s ease-in-out infinite;
}

@media screen and (max-width: 767px) {
	html[data-ptb-fold="skeleton"] .header__bottom nav.header__nav.nav::before {
		display: none !important;
	}
}

/* Фильтр цен */
html[data-ptb-fold="skeleton"] .ptb-category-chips::before {
	content: "";
	position: absolute;
	z-index: 3;
	top: 50%;
	left: 0;
	transform: translateY(-50%);
	width: 100%;
	height: 60px;
	border-radius: 90px;
	background: var(--ptb-sk);
	background-size: 200% 100%;
	animation: ptb-skeleton-shimmer 1.2s ease-in-out infinite;
}

/* Баннер: не скрываем слайдер (opacity:0 ломало ПК, если Slick не успевал init) */
html[data-ptb-fold] .main-slider .js-slider-main,
html[data-ptb-fold] .main-slider__aspect {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

/* Ниже fold: контент остаётся в DOM видимым для SEO; скелетоны шапки/чипов — выше по файлу */

html.ptb-home-pending body.ptb-home-fold-active,
html.ptb-home-pending body.ptb-home-fold-active .wrapper,
html[data-ptb-scroll="1"] body.ptb-home-fold-active,
html[data-ptb-scroll="1"] body.ptb-home-fold-active .wrapper {
	touch-action: pan-y;
	-webkit-overflow-scrolling: touch;
}

/* Фаза chrome — вся шапка одновременно */
html[data-ptb-fold="chrome"] .header__center__container > * {
	position: static !important;
	width: auto !important;
	height: auto !important;
	overflow: visible !important;
	flex: initial !important;
}

html[data-ptb-fold="chrome"] .header__center__container {
	display: flex;
	align-items: center;
}

html[data-ptb-fold="chrome"] .header__center .header__logo > *,
html[data-ptb-fold="chrome"] .header__search-block > *,
html[data-ptb-fold="chrome"] .phone-block > *,
html[data-ptb-fold="chrome"] .callback-block > *,
html[data-ptb-fold="chrome"] .social-networks-block a,
html[data-ptb-fold="chrome"] .social-networks-block a img,
html[data-ptb-fold="chrome"] .header__center__container > .header-cart,
html[data-ptb-fold="chrome"] button.header-cart,
html[data-ptb-fold="chrome"] .header__bottom .nav .nav__list,
html[data-ptb-fold="chrome"] .header__bottom .nav .nav__list-item,
html[data-ptb-fold="chrome"] .header__bottom .nav #overflow,
html[data-ptb-fold="chrome"] .ptb-category-chips > *,
html[data-ptb-fold="chrome"] .ptb-category-chips .main-price-filter--scroll > * {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	transition: opacity 0.35s ease 0s;
}

html[data-ptb-fold="chrome"] .header__center__container::before,
html[data-ptb-fold="chrome"] .header__bottom nav.header__nav.nav::before,
html[data-ptb-fold="chrome"] .ptb-category-chips::before {
	display: none !important;
}

/* Фаза done — баннер */
html[data-ptb-fold="done"] .main-slider .js-slider-main {
	opacity: 1 !important;
	pointer-events: auto;
	transition: opacity 0.45s ease;
}

html[data-ptb-first-screen="1"] body.ptb-home-fold-active .js-home-products-section,
html[data-ptb-first-screen="1"] body.ptb-home-fold-active #vintrina-tabs-carousel,
html[data-ptb-first-screen="1"] body.ptb-home-fold-active .recomend,
html[data-ptb-first-screen="1"] body.ptb-home-fold-active main.content > .container[data-scope="main-page-bottom"] {
	visibility: visible;
	pointer-events: auto;
}

/* Аварийный выход: контент виден после завершения первого экрана */
html[data-ptb-first-screen="1"] .header__center .header__logo > *,
html[data-ptb-first-screen="1"] .header__search-block > *,
html[data-ptb-first-screen="1"] .phone-block > *,
html[data-ptb-first-screen="1"] .callback-block > *,
html[data-ptb-first-screen="1"] .social-networks-block a,
html[data-ptb-first-screen="1"] .social-networks-block a img,
html[data-ptb-first-screen="1"] .header__center__container > .header-cart,
html[data-ptb-first-screen="1"] button.header-cart,
html[data-ptb-first-screen="1"] .header__bottom .nav .nav__list,
html[data-ptb-first-screen="1"] .header__bottom .nav .nav__list-item,
html[data-ptb-first-screen="1"] .ptb-category-chips > *,
html[data-ptb-first-screen="1"] .main-slider .js-slider-main {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

html[data-ptb-first-screen="1"] .header__center__container::before,
html[data-ptb-first-screen="1"] .header__bottom nav.header__nav.nav::before,
html[data-ptb-first-screen="1"] .ptb-category-chips::before {
	display: none !important;
}

/* Аварийный/мобильный выход: слайдер не зависает на сером скелетоне */
html[data-ptb-first-screen="1"] .main-slider .main-slider__skeleton {
	display: none !important;
}

html[data-ptb-first-screen="1"] .main-slider .js-slider-main,
html[data-ptb-first-screen="1"] .main-slider:not(.is-loaded) .js-slider-main {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

@media screen and (min-width: 768px) {
	.mobile-header > .header__nav-btn,
	.mobile-header > .mobile-search,
	.mobile-header > .header-cart {
		display: none !important;
	}

	/* ПК: скелетоны по ширине .container, не на весь экран */
	#ptb-fcp-shell {
		align-items: center;
		padding-left: var(--ptb-site-pad);
		padding-right: var(--ptb-site-pad);
		box-sizing: border-box;
	}

	#ptb-fcp-shell > div {
		width: 100%;
		max-width: var(--ptb-site-max);
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	html.ptb-home-pending .header__center > .container,
	html.ptb-home-pending .header__bottom > .container,
	html[data-ptb-fold="skeleton"] .header__center > .container,
	html[data-ptb-fold="skeleton"] .header__bottom > .container,
	html.ptb-home-pending main.content > .container,
	html[data-ptb-fold="skeleton"] main.content > .container {
		max-width: var(--ptb-site-max);
		width: 100%;
		margin-left: auto;
		margin-right: auto;
		box-sizing: border-box;
	}

	html[data-ptb-fold="skeleton"] .header__bottom nav.header__nav.nav,
	html[data-ptb-fold="skeleton"] .ptb-category-chips {
		max-width: 100%;
	}
}

@media screen and (max-width: 767px) {
	html[data-ptb-fold="skeleton"] .header__center {
		display: none !important;
	}

	/* Мобильная шапка — одна полоса на всю ширину контейнера */
	html[data-ptb-fold="skeleton"] .header__bottom .mobile-header {
		position: relative;
		display: block !important;
		width: 100%;
		min-height: 44px;
	}

	html[data-ptb-fold="skeleton"] .mobile-header > .header__nav-btn,
	html[data-ptb-fold="skeleton"] .mobile-header > .header__logo,
	html[data-ptb-fold="skeleton"] .mobile-header > .mobile-search,
	html[data-ptb-fold="skeleton"] .mobile-header > .header-cart,
	html[data-ptb-fold="skeleton"] .mobile-header > nav.header__nav {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		overflow: hidden !important;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	html[data-ptb-fold="skeleton"] .mobile-header::before {
		content: "";
		position: absolute;
		z-index: 3;
		left: 0;
		top: 50%;
		width: 100%;
		height: 40px;
		transform: translateY(-50%);
		border-radius: 12px;
		background: var(--ptb-sk);
		background-size: 200% 100%;
		animation: ptb-skeleton-shimmer 1.2s ease-in-out infinite;
	}

	html[data-ptb-fold="skeleton"] .mobile-header::after {
		display: none !important;
	}

	html[data-ptb-fold="chrome"] .header__bottom .mobile-header,
	html[data-ptb-first-screen="1"] .header__bottom .mobile-header {
		display: flex !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 8px;
		min-height: 44px;
		width: 100%;
	}

	html[data-ptb-fold="chrome"] .mobile-header > nav.header__nav,
	html[data-ptb-first-screen="1"] .mobile-header > nav.header__nav {
		display: none !important;
	}

	html[data-ptb-fold="chrome"] .mobile-header > .header__nav-btn,
	html[data-ptb-fold="chrome"] .mobile-header > .mobile-search,
	html[data-ptb-fold="chrome"] .mobile-header > .header-cart,
	html[data-ptb-first-screen="1"] .mobile-header > .header__nav-btn,
	html[data-ptb-first-screen="1"] .mobile-header > .mobile-search,
	html[data-ptb-first-screen="1"] .mobile-header > .header-cart {
		position: static !important;
		flex: 0 0 24px !important;
		width: 24px !important;
		min-width: 24px !important;
		max-width: 24px !important;
		height: 24px !important;
		overflow: visible !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	html[data-ptb-fold="chrome"] .mobile-header > .mobile-search,
	html[data-ptb-first-screen="1"] .mobile-header > .mobile-search {
		display: flex !important;
		align-items: center !important;
	}

	html[data-ptb-fold="chrome"] .mobile-header > .header-cart,
	html[data-ptb-first-screen="1"] .mobile-header > .header-cart {
		display: block !important;
	}

	/* Логотип: фикс. размер до загрузки main.css (иначе width:auto + img 100% раздувает) */
	html[data-ptb-fold="chrome"] .mobile-header > .header__logo,
	html[data-ptb-first-screen="1"] .mobile-header > .header__logo {
		position: static !important;
		flex: 1 1 auto !important;
		min-width: 0 !important;
		max-width: 240px !important;
		width: auto !important;
		height: 31px !important;
		margin: 0 !important;
		padding: 0 !important;
		float: none !important;
		display: block !important;
		border: none !important;
		overflow: hidden !important;
	}

	html[data-ptb-fold="chrome"] .mobile-header .header__logo img,
	html[data-ptb-first-screen="1"] .mobile-header .header__logo img {
		display: block !important;
		width: auto !important;
		height: 31px !important;
		max-width: 100% !important;
		max-height: 31px !important;
		object-fit: contain !important;
	}

	html[data-ptb-fold="chrome"] .mobile-header .header__nav-btn img,
	html[data-ptb-fold="chrome"] .mobile-header .mobile-search img,
	html[data-ptb-fold="chrome"] .mobile-header .header-cart img,
	html[data-ptb-first-screen="1"] .mobile-header .header__nav-btn img,
	html[data-ptb-first-screen="1"] .mobile-header .mobile-search img,
	html[data-ptb-first-screen="1"] .mobile-header .header-cart img {
		width: 24px !important;
		height: 24px !important;
		max-width: 24px !important;
		max-height: 24px !important;
		object-fit: contain !important;
	}

	html[data-ptb-fold="chrome"] .mobile-header::before,
	html[data-ptb-fold="chrome"] .mobile-header::after {
		display: none !important;
	}

	html[data-ptb-fold="chrome"] .mobile-header .header__logo,
	html[data-ptb-fold="chrome"] .mobile-header .header__nav-btn,
	html[data-ptb-fold="chrome"] .mobile-header .mobile-search,
	html[data-ptb-fold="chrome"] .mobile-header .header-cart {
		opacity: 1 !important;
		visibility: visible !important;
		transition: opacity 0.35s ease;
	}
}

html[data-ptb-first-screen="1"] .mobile-header::before,
html[data-ptb-first-screen="1"] .mobile-header::after {
	display: none !important;
}

/* Аварийный выход: контент виден даже если fold завис */
html[data-ptb-first-screen="1"] img,
html.ptb-fcp-shell-off img,
html[data-ptb-first-screen="1"] .main-slider__img,
html[data-ptb-first-screen="1"] .js-home-products-section,
html[data-ptb-first-screen="1"] #vintrina-tabs-carousel,
html[data-ptb-first-screen="1"] .recomend,
html[data-ptb-first-screen="1"] main.content > .container[data-scope="main-page-bottom"] {
	visibility: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

html.ptb-fcp-shell-off #ptb-fcp-shell,
html[data-ptb-first-screen="1"] #ptb-fcp-shell {
	display: none !important;
}

/* «Показать еще» — всегда кликабельна, даже во время skeleton-fold */
.home-products-load-more-wrap,
.home-products-load-more-btn,
.js-home-products-load-more {
	visibility: visible !important;
	pointer-events: auto !important;
	opacity: 1 !important;
	position: relative;
	z-index: 6;
}

/* Мобильная: fold=skeleton не должен перекрывать шапку/чипы (выше по каскаду были конфликты) */
@media screen and (max-width: 767px) {
	html[data-ptb-mobile-lite="1"] .header__center__container::before,
	html[data-ptb-mobile-lite="1"] .header__bottom nav.header__nav.nav::before,
	html[data-ptb-mobile-lite="1"] .mobile-header::before,
	html[data-ptb-mobile-lite="1"] .ptb-category-chips::before,
	html[data-ptb-mobile-lite="1"][data-ptb-fold="skeleton"] .mobile-header::before,
	html[data-ptb-mobile-lite="1"][data-ptb-fold="skeleton"] .ptb-category-chips::before {
		display: none !important;
		content: none !important;
	}

	html[data-ptb-mobile-lite="1"] .mobile-header > .header__nav-btn,
	html[data-ptb-mobile-lite="1"] .mobile-header > .header__logo,
	html[data-ptb-mobile-lite="1"] .mobile-header > .mobile-search,
	html[data-ptb-mobile-lite="1"] .mobile-header > .header-cart,
	html[data-ptb-mobile-lite="1"][data-ptb-fold="skeleton"] .mobile-header > .header__nav-btn,
	html[data-ptb-mobile-lite="1"][data-ptb-fold="skeleton"] .mobile-header > .header__logo,
	html[data-ptb-mobile-lite="1"][data-ptb-fold="skeleton"] .mobile-header > .mobile-search,
	html[data-ptb-mobile-lite="1"][data-ptb-fold="skeleton"] .mobile-header > .header-cart {
		position: static !important;
		width: auto !important;
		min-width: 0 !important;
		max-width: none !important;
		height: auto !important;
		overflow: visible !important;
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
		margin: 0 !important;
		padding: 0 !important;
	}
}

