/**
 * База нового дизайну: типографіка сторінки, контейнер, кнопки, чипи, пігулки.
 * Значення — з tokens.css (Figma: UI Kit → Atoms; design-spec/02-atoms.md).
 *
 * Старі стилі теми ще вантажаться (сторінки переводимо поступово), тому
 * компоненти задають усі важливі властивості самі, а не покладаються на скидання.
 */

/* Мінімальне скидання (раніше його давали старі стилі теми, які на нових сторінках не вантажаться).
   Усе через :where() — нульова специфічність, тож не перебиває стилі компонентів. */
:where(.sh-body) *, :where(.sh-body) *::before, :where(.sh-body) *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
:where(.sh-body) :where(img, svg, video, picture) { max-width: 100%; }
:where(.sh-body) img { height: auto; border-style: none; }
:where(.sh-body) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.sh-body) a { color: inherit; }
:where(.sh-body) :where(h1, h2, h3, h4, h5, h6) { margin-top: 0; font-weight: 600; }
:where(.sh-body) :where(ul, ol) { margin-top: 0; }
:where(.sh-body) table { border-collapse: collapse; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

body.sh-body {
	margin: 0;
	background: var(--sh-color-brand-white);
	color: var(--sh-color-text-primary);
	font-family: var(--sh-font);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* ── Контейнер: 1280 контенту, поля 80 / 40 / 16 ── */
.sh-container {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--sh-size-content) + 2 * var(--sh-gutter));
	margin-inline: auto;
	padding-inline: var(--sh-gutter);
}
@media (max-width: 1279px) { .sh-container { padding-inline: 40px; } }
@media (max-width: 767px)  { .sh-container { padding-inline: var(--sh-gutter-mobile); } }

/* ── Доступність ── */
.sh-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.sh-skip {
	position: absolute;
	left: 16px; top: -100px;
	z-index: 10000;
	padding: 12px 20px;
	border-radius: var(--sh-radius-full);
	background: var(--sh-color-text-primary);
	color: #fff;
	font: 600 16px/1 var(--sh-font);
	text-decoration: none;
}
.sh-skip:focus { top: 16px; }
#sh-content:focus { outline: none; }

.sh-body :where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--sh-color-primary-accessible);
	outline-offset: 2px;
}

.sh-icon { display: block; flex: none; }

