/*
 * Iluproff — мобильная версия (подключается из inc/mobile.php после style.css).
 * Все правила — только в медиазапросах; десктоп (> 1024px) не затрагивается.
 */

/* ---------- ≤ 1024px: мобильная шапка темы и общие тап-зоны ---------- */
@media (max-width: 1024px) {
	/* Поиск под шапкой: строка белая, а поле было настроено под тёмную полосу — белый текст и рамка на белом. */
	.whb-header-bottom .searchform input.s {
		height: 44px;
		padding-right: 48px;
		border: 1px solid #d5d8e0;
		background-color: #fff;
		color: var(--ilu-ink);
		font-size: 16px; /* iOS не зумит поле при фокусе */
	}

	.whb-header-bottom .searchform input.s::placeholder {
		color: #6b6b75;
		opacity: 1;
	}

	.whb-header-bottom .searchform input.s:focus {
		border-color: var(--ilu-navy);
	}

	.whb-header-bottom .searchform .searchsubmit {
		width: 44px;
		height: 44px;
		color: var(--ilu-navy);
	}

	/* Шапка: логотип слева, справа язык · телефон · избранное · корзина · бургер (крайний справа).
	   Текстовые элементы темы растягиваются (flex 1 1 auto) — без центральной колонки это давало дыры между иконками. */
	.whb-general-header .whb-mobile-right > .wd-header-text {
		flex: 0 0 auto;
	}

	/* Логотип и бургер — по краям поля поиска под шапкой (колонки темы начинаются в 5px от края; ≤ 480px — в 0, см. ниже). */
	.whb-general-header .whb-mobile-left .whb-ilulogomobile {
		padding-left: 10px;
	}

	.whb-general-header .whb-mobile-right .wd-header-mobile-nav > a {
		padding-right: 10px;
	}

	/* Иконка телефона: тап-зона 40×40 вместо 22×28. */
	.whb-header .whb-ilutextphone {
		padding-inline: 0;
	}

	.whb-header .whb-ilutextphone .ilu-phone-icon {
		justify-content: center;
		width: 40px;
		height: 40px;
	}

	/* Пункты выпадающего списка языков: 44px по высоте вместо 36px. */
	.ilu-langdd .ilu-langdd__link {
		display: flex;
		align-items: center;
		min-height: 44px;
	}

	/* Шапка выезжающего меню (добавляется mobile.js): заголовок и кнопка «закрыть». */
	.ilu-mnav-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 56px;
		padding: 0 4px 0 20px;
		border-bottom: 1px solid var(--ilu-line);
		background-color: var(--ilu-navy);
		color: #fff;
	}

	.ilu-mnav-head__title {
		font-size: 14px;
		font-weight: 700;
		letter-spacing: .06em;
		text-transform: uppercase;
	}

	.ilu-mnav-head .ilu-mnav-head__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		min-height: 0;
		margin: 0;
		padding: 0;
		border: 0;
		background: none;
		box-shadow: none;
		color: #fff;
		cursor: pointer;
	}

	.ilu-mnav-head .ilu-mnav-head__close:focus-visible {
		outline: 2px solid #fff;
		outline-offset: -6px;
	}

	/* Вложенные пункты меню были светло-серыми (низкий контраст). */
	.mobile-nav .wd-nav-mobile .wd-sub-menu li a {
		color: #3f3f4f;
	}

	/* Липкая шапка при прокрутке: тема оставляла только строку поиска (без бургера и корзины).
	   На мобильных липкой делаем основную строку: логотип · язык · телефон · избранное · корзина · бургер. */
	.whb-sticked .whb-general-header.whb-not-sticky-row {
		display: block;
	}

	.whb-sticked .whb-header-bottom.whb-sticky-row {
		display: none;
	}

	/* Каталог: кнопка «Filtrid» — тап-зона 44px по высоте. */
	.wd-show-sidebar-btn > a {
		min-height: 44px;
		padding-right: 12px;
	}

	/* Количество (товар, корзина): кнопки −/+ 40px вместо 25px. */
	.quantity input[type="button"],
	.quantity .minus,
	.quantity .plus {
		width: 40px;
		min-width: 40px;
		height: 44px;
	}

	.quantity input.qty,
	.quantity input[type="number"].qty {
		width: 48px;
		height: 44px;
	}

	/* Удаление товара в корзине: крестик 40×40. */
	.woocommerce-cart-form .product-remove a.remove {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
	}
}

