/*
 * Structural tokens (not editable in the settings panel), minimal reset and typography.
 * Editable tokens (--cw-color-*, --cw-font-*, --cw-radius, ...) come from the inline CSS of `cw-tokens`.
 */
:root {
	--cw-admin-bar-offset: 0px;
	--cw-z-cart-bar: 45;
	--cw-z-mobile-nav: 50;
	--cw-z-header: 1000;
	--cw-z-toast: 1050; /* Above the sticky header (the mobile toast overlaps it), below overlay and drawers. */
	--cw-z-overlay: 1090;
	--cw-z-drawer: 1100;
	--cw-radius-pill: 999px; /* Fully rounded ends (counters, pills). */
	--cw-control-h: 44px;
	--cw-control-h-sm: 36px;
	--cw-control-h-lg: 52px;
	--cw-input-h: 48px;
	--cw-mobile-nav-h: 72px;
	--cw-topbar-h: 38px;
	--cw-cart-bar-h: 56px;
	--cw-cart-bar-gap: 14px;
	--cw-sticky-buy-h: 82px; /* Mobile sticky buy bar of the product page: 12px top, 52px row, 18px bottom (safe area is added). */
}

.admin-bar {
	--cw-admin-bar-offset: 32px;
}

@media (max-width: 782px) {
	.admin-bar {
		--cw-admin-bar-offset: 46px;
	}
}

/* Below 600px WordPress makes the admin bar `position: absolute` (it scrolls away), so fixed and sticky elements
   must not reserve room for it. */
@media (max-width: 599px) {
	.admin-bar {
		--cw-admin-bar-offset: 0px;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	/* rem scale follows the base size token. */
	font-size: var(--cw-font-size-base);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--cw-color-bg);
	color: var(--cw-color-text-body);
	font-family: var(--cw-font-body);
	font-size: var(--cw-font-size-base);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body.cw-body--drawer-open {
	overflow: hidden;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

a:hover {
	color: var(--cw-color-ink);
	text-decoration: underline;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

h1,
h2,
h3,
h4,
.cw-h1,
.cw-h2,
.cw-h3,
.cw-display {
	margin: 0 0 .6em;
	color: var(--cw-color-ink);
	font-family: var(--cw-font-heading);
	font-weight: var(--cw-font-weight-heading);
	line-height: 1.15;
}

.cw-display {
	font-size: 3.375rem;
	letter-spacing: -.03em;
}

h1,
.cw-h1 {
	font-size: 2.375rem;
	letter-spacing: -.03em;
}

h2,
.cw-h2 {
	font-size: 1.625rem;
	letter-spacing: -.02em;
}

h3,
.cw-h3 {
	font-size: 1.25rem;
	letter-spacing: -.01em;
}

h4 {
	font-size: 1rem;
}

.cw-text-small {
	font-size: .8125rem;
}

p {
	margin: 0 0 1em;
}

:focus-visible {
	outline: 3px solid var(--cw-color-focus);
	outline-offset: 2px;
}

/* The [hidden] attribute must win over the "display" of any component (.cw-branch is display:flex, for example):
   one of the justified !important of DESIGN-SYSTEM §4. */
[hidden] {
	display: none !important;
}

.screen-reader-text,
.cw-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* The skip link moves the focus to <main> (tabindex="-1", programmatic only). It is not an interactive control
   and a ring around the whole page area would be noise, so no outline for that focus. */
#primary:focus {
	outline: none;
}

.cw-skip-link:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	width: auto;
	height: auto;
	padding: 12px 18px;
	clip-path: none;
	border-radius: var(--cw-radius);
	background: var(--cw-color-surface);
	box-shadow: var(--cw-shadow-md);
	font-weight: 600;
	text-decoration: none;
}

.cw-icon {
	display: block;
	width: 22px;
	height: 22px;
	flex: 0 0 auto;
}

.cw-icon-button {
	position: relative;
	display: grid;
	width: var(--cw-control-h);
	height: var(--cw-control-h);
	margin: 0;
	padding: 0;
	place-items: center;
	border: 0;
	background: transparent;
	color: var(--cw-color-ink);
	cursor: pointer;
}

.cw-icon-button:hover,
.cw-icon-button:focus-visible {
	color: var(--cw-color-text-2);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important; /* Accessibility: must beat component transitions. */
		transition-duration: .01ms !important; /* Accessibility: must beat component transitions. */
	}
}

/* Spinner of the busy controls (button.css, stepper.css): shared rotation. */
@keyframes cw-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cw-button[aria-busy="true"]::after,
	.cw-stepper[aria-busy="true"] .cw-stepper__value::after {
		animation-duration: 3s;
	}
}
