/* ==========================================================================
   Iconic Nails — мобильный хедер, меню-аккордеон, слайдер
   Цвета берутся из темы, при отсутствии — запасные значения.
   ========================================================================== */

:root {
	--in-bg: var(--wp--preset--color--base, #fff);
	--in-fg: var(--wp--preset--color--contrast, #01031a);
	--in-muted: var(--wp--preset--color--secondary-600, #68696e);
	--in-line: var(--wp--preset--color--secondary-100, #e5e6e6);
	--in-soft: var(--wp--preset--color--base-100, #f5f5f5);
	--in-accent: var(--wp--preset--color--primary, #1c235a);
	--in-mh-h: 60px;
	--in-ease: cubic-bezier(.2, .7, .2, 1);
}

/* тема не везде ставит border-box — задаём сами */
.in-mh, .in-mh *, .in-drawer, .in-drawer *, .in-slider, .in-slider * { box-sizing: border-box; }

/* ---------- Мобильный хедер ---------- */

.in-mh,
.in-drawer,
.in-overlay { display: none; }

@media (max-width: 1023px) {
	/* прячем хедер темы, показываем свой */
	body.in-has-mh header.wp-block-template-part { display: none !important; }

	.in-mh {
		display: block;
		position: sticky;
		top: 0;
		z-index: 9990;
		background: var(--in-bg);
		color: var(--in-fg);
		border-bottom: 1px solid var(--in-line);
		transition: box-shadow .2s;
	}
	body.admin-bar .in-mh { top: 46px; }
	.in-mh.is-scrolled { box-shadow: 0 2px 12px rgb(0 0 0 / .08); }

	.in-drawer { display: flex; }
	.in-overlay { display: block; }
	.in-overlay[hidden] { display: none; }
}
@media (max-width: 600px) {
	body.admin-bar .in-mh { top: 0; } /* на телефоне админ-бар не липкий */
}

.in-mh__bar {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	height: var(--in-mh-h);
	padding-inline: 8px;
}

.in-ico {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}

.in-mh__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	height: 44px;
	padding: 0 8px;
	margin: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.in-mh__btn:active { background: var(--in-soft); }
.in-mh__btn:focus-visible,
.in-acc:focus-visible,
.in-slider__arrow:focus-visible,
.in-slider__dot:focus-visible { outline: 2px solid var(--in-accent); outline-offset: 2px; }

.in-mh__burger { justify-self: start; }
.in-mh__label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}
@media (max-width: 380px) { .in-mh__label { display: none; } }

.in-mh__actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
}
@media (max-width: 360px) { .in-mh__actions .in-mh__btn { min-width: 38px; padding: 0 4px; } }

.in-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
	max-width: 46vw;
}
.in-logo__img { display: block; width: auto; max-width: 100%; height: auto; max-height: 40px; object-fit: contain; }
.in-logo__text { font-weight: 700; font-size: 18px; letter-spacing: .04em; white-space: nowrap; text-transform: uppercase; }

.in-cart-count {
	position: absolute;
	top: 4px;
	inset-inline-end: 2px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--in-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}
.in-cart-count[hidden] { display: none; }

.in-mh__search {
	padding: 0 12px 12px;
}
.in-mh__search[hidden] { display: none; }

/* ---------- Поиск ---------- */

.in-search {
	display: flex;
	align-items: center;
	margin: 0;
	border: 1px solid var(--in-line);
	border-radius: 10px;
	background: var(--in-soft);
	overflow: hidden;
}
.in-search input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 14px;
	margin: 0;
	border: 0;
	background: transparent;
	color: var(--in-fg);
	font: inherit;
	font-size: 16px; /* меньше 16px — iOS зумит страницу */
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.in-search button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--in-muted);
	cursor: pointer;
}
.in-search:focus-within { border-color: var(--in-fg); background: var(--in-bg); }

/* ---------- Выезжающее меню ---------- */

.in-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483000; /* выше виджетов чата и прочего */
	background: rgb(1 3 26 / .45);
	opacity: 0;
	transition: opacity .3s var(--in-ease);
}
.in-open .in-overlay { opacity: 1; }

.in-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	height: 100vh;
	height: 100dvh; /* на телефоне — без учёта панели браузера, иначе низ меню прячется под ней */
	inset-inline-start: 0;
	z-index: 2147483001;
	flex-direction: column;
	width: min(88vw, 380px);
	background: var(--in-bg);
	color: var(--in-fg);
	box-shadow: 0 0 40px rgb(0 0 0 / .18);
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform .32s var(--in-ease), visibility 0s linear .32s;
}
.rtl .in-drawer,
[dir="rtl"] .in-drawer { transform: translateX(100%); }
.in-open .in-drawer {
	transform: none;
	visibility: visible;
	transition: transform .32s var(--in-ease), visibility 0s;
}
html.in-lock,
html.in-lock body { overflow: hidden; }

.in-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: var(--in-mh-h);
	padding-inline: 16px 8px;
	border-bottom: 1px solid var(--in-line);
	flex: none;
}
.in-drawer__head .in-logo { justify-content: flex-start; }

.in-drawer__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 0 24px;
	-webkit-overflow-scrolling: touch;
}
.in-drawer__body > .in-search { margin: 0 16px 12px; }