/* ---------- ≤ 768px: телефоны ---------- */
@media (max-width: 768px) {
	/* Поля ввода ≥ 16px — иначе iOS увеличивает страницу при фокусе. */
	input[type="text"],
	input[type="email"],
	input[type="tel"],
	input[type="password"],
	input[type="search"],
	input[type="number"],
	input[type="url"],
	select,
	textarea,
	.quantity input.qty,
	.select2-container .select2-selection--single .select2-selection__rendered {
		font-size: 16px;
	}

	/* Товар: количество + «Lisa ostukorvi» в одну строку, кнопка на всю оставшуюся ширину. */
	.single-product .summary form.cart:not(.variations_form),
	.single-product .summary .woocommerce-variation-add-to-cart {
		display: flex;
		flex-wrap: wrap;
		align-items: stretch;
		gap: 10px;
	}

	.single-product .summary form.cart .quantity {
		margin: 0;
	}

	.single-product .summary form.cart .single_add_to_cart_button {
		flex: 1 1 160px;
		min-height: 44px;
		margin: 0;
	}

	/* Каталог: сортировка-иконка 44×44 вместо 30×30. */
	.woocommerce-ordering.wd-ordering-mb-icon {
		width: 44px;
		height: 44px;
		margin-right: -7px;
	}

	/* Крошки и «Kuvatakse 1–18 …» — в две строки, иначе на 375px счётчик упирается в край. */
	.shop-loop-head > .wd-shop-tools:first-child {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}

	.shop-loop-head .woocommerce-result-count {
		margin: 0;
		color: var(--ilu-muted);
		font-size: 13px;
	}

	/* Пагинация: номера 40×40. */
	.woocommerce-pagination .page-numbers > li > .page-numbers {
		min-width: 40px;
		height: 40px;
	}

	/* Касса: блок «Ваш заказ» — меньше вложенных отступов, на 375px текст не жмётся. */
	.woocommerce-checkout form.checkout .checkout-order-review {
		padding-inline: 12px;
	}

	.woocommerce-checkout .woocommerce-checkout-review-order .wd-table-wrapper {
		padding-inline: 14px;
	}
}

/* ---------- ≤ 480px: узкие телефоны (375–414) — шапка помещается целиком ---------- */
@media (max-width: 480px) {
	.whb-general-header > .container {
		padding-inline: 10px; /* строка колонок темы имеет margin -10px — край ровно по экрану */
	}

	.whb-general-header .whb-mobile-left .whb-ilulogomobile {
		padding-inline: 15px 4px;
	}

	.whb-ilulogomobile .wd-logo img {
		width: 112px;
	}

	.whb-header .whb-ilulangmobile {
		padding-inline: 0;
	}

	.whb-ilulangmobile .ilu-langdd .ilu-langdd__btn {
		min-width: 40px;
		padding: 0 6px;
	}

	.whb-general-header .whb-mobile-right .wd-tools-element > a {
		padding-inline: 7px;
	}

	.whb-general-header .whb-mobile-right .wd-header-mobile-nav > a {
		padding-right: 15px;
	}
}

/* ---------- ≤ 359px: самые узкие телефоны (320px) — телефон в шапке скрываем (он есть в подвале и на «Kontakt») ---------- */
@media (max-width: 359px) {
	.whb-header .whb-ilutextphone {
		display: none;
	}

	.whb-ilulogomobile .wd-logo img {
		width: 100px;
	}
}
