/* ============================================================
   Суши-бар «Такара» — дизайн-слой (v2.0)
   Наслаивается на style.css: единая система скруглений,
   карточки товаров, нижняя панель шапки без фиксации,
   мягкие тени, фокус-состояния, анимации.
   ============================================================ */

:root {
	--takara-accent: #f97327;
	--takara-accent-soft: rgba(249, 115, 39, 0.10);
	--takara-green: #23ac0c;
	--takara-green-soft: rgba(35, 172, 12, 0.10);
	--takara-check: #1a7d05;
	--takara-ink: #241f1c;
	--takara-muted: #6f6862;
	--takara-surface: #ffffff;
	--takara-bg: #fffdf4;
	--takara-line: rgba(36, 31, 28, 0.08);

	/* Единая шкала скруглений — больше нигде не «прыгает» */
	--takara-radius-sm: 10px;
	--takara-radius: 14px;
	--takara-radius-lg: 18px;
	--takara-pill: 999px;

	--takara-shadow-sm: 0 1px 3px rgba(36, 31, 28, 0.05);
	--takara-shadow: 0 10px 26px rgba(36, 31, 28, 0.07);
	--takara-shadow-lg: 0 16px 40px rgba(36, 31, 28, 0.12);
	--takara-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ----- Фон и типографика ----- */
body.wrapper {
	line-height: 1.55;
	background:
		radial-gradient(1100px 460px at 88% -8%, rgba(249, 115, 39, 0.06), transparent 60%),
		var(--takara-bg);
}

h1, h2, h3 {
	color: var(--takara-ink);
	text-wrap: balance;
	letter-spacing: -0.01em;
}

.main {
	scroll-margin-top: 90px;
}

html {
	scroll-behavior: smooth;
}

::-webkit-scrollbar {
	width: 10px;
}
::-webkit-scrollbar-thumb {
	border-radius: var(--takara-pill);
	background: rgba(249, 115, 39, 0.32);
}
::-webkit-scrollbar-thumb:hover {
	background: rgba(249, 115, 39, 0.5);
}

:focus-visible {
	border-radius: var(--takara-radius-sm);
	outline: 2px solid var(--takara-accent);
	outline-offset: 2px;
}

/* ============================================================
   Шапка: нижняя панель без фиксации (обычная, скруглённая пилюля)
   ============================================================ */
.header {
	position: static;
}

/* Логотип — без ховер-эффекта */
.logo img {
	transition: none;
}

/* Нижняя панель шапки — без фиксации: просто пилюля в потоке страницы */
.header__bottom {
	position: static;
	max-width: 1560px;
	padding: 12px 16px;
	margin: 26px auto 30px;
	border: 1px solid var(--takara-line);
	border-radius: var(--takara-pill);
	background: rgba(255, 253, 240, 0.92);
	box-shadow: var(--takara-shadow-sm);
}

.header__bottom .container {
	padding: 0 6px;
}

/* Track — обычная обёртка меню */
.header__bottom .main-menu__track {
	position: relative;
}

/* В спокойном состоянии — обычное меню: перенос по строкам, ничего не «слиплось» */
.header__bottom .main-menu__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin: 0;
	gap: 4px 6px;
}

.header__bottom .main-menu__list li {
	margin: 0;
	letter-spacing: 0.04em;
	white-space: normal;
	font-size: 14px;
}

/* Фиксации нет: однострочное меню и подсказка прокрутки убраны */

/* Подсказка «прокрутите меню»: видна только когда строчка не помещается */

/* Мягный градиент у края — визуально подсказывает, что меню продолжено */

.header__bottom .main-menu__list li a {
	display: flex;
	align-items: center;
	padding: 9px 14px;
	border-radius: var(--takara-pill);
	transition: background-color 0.25s var(--takara-ease), color 0.25s var(--takara-ease);
	gap: 8px;
}

.header__bottom .main-menu__list li a:hover {
	color: var(--takara-accent);
	background: var(--takara-accent-soft);
}

.header__bottom .main-menu__list li.current-menu-item a {
	color: var(--takara-accent);
	background: var(--takara-accent-soft);
	font-weight: 800;
}

.header__bottom .main-menu__list li a .icons {
	width: 18px;
	height: 18px;
	margin: 0;
}