.in-drawer__sep { height: 8px; margin: 12px 0; background: var(--in-soft); }

.in-drawer__foot {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--in-line);
}
.in-drawer__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	font-size: 14px;
	text-decoration: none;
}
.in-drawer__close:focus:not(:focus-visible) { outline: none; }

/* языки — кнопки в ряд */
.in-lang {
	display: flex;
	gap: 6px;
}
.in-lang__item {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 8px;
	border: 1px solid var(--in-line);
	border-radius: 8px;
	color: inherit;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
	-webkit-tap-highlight-color: transparent;
}
.in-lang__item img { width: 18px; height: 12px; border-radius: 2px; object-fit: cover; flex: none; }
.in-lang__item.is-current { border-color: var(--in-fg); background: var(--in-fg); color: var(--in-bg); font-weight: 600; }
.in-lang__item:not(.is-current):active { background: var(--in-soft); }

/* ---------- Пункты меню и аккордеон ---------- */

.in-nav,
.in-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.in-nav li {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
}
.in-nav a {
	flex: 1;
	display: block;
	min-height: 48px;
	padding: 14px 16px;
	color: inherit;
	line-height: 20px;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.in-nav a:active { background: var(--in-soft); }

/* верхний уровень каталога — как у конкурента: заглавные, с разделителями */
.in-nav--catalog > li { border-bottom: 1px solid var(--in-line); }
.in-nav--catalog > li > a {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.in-nav--info > li > a { font-size: 15px; color: var(--in-muted); min-height: 44px; padding-block: 12px; }

.in-acc {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-inline-start: 1px solid var(--in-line);
	background: none;
	color: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.in-acc .in-ico { width: 20px; height: 20px; transition: transform .25s var(--in-ease); }
.in-acc[aria-expanded="true"] .in-ico { transform: rotate(180deg); }

/* подменю: плавное раскрытие через grid-rows */
.in-nav .in-sub {
	flex-basis: 100%;
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .28s var(--in-ease);
}
.in-nav .in-sub > ul { min-height: 0; overflow: hidden; }
.in-nav li.is-open > .in-sub { grid-template-rows: 1fr; }
.in-nav .in-sub > ul { background: var(--in-soft); }
.in-nav .in-sub a {
	min-height: 44px;
	padding: 12px 16px;
	padding-inline-start: 28px;
	font-size: 15px;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
}
.in-nav .in-sub .in-sub a { padding-inline-start: 44px; font-size: 14px; }
.in-nav .in-sub .in-acc { border-inline-start: 0; height: 44px; }

.in-nav .current-menu-item > a,
.in-nav .current-cat > a { color: var(--in-accent); font-weight: 700; }

/* без JS подменю видны полностью */
.in-nav ul.sub-menu,
.in-nav ul.children { flex-basis: 100%; }

@media (prefers-reduced-motion: reduce) {
	.in-drawer, .in-overlay, .in-nav .in-sub, .in-acc .in-ico { transition: none !important; }
}

/* ---------- Слайдер ---------- */

.in-slider {
	position: relative;
	width: 100%;
	max-width: none;
	margin: 0 auto;
	overflow: hidden;
	background: var(--in-soft);
	--wp--style--global--content-size: none;
}
.in-slider__track {
	position: relative;
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}
.in-slider__track::-webkit-scrollbar { display: none; }
.in-slider__slide {
	flex: 0 0 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	display: block;
	color: inherit;
}
.in-slider__slide picture { display: block; }
.in-slider__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--in-ar-d, 3.2);
	object-fit: cover;
}
@media (max-width: 767px) {
	.in-slider__slide.has-mobile .in-slider__img { aspect-ratio: var(--in-ar-m, .5625); }
}

/* навигация внизу: ‹ — — — › */
.in-slider__nav {
	position: absolute;
	inset-inline: 0;
	bottom: 6px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	pointer-events: none;
}
.in-slider__nav > * { pointer-events: auto; }

.in-slider__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background .2s, transform .15s;
}
.in-slider__arrow:focus:not(:focus-visible) { outline: none; }
@media (hover: hover) { .in-slider__arrow:hover { background: rgb(0 0 0 / .18); } }
.in-slider__arrow:active { transform: scale(.9); }
.in-slider__arrow svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	/* тень, чтобы белая стрелка читалась и на светлом баннере */
	filter: drop-shadow(0 1px 3px rgb(0 0 0 / .45));
}
.rtl .in-slider__arrow svg,
[dir="rtl"] .in-slider__arrow svg { transform: scaleX(-1); }
@media (min-width: 768px) {
	.in-slider__nav { bottom: 10px; gap: 10px; }
}

.in-slider__dots {
	display: flex;
	justify-content: center;
	gap: 4px;
}
.in-slider__dot {
	position: relative;
	width: 28px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	pointer-events: auto;
}
.in-slider__dot::before {
	content: "";
	position: absolute;
	inset-inline: 4px;
	top: 50%;
	height: 3px;
	margin-top: -1.5px;
	border-radius: 2px;
	background: rgb(255 255 255 / .55);
	box-shadow: 0 0 3px rgb(0 0 0 / .25);
	transition: background .2s;
}
.in-slider__dot[aria-current="true"]::before { background: #fff; }