/* ── Кнопки (Button: Primary / Secondary / Tertiary), 44px ── */
.sh-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sh-space-10);
	min-height: 44px;
	padding: 12px 24px;
	border: 0;
	border-radius: var(--sh-radius-full);
	background: transparent;
	color: var(--sh-color-text-primary);
	font: 500 16px/1.25 var(--sh-font);
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--sh-transition), color var(--sh-transition), box-shadow var(--sh-transition), border-color var(--sh-transition);
}
.sh-btn--primary {
	background: var(--sh-color-primary-accessible);
	color: var(--sh-color-text-primary-dark);
	box-shadow: var(--sh-shadow-card);
}
.sh-btn--primary:hover { background: var(--sh-color-fill-black); color: #fff; }
.sh-btn--primary:active { background: var(--sh-color-text-secondary); }

.sh-btn--secondary {
	box-shadow: inset 0 0 0 1.5px var(--sh-color-text-primary);
}
.sh-btn--secondary:hover {
	background: var(--sh-color-fill-black);
	color: #fff;
	box-shadow: var(--sh-shadow-small);
}
.sh-btn--secondary:active { background: var(--sh-color-text-secondary); color: #fff; }

/* Старі стилі теми фарбують посилання (напр. .woocommerce-order a { color:#1f1f1f }) — кнопкам-посиланням колір задаємо сильніше */
.sh-body a.sh-btn--primary, .sh-body a.sh-btn--primary:hover, .sh-body a.sh-btn--primary:visited { color: var(--sh-color-text-primary-dark); }
.sh-body a.sh-btn--secondary, .sh-body a.sh-btn--secondary:visited, .sh-body a.sh-btn--tertiary { color: var(--sh-color-text-primary); }
.sh-body a.sh-btn--secondary:hover { color: #fff; }
.sh-body a.sh-btn--tertiary:hover { color: var(--sh-color-primary-dark); }

.sh-btn--tertiary { padding-inline: 0; min-height: 44px; }
.sh-btn--tertiary:hover { color: var(--sh-color-primary-dark); }
.sh-btn--tertiary:active { color: var(--sh-color-primary-pressed); }

.sh-btn:disabled, .sh-btn[aria-disabled="true"] {
	background: var(--sh-color-fill-grey);
	color: #fff;
	box-shadow: none;
	cursor: default;
}
.sh-btn--tertiary:disabled { background: none; color: var(--sh-color-text-quaternary); }
.sh-btn--block { width: 100%; }
.sh-btn--lg { min-height: 48px; }

/* ── Кнопка-іконка 44×44 ── */
.sh-iconbtn {
	box-sizing: border-box;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--sh-radius-full);
	background: transparent;
	color: var(--sh-color-text-primary);
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--sh-transition), color var(--sh-transition);
}
.sh-iconbtn:hover { background: var(--sh-color-bg-warm); }
.sh-iconbtn--white { background: var(--sh-color-brand-white); }

/* ── Чип (фільтри, мова) 40px ── */
.sh-chip {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 16px;
	border: 2px solid var(--sh-color-border-warm);
	border-radius: var(--sh-radius-full);
	background: var(--sh-color-brand-white);
	color: var(--sh-color-text-primary);
	font: 600 14px/1.2 var(--sh-font);
	text-decoration: none;
	cursor: pointer;
	transition: border-color var(--sh-transition), background-color var(--sh-transition), color var(--sh-transition);
}
.sh-chip:hover { border-color: var(--sh-color-text-primary); }
.sh-chip.is-selected,
.sh-chip[aria-pressed="true"] {
	border-color: var(--sh-color-text-primary);
	background: var(--sh-color-text-primary);
	color: #fff;
}

/* ── Пігулка месенджера 44px ── */
.sh-pill {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border-radius: var(--sh-radius-full);
	background: var(--sh-color-stroke-opaque);
	color: var(--sh-color-text-primary);
	font: 600 16px/20px var(--sh-font);
	text-decoration: none;
	transition: background-color var(--sh-transition);
}
.sh-pill:hover { background: var(--sh-color-fill-grey); }
.sh-pill--dark { background: var(--sh-color-white-12); color: #fff; }
.sh-pill--dark:hover { background: var(--sh-color-white-16); color: #fff; }

/* Блок «Питання? Напишіть нам» + пігулки */
.sh-help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sh-space-10);
}
.sh-help__text {
	flex-basis: 100%;
	margin: 0;
	color: var(--sh-color-text-muted);
	font: 500 14px/20px var(--sh-font);
}

/* ── Кількість (товар, кошик) ── */
.sh-qty {
	display: inline-flex;
	align-items: center;
	flex: none;
	box-sizing: border-box;
	width: 126px;
	height: 48px;
	border: 1px solid var(--sh-color-border-warm);
	border-radius: var(--sh-radius-full);
}
.sh-qty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: var(--sh-radius-full);
	background: none;
	color: var(--sh-color-text-primary);
	cursor: pointer;
}
.sh-qty__btn:hover { background: var(--sh-color-bg-warm); }
.sh-qty__input {
	width: 34px;
	min-width: 0;
	height: 46px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--sh-color-text-primary);
	font: 500 16px/1 var(--sh-font);
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}
.sh-qty__input::-webkit-outer-spin-button,
.sh-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }


@media (prefers-reduced-motion: reduce) {
	.sh-body *, .sh-body *::before, .sh-body *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* ── Рух: поява під час прокрутки, натискання кнопок (assets/js/motion.js) ── */
.sh-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sh-reveal.is-in { opacity: 1; transform: none; }
/* Горизонтальні каруселі (З цим купують, історії, чипи…): лише вбік, без вертикальної прокрутки всередині блоку;
   картки в них з'являються без підйому — інакше зсув створював зайву висоту і блок «гортався» вгору-вниз */
.sh-related__grid, .sh-stories__track, .sh-new__chips, .sh-catchips, .sh-hero__track, .sh-gallery__track, .sh-card__track { overflow-y: hidden; overscroll-behavior-y: auto; }
.sh-related__grid .sh-reveal, .sh-stories__track .sh-reveal { transform: none; }
.sh-related .sh-related__grid { padding-bottom: 8px; } /* зона натискання кружків кольору (−8px) не вилазить за край */
.sh-btn { transition: background-color var(--sh-transition), color var(--sh-transition), box-shadow var(--sh-transition), border-color var(--sh-transition), transform 0.12s ease; }
.sh-btn:active:not(:disabled) { transform: scale(0.97); }
.sh-chip:active, .sh-pill:active, .sh-iconbtn:active { transform: scale(0.95); }
.sh-cart-count.is-bump { animation: sh-bump 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes sh-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (hover: hover) {
	.sh-card__media { transition: box-shadow 0.3s ease; }
	.sh-card:hover .sh-card__media { box-shadow: 0 10px 28px -12px rgba(11, 11, 10, 0.28); }
	.sh-dash__card, .sh-info-card { transition: transform 0.25s ease, background-color var(--sh-transition); }
	.sh-dash__card:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
	.sh-reveal { opacity: 1; transform: none; transition: none; }
}

/* Старі шаблони сторінок (page-full.php: оформлення, «Дякуємо», оплата замовлення) обгортають вміст у .container,
   відступи якого давали старі стилі. На сторінках нового дизайну ті стилі не вантажаться — задаємо відступи тут. */
.sh-body .superhumans-main > .container {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--sh-size-content) + 2 * var(--sh-gutter));
	margin-inline: auto;
	padding-inline: var(--sh-gutter);
}
@media (max-width: 1279px) { .sh-body .superhumans-main > .container { padding-inline: 40px; } }
@media (max-width: 767px)  { .sh-body .superhumans-main > .container { padding-inline: var(--sh-gutter-mobile); } }