/* Кнопка корзины */
.cart-btn {
	display: inline-flex;
	overflow: visible;
	align-items: center;
	height: auto;
	min-height: 44px;
	padding: 0 16px;
	border-radius: var(--takara-pill);
	transition: transform 0.25s var(--takara-ease), box-shadow 0.25s var(--takara-ease);
	gap: 10px;
}
.cart-btn:hover {
	box-shadow: var(--takara-shadow);
	transform: translateY(-2px);
}
/* Иконка корзины — возвращаем: span-обёртка должна иметь размер и display */
.cart-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}
.cart-btn__icon .cart-icon {
	display: inline-flex;
	width: 20px;
	height: 20px;
}
.cart-btn__icon .cart-icon svg {
	width: 100%;
	height: 100%;
}
.cart-btn__icon .cart-icon path {
	fill: #fff;
}
.cart-btn__wrapper {
	padding-left: 12px;
	margin-left: 0;
	border-left: 2px solid rgba(255, 255, 255, 0.45);
	gap: 2px;
}
.cart-btn__count {
	line-height: 1.1;
	font-size: 16px;
}
.cart-btn__price {
	white-space: nowrap;
}
/* Пульс корзины при добавлении товара (класс добавляет main.js) */
.cart-btn.is-pop {
	animation: takara-cart-pop 0.45s var(--takara-ease);
}
@keyframes takara-cart-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.08); }
	100% { transform: scale(1); }
}

/* ============================================================
   Карточки товаров: размер, воздух, кнопка всегда помещается
   ============================================================ */
.products {
	display: grid;
	margin: 24px 0 40px;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 16px;
}

.products li.product,
li.product {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 14px;
	margin: 0;
	border: 1px solid var(--takara-line);
	border-radius: var(--takara-radius);
	background: var(--takara-surface);
	box-shadow: var(--takara-shadow-sm);
	transition: transform 0.25s var(--takara-ease), box-shadow 0.25s var(--takara-ease), border-color 0.25s var(--takara-ease);
}

.products li.product:hover,
li.product:hover {
	border-color: rgba(249, 115, 39, 0.28);
	box-shadow: var(--takara-shadow);
	transform: translateY(-3px);
}

/* Отдельная «рамка» поверх карточки убрана — она не совпадала со скруглением */
.products li.product::after,
li.product::after {
	display: none;
}

.products li.product h2 {
	line-height: 1.35;
	margin-bottom: 6px;
	color: var(--takara-ink);
	font-size: 16px;
}

.product__img,
.product__img picture,
.product__img .ui-img,
.product__img img {
	border-radius: var(--takara-radius);
}

.product__img {
	overflow: hidden;
	margin-bottom: 10px;
}

.product__img picture {
	padding: 0;
	aspect-ratio: 1 / 1;
}

.product__img img {
	display: block;
	width: 100%;
	height: 100%;
	transition: transform 0.35s var(--takara-ease);
	object-fit: cover;
}

li.product:hover .product__img img {
	transform: scale(1.04);
}