/* ── Сповіщення «Додано в кошик» / помилка (Figma: Push notification) ── */
.sh-toast {
	position: fixed;
	top: 125px;
	right: 80px;
	z-index: 1001;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 392px;
	max-width: calc(100vw - 32px);
	padding: 16px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.85);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	box-shadow: 0 2px 24px 2px rgba(126, 160, 160, 0.1), 0 8px 30px rgba(7, 7, 7, 0.08);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity 0.2s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}
.sh-toast.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s ease, transform 0.4s cubic-bezier(0.2, 1.2, 0.35, 1), visibility 0s; }
.sh-toast p { margin: 0; }
.sh-toast__content { display: flex; gap: 16px; align-items: flex-start; }
.sh-toast__media {
	flex: none; display: flex; align-items: center; justify-content: center;
	width: 80px; height: 80px; overflow: hidden; border-radius: 8px;
	background: #fff; box-shadow: 0 2px 18px 2px rgba(7, 7, 7, 0.05);
}
.sh-toast__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.sh-toast__media--error { background: #efe2dc; }
.sh-toast__media--error svg { fill: none; stroke: #cc0000; stroke-width: 2; stroke-linecap: round; }
.sh-toast__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 20px; }
.sh-toast__title { color: var(--sh-color-text-primary); font: 600 18px/1.2 var(--sh-font); }
.sh-toast__title--error { color: #cc0000; }
.sh-toast__desc { color: var(--sh-color-text-primary); font: 500 16px/1.5 var(--sh-font); }
.sh-toast__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sh-toast__actions--single { grid-template-columns: 1fr; }
.sh-toast__btn { min-height: 44px; padding: 0 16px; font-size: 15px; border-bottom: 0; white-space: nowrap; }
.sh-body .sh-toast a.sh-btn--primary { color: #fff; }
.sh-toast__link { display: none; align-self: flex-start; padding: 9px 0; border: 0; background: none; color: var(--sh-color-primary-dark); font: 600 16px/20px var(--sh-font); text-decoration: none; cursor: pointer; }
.sh-body .sh-toast a.sh-toast__link { color: var(--sh-color-primary-dark); border-bottom: 0; }
.sh-toast__timer { display: block; height: 3px; overflow: hidden; border-radius: 999px; background: rgba(11, 11, 10, 0.1); }
.sh-toast__timer span { display: block; height: 100%; border-radius: inherit; background: #d4441a; transform-origin: left; }
.sh-toast.is-open .sh-toast__timer span { animation: sh-toast-timer var(--sh-toast-ms, 6000ms) linear forwards; }
.sh-toast.is-paused .sh-toast__timer span { animation-play-state: paused; }
@keyframes sh-toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.sh-toast__close {
	position: absolute; top: 12px; right: 12px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; margin: -6px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: #000; cursor: pointer;
}
.sh-toast__close:hover { background: rgba(11, 11, 10, 0.06); }
.sh-toast__close path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* Фото, що «летить» у кошик, і кошик, що його «ловить» */
.sh-fly { position: fixed; z-index: 1002; object-fit: cover; border-radius: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); pointer-events: none; will-change: transform, opacity; }
.sh-header__cart.is-catch { animation: sh-catch 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes sh-catch { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-8deg); } 70% { transform: scale(0.95) rotate(4deg); } 100% { transform: none; } }

@media (max-width: 767px) {
	/* Телефон: знизу, компактніше; дії — посиланням «Перейти в кошик →» */
	.sh-toast { top: auto !important; right: 15px !important; bottom: calc(24px + env(safe-area-inset-bottom)); left: 15px; width: auto; max-width: none; padding: 8px; transform: translateY(16px); }
	.sh-toast__content { gap: 12px; }
	.sh-toast__title { font: 500 16px/20px var(--sh-font); }
	.sh-toast__desc { font: 500 14px/20px var(--sh-font); }
	.sh-toast__btn { display: none; }
	.sh-toast__link { display: inline-block; }
	.sh-toast__actions { display: flex; padding-left: 4px; }
}
@media (prefers-reduced-motion: reduce) {
	.sh-toast, .sh-toast.is-open { transform: none; transition: opacity 0.2s ease, visibility 0s; }
	.sh-header__cart.is-catch { animation: none; }
}