/* Описание — ровно 3 строки, карточки одной высоты */
.product__description {
	display: -webkit-box;
	overflow: hidden;
	min-height: 58px;
	line-height: 1.45;
	margin-top: 0;
	color: var(--takara-muted);
	font-size: 13px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.product__footer {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: space-between;
	padding-top: 14px;
	margin-top: auto;
	gap: 10px;
}

.product__weight {
	color: var(--takara-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 12px;
	font-weight: 600;
}

.product__price {
	line-height: 1.1;
	color: var(--takara-ink);
	font-size: 20px;
	font-weight: 800;
}

.product__price .woocommerce-Price-amount {
	white-space: nowrap;
}

/* Кнопка «в корзину»: не сжимается и всегда влезает в карточку */
.product__btn,
.products li.product .product__btn {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	padding: 9px 14px;
	border: 0;
	border-radius: var(--takara-pill);
	color: #fff;
	background: var(--takara-accent);
	box-shadow: 0 4px 14px rgba(249, 115, 39, 0.22);
	transition: transform 0.2s var(--takara-ease), box-shadow 0.2s var(--takara-ease), filter 0.2s var(--takara-ease);
	white-space: nowrap;
	font-size: 12px;
	font-weight: 800;
	gap: 8px;
}

.product__btn:hover,
.products li.product .product__btn:hover {
	box-shadow: 0 8px 20px rgba(249, 115, 39, 0.3);
	transform: translateY(-2px);
	filter: brightness(1.05);
}

.product__btn:active {
	transform: translateY(0) scale(0.98);
}

.product__btn .cart-icon {
	display: inline-flex;
	width: 16px;
	height: 16px;
}

.product__btn .cart-icon path {
	fill: #fff;
}

.product__count {
	min-width: 32px;
	min-height: 32px;
	padding: 4px 8px;
	border-radius: var(--takara-pill);
	background: var(--takara-accent);
	font-size: 14px;
}

/* Метка «острое» остаётся как в базовом CSS (иконка перца),
   только приводим её к общей форме: мягкая пилюля без лишнего скругления */
.product [data-hot]::before {
	top: 8px;
	left: 8px;
	-webkit-transform: none;
	-ms-transform: none;
	transform: none;
}

/* Ланч-блок — те же скругления, что и у карточек */
.product-lanch__item {
	padding: 16px;
	border: 1px solid var(--takara-line);
	border-radius: var(--takara-radius);
	background: var(--takara-surface);
	box-shadow: var(--takara-shadow-sm);
}

.product-lanch__description {
	color: var(--takara-muted);
}

/* ============================================================
   Кнопки, поля, модальное окно — одна шкала скруглений
   ============================================================ */
.ui-btn,
button.ui-down,
button.ui-up {
	border-radius: var(--takara-pill);
	transition: transform 0.2s var(--takara-ease), box-shadow 0.2s var(--takara-ease), filter 0.2s var(--takara-ease);
}

.woocommerce form .form-row input.input-text,
.woocommerce form textarea,
.woocommerce-MyAccount-content input[type="text"],
.quantity .qty {
	padding: 10px 14px;
	border: 1px solid var(--takara-line);
	border-radius: var(--takara-radius-sm);
	background: var(--takara-surface);
	transition: border-color 0.2s var(--takara-ease), box-shadow 0.2s var(--takara-ease);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form textarea:focus,
.quantity .qty:focus {
	border-color: var(--takara-accent);
	outline: none;
	box-shadow: 0 0 0 3px rgba(249, 115, 39, 0.14);
}

.modal-container,
.banner--2 .banner__body,
.post__item,
.notfound {
	border-radius: var(--takara-radius-lg);
}

.modal-container,
.notfound,
.post__item {
	border: 1px solid var(--takara-line);
	background: var(--takara-surface);
	box-shadow: var(--takara-shadow);
}

.modal {
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.post__item {
	overflow: hidden;
}

.post__img img {
	width: 100%;
	object-fit: cover;
	aspect-ratio: 16 / 10;
}

.woocommerce-shipping-methods label,
.wc_payment_method label {
	position: relative;
	cursor: pointer;
}

.woocommerce-shipping-totals.shipping {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.woocommerce-terms-and-conditions-wrapper {
	margin-top: 20px;
}

.products--title {
	margin: 24px 0 24px;
	font-size: 24px;
}

.footer {
	border-top: 1px solid var(--takara-line);
}

.footer a:hover {
	color: var(--takara-accent);
}

/* ============================================================
   UI/UX-слой: микровзаимодействия, состояния, подсказки
   ============================================================ */

/* Появление карточек: мягкий «выезд» с небольшим каскадом */
.products li.product,
li.product {
	animation: takara-card-in 0.4s var(--takara-ease) both;
}
.products li.product:nth-child(1) { animation-delay: 0.04s; }
.products li.product:nth-child(2) { animation-delay: 0.08s; }
.products li.product:nth-child(3) { animation-delay: 0.12s; }
.products li.product:nth-child(4) { animation-delay: 0.16s; }
.products li.product:nth-child(5) { animation-delay: 0.2s; }
.products li.product:nth-child(6) { animation-delay: 0.24s; }
@keyframes takara-card-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Кнопки: отклик на нажатие */
.ui-btn:active,
.product__btn:active,
.cart-btn:active {
	transform: translateY(0) scale(0.97);
}

/* Подсветка активного пункта через aria-current */
.main-menu__list li a[aria-current="page"] {
	color: var(--takara-accent);
	background: var(--takara-accent-soft);
}

/* Счётчик карточки — бейдж, а не просто текст */
.product__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	min-height: 26px;
	padding: 3px 9px;
	border-radius: var(--takara-pill);
	color: var(--takara-accent);
	background: var(--takara-surface);
	font-size: 12px;
	font-weight: 800;
}

/* «Быстрый просмотр»: стрелка на картинке при наведении */
.product__img a {
	position: relative;
	display: block;
}
.product__img a::after {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: var(--takara-pill);
	opacity: 0;
	color: var(--takara-accent);
	background: rgba(255, 255, 255, 0.9);
	box-shadow: var(--takara-shadow-sm);
	content: "👍";
	transition: opacity 0.25s var(--takara-ease), transform 0.25s var(--takara-ease);
	transform: translateY(6px);
}
.product__img a:hover::after,
.product__img a:focus-visible::after {
	opacity: 1;
	transform: translateY(0);
}

/* Загрузка изображения: мягкий фон-скелетон под картинкой */
.product__img picture,
.product__img img {
	background: linear-gradient(180deg, rgba(249, 115, 39, 0.06), rgba(36, 31, 28, 0.04));
}

/* Счёт количества: пилюля с понятными +/- и откликом на нажатие */
.wc-qty {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.wc-qty label {
	color: var(--takara-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 11px;
	font-weight: 700;
}
.wc-qty__input {
	display: inline-flex;
	align-items: center;
	padding: 4px;
	border: 1px solid var(--takara-line);
	border-radius: var(--takara-pill);
	background: var(--takara-surface);
	box-shadow: var(--takara-shadow-sm);
	gap: 4px;
}
.wc-qty__input .qty {
	width: 54px;
	min-height: 34px;
	border: 0;
	border-radius: var(--takara-pill);
	background: transparent;
	text-align: center;
	font-size: 14px;
	font-weight: 800;
}
.wc-qty__input button.plus,
.wc-qty__input button.minus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: var(--takara-pill);
	color: var(--takara-ink);
	background: transparent;
	transition: background-color 0.2s var(--takara-ease), color 0.2s var(--takara-ease), transform 0.15s var(--takara-ease);
}
.wc-qty__input button:hover {
	color: var(--takara-accent);
	background: var(--takara-accent-soft);
}
.wc-qty__input button:active {
	transform: scale(0.92);
}

/* Строки корзины: карточка с воздухом, удаление — как action */
.woocommerce-cart .cart-list__item,
.cart_list li {
	display: flex;
	align-items: center;
	padding: 12px 14px;
	border: 1px solid var(--takara-line);
	border-radius: var(--takara-radius);
	background: var(--takara-surface);
	box-shadow: var(--takara-shadow-sm);
	gap: 14px;
}
.woocommerce .cart-list__remove a,
.cart_list .product-remove a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	border-radius: var(--takara-pill);
	background: var(--takara-accent-soft);
	transition: background-color 0.2s var(--takara-ease), color 0.2s var(--takara-ease);
}
.woocommerce .cart-list__remove a:hover,
.cart_list .product-remove a:hover {
	color: #fff;
	background: var(--takara-accent);
}

/* Пустая корзина — аккуратная панель, а не голый текст */
.cart-empty.woocommerce-info {
	padding: 30px 24px;
	border: 1px dashed var(--takara-line);
	border-radius: var(--takara-radius-lg);
	background: var(--takara-surface);
	box-shadow: var(--takara-shadow-sm);
}

/* Хлебные крошки, если они включены — пилюли */
.woocommerce-breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 20px;
	color: var(--takara-muted);
	font-size: 13px;
	gap: 8px;
}
.woocommerce-breadcrumb a {
	display: inline-flex;
	align-items: center;
	padding: 5px 10px;
	border-radius: var(--takara-pill);
	background: var(--takara-accent-soft);
	transition: background-color 0.2s var(--takara-ease);
}
.woocommerce-breadcrumb a:hover {
	background: rgba(249, 115, 39, 0.18);
}

/* Кнопки «наверх»/«вниз» — пилюля с тенью */
.ui-up,
.ui-down {
	border-radius: var(--takara-pill);
	box-shadow: var(--takara-shadow);
}

/* Уведомление о добавлении в корзину (класс добавляет main.js) */
.takara-toast {
	position: fixed;
	z-index: 200;
	right: 16px;
	bottom: 16px;
	display: flex;
	align-items: center;
	max-width: min(340px, calc(100vw - 32px));
	padding: 12px 16px;
	border: 1px solid var(--takara-line);
	border-radius: var(--takara-radius);
	opacity: 0;
	color: var(--takara-ink);
	background: var(--takara-surface);
	box-shadow: var(--takara-shadow-lg);
	transition: opacity 0.3s var(--takara-ease), transform 0.3s var(--takara-ease);
	transform: translateY(12px);
	gap: 10px;
}
.takara-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.takara-toast__dot {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: var(--takara-pill);
	color: var(--takara-check);
	background: var(--takara-green-soft);
}
.takara-toast__text {
	line-height: 1.35;
	font-size: 13px;
	font-weight: 600;
}
.takara-toast__link {
	color: var(--takara-accent);
	font-weight: 800;
}

/* ============================================================
   Мобильные: карточка не должна «сжимать» кнопку
   ============================================================ */
@media (max-width: 575.98px) {
	.products {
		margin: 16px 0 30px;
		grid-template-columns: repeat(2, minmax(150px, 1fr));
		gap: 12px;
	}

	.products li.product,
	li.product {
		max-width: none;
		padding: 12px;
	}

	.products li.product h2 {
		font-size: 14px;
	}

	.product__description {
		min-height: 38px;
		-webkit-line-clamp: 2;
	}

	.product__price {
		font-size: 16px;
	}

	/* текст кнопки не убираем — кнопка помещается целиком */
	.product__btn,
	.products li.product .product__btn {
		justify-content: center;
		width: 100%;
		padding: 8px 12px;
		font-size: 11px;
	}

	.product__footer {
		padding-top: 12px;
		gap: 8px;
	}
}

@media (max-width: 767.98px) {
	.header__bottom {
		padding: 10px 12px;
		margin: 20px auto 24px;
		border-radius: var(--takara-radius-lg);
	}
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}