/* Chicet Samples page ([chicet_samples]). Uses the redesign's --chicet-* tokens,
   with fallbacks so it still reads correctly on the old design. */

.chicet-samples {
	--s-ink: var(--chicet-ink, #111416);
	--s-muted: var(--chicet-muted, #5a6268);
	--s-line: var(--chicet-line, #dde1e3);
	--s-page: var(--chicet-page, #f3f4f4);
	--s-surface: var(--chicet-surface, #ffffff);
	--s-pink: var(--chicet-pink, #c8326a);
	--s-sans: var(--chicet-sans, 'Instrument Sans'), system-ui, sans-serif;
	--s-mono: var(--chicet-mono, 'IBM Plex Mono'), ui-monospace, monospace;
	font-family: var(--s-sans);
	color: var(--s-ink);
	font-size: 16px;
	line-height: 1.5;
}

.chicet-samples *,
.chicet-samples *::before,
.chicet-samples *::after { box-sizing: border-box; }

.chicet-samples__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 48px;
	align-items: start;
}

.chicet-samples__lede {
	margin: 0 0 16px;
	max-width: 640px;
	font-size: 17px;
	color: var(--s-muted);
}

.chicet-samples__rules {
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chicet-samples__rules li {
	padding: 6px 14px;
	border: 1px solid var(--s-line);
	border-radius: 999px;
	font-size: 14px;
	color: var(--s-ink);
	background: var(--s-surface);
}

/* Categories */

.chicet-samples__groups { border-top: 1px solid var(--s-line); }

.chicet-samples__group { border-bottom: 1px solid var(--s-line); }

.chicet-samples__summary {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 72px;
	padding: 16px 4px;
	cursor: pointer;
	list-style: none;
}

.chicet-samples__summary::-webkit-details-marker { display: none; }

.chicet-samples__summary:focus-visible {
	outline: 2px solid var(--s-pink);
	outline-offset: 2px;
	border-radius: 4px;
}

.chicet-samples__heading {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.chicet-samples__title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.chicet-samples__meta { font-size: 14px; color: var(--s-muted); }

.chicet-samples__picked {
	flex: none;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--s-ink);
	color: #ffffff;
	font-family: var(--s-mono);
	font-size: 12px;
	font-weight: 500;
}

.chicet-samples__picked[hidden] { display: none; }

.chicet-samples__chevron { flex: none; color: var(--s-muted); transition: transform 0.2s ease; }

.chicet-samples__group[open] > .chicet-samples__summary .chicet-samples__chevron { transform: rotate(180deg); }

/* Sample rows */

.chicet-samples__list { list-style: none; margin: 0; padding: 0 0 16px; }

.chicet-samples__item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 16px;
	padding: 12px 4px;
	border-top: 1px solid var(--s-line);
}

.chicet-samples__item:first-child { border-top: 0; }

.chicet-samples__thumb {
	width: 56px;
	height: 56px;
	border: 1px solid var(--s-line);
	border-radius: 10px;
	background: var(--s-surface);
	overflow: hidden;
}

.chicet-samples__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.chicet-samples__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.chicet-samples__name { font-size: 16px; font-weight: 500; color: var(--s-ink); cursor: default; }

.chicet-samples__note { font-size: 13px; color: var(--s-muted); }

.chicet-samples__note a { color: var(--s-muted); text-decoration: underline; text-underline-offset: 2px; }

.chicet-samples__note a:hover { color: var(--s-pink); }

.chicet-samples__price { font-family: var(--s-mono); font-size: 15px; font-weight: 500; text-align: right; }

/* The same pill stepper as the product page */
.chicet-samples__stepper {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	width: 124px;
	height: 44px;
	padding-inline: 2px;
	border: 1px solid var(--s-line);
	border-radius: 999px;
	background: var(--s-surface);
}

.chicet-samples__item.is-picked .chicet-samples__stepper { border-color: var(--s-ink); }

.chicet-samples__step {
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--s-ink);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.chicet-samples__step:hover:not(:disabled) { background: var(--s-page); }

.chicet-samples__step:disabled { color: var(--s-line); cursor: default; }

.chicet-samples__step:focus-visible,
.chicet-samples__qty:focus-visible { outline: 2px solid var(--s-pink); outline-offset: 1px; }

.chicet-samples .chicet-samples__qty {
	width: 36px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-family: var(--s-mono);
	font-size: 15px;
	font-weight: 500;
	text-align: center;
	color: var(--s-ink);
	-moz-appearance: textfield;
	appearance: textfield;
}

.chicet-samples__qty::-webkit-outer-spin-button,
.chicet-samples__qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Shipping table */

.chicet-samples__shipping { margin-top: 40px; max-width: 520px; color: var(--s-muted); font-size: 14px; }

.chicet-samples__subhead { margin: 0 0 12px; font-family: var(--s-sans); font-size: 18px; font-weight: 600; color: var(--s-ink); letter-spacing: -0.01em; }

.chicet-samples__tiers { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--s-line); }

.chicet-samples__tiers li {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--s-line);
	color: var(--s-ink);
	font-size: 15px;
}

.chicet-samples__tiers li span:last-child { font-family: var(--s-mono); }

.chicet-samples__shipping p { margin: 0; }

/* The kit */

.chicet-samples__kit {
	position: sticky;
	top: calc(var(--chicet-pinned-h, 0px) + 24px);
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	border: 1px solid var(--s-line);
	border-radius: 16px;
	background: var(--s-surface);
}

.chicet-samples__kit-toggle { display: none; }

.chicet-samples__kit-body { display: flex; flex-direction: column; gap: 12px; }

.chicet-samples__kit-title { margin: 0; font-family: var(--s-sans); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--s-ink); }

.chicet-samples__kit-empty { margin: 0; font-size: 14px; color: var(--s-muted); }

.chicet-samples__kit-empty[hidden],
.chicet-samples__kit-ship[hidden] { display: none; }

/* The remove buttons hang 8px past the row (margin-right: -8px) so the × lines
   up with the panel edge. The list reaches 8px into the panel's padding to hold
   them, or a scrolling list would also scroll sideways by those 8px. */
.chicet-samples__kit-list { list-style: none; margin: 0 -8px 0 0; padding: 0 8px 0 0; max-height: 40vh; overflow-x: hidden; overflow-y: auto; }

.chicet-samples__kit-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 14px;
}

.chicet-samples__kit-name { flex: 1 1 auto; min-width: 0; }

.chicet-samples__kit-price { flex: none; font-family: var(--s-mono); }

.chicet-samples .chicet-samples__kit-remove {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0 -8px 0 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--s-muted);
	cursor: pointer;
}

.chicet-samples .chicet-samples__kit-remove:hover { background: var(--s-page); color: var(--s-ink); }

.chicet-samples .chicet-samples__kit-remove:focus-visible { outline: 2px solid var(--s-pink); outline-offset: 1px; }

.chicet-samples__kit-ship { margin: 0; font-size: 13px; color: var(--s-muted); }

.chicet-samples__kit-foot { display: flex; flex-direction: column; gap: 12px; }

.chicet-samples__kit-total {
	display: flex;
	justify-content: space-between;
	padding-top: 16px;
	border-top: 1px solid var(--s-line);
	font-size: 16px;
	font-weight: 600;
}

.chicet-samples__kit-total span:last-child { font-family: var(--s-mono); }

.chicet-samples__kit-status { margin: 0; font-size: 13px; color: var(--s-ink); min-height: 0; }

.chicet-samples__kit-status.is-error { color: var(--s-pink); }

.chicet-samples__kit-status:empty { display: none; }

.chicet-samples .chicet-samples__add {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background: var(--s-ink);
	color: #ffffff;
	font-family: var(--s-sans);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
}

.chicet-samples a.chicet-samples__add,
.chicet-samples a.chicet-samples__add:hover { color: #ffffff; }

.chicet-samples .chicet-samples__add:hover:not(.is-disabled) { background: var(--s-pink); }

.chicet-samples .chicet-samples__add.is-disabled { opacity: 0.35; cursor: default; }

.chicet-samples .chicet-samples__view-cart {
	align-self: center;
	min-height: 32px;
	margin: 0;
	padding: 0 8px;
	border: 0;
	background: none;
	color: var(--s-ink);
	font-family: var(--s-sans);
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.chicet-samples .chicet-samples__view-cart:hover { color: var(--s-pink); }

/* Tablet and phone: one column, the kit becomes a bar fixed to the bottom
   that opens upward to show the list. */
@media (max-width: 1024px) {
	.chicet-samples__layout { grid-template-columns: minmax(0, 1fr); gap: 0; }

	.chicet-samples { padding-bottom: 140px; }

	.chicet-samples__kit {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		z-index: 9990;
		gap: 12px;
		padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
		border-radius: 16px 16px 0 0;
		background: var(--s-surface);
		box-shadow: 0 -8px 24px rgba(17, 20, 22, 0.12);
		max-height: 85vh;
	}

	.chicet-samples__kit-toggle {
		display: flex;
		align-items: center;
		gap: 12px;
		width: 100%;
		min-height: 44px;
		padding: 0 4px;
		margin: 0;
		border: 0;
		background: none;
		color: var(--s-ink);
		font-family: var(--s-sans);
		font-size: 15px;
		font-weight: 600;
		text-align: left;
		cursor: pointer;
	}

	.chicet-samples__kit-toggle > span:first-child { flex: 1 1 auto; }

	.chicet-samples__kit-toggle-total { font-family: var(--s-mono); font-weight: 500; }

	.chicet-samples__kit-toggle .chicet-samples__chevron { transform: rotate(180deg); }

	.chicet-samples__kit.is-open .chicet-samples__kit-toggle .chicet-samples__chevron { transform: none; }

	.chicet-samples__kit-body { display: none; overflow-y: auto; }

	.chicet-samples__kit.is-open .chicet-samples__kit-body { display: flex; }

	/* The toggle row already says what this is. */
	.chicet-samples__kit-title { display: none; }

	.chicet-samples__kit-list { max-height: 45vh; }

	.chicet-samples__kit-total { display: none; }

}

/* FunnelKit's floating cart button. Above the kit bar it sat over the right-hand
   column, where every sample's + button is, and swallowed taps. The bar already
   has Checkout and View cart (which opens the same drawer), so on this page it
   goes. The body class is set by samples.js while the bar is showing. */
@media (max-width: 1024px) {
	body.has-chicet-samples-bar #fkcart-floating-toggler { display: none !important; }
}

@media (max-width: 600px) {
	.chicet-samples__lede { font-size: 16px; }

	.chicet-samples__title { font-size: 18px; }

	.chicet-samples__item {
		grid-template-columns: 48px minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb info info"
			"thumb price stepper";
		row-gap: 8px;
		column-gap: 12px;
	}

	.chicet-samples__thumb { grid-area: thumb; width: 48px; height: 48px; align-self: start; }

	.chicet-samples__info { grid-area: info; }

	.chicet-samples__price { grid-area: price; text-align: left; }

	.chicet-samples__stepper { grid-area: stepper; }
}

@media (prefers-reduced-motion: reduce) {
	.chicet-samples__chevron { transition: none; }
}

/* Redesign, desktop: a wider, more compact panel that always fits the window
   once pinned, with the same 24px of air above it (under the pinned header and,
   when logged in, the WordPress toolbar) as below it: the panel is always the
   window's height less those gaps, and the list scrolls inside it, so the
   total and Checkout stay on screen. The site's text styles give every h2, ul and p
   in the panel a 24px bottom margin and list rows 18px type; here the panel's
   own gaps do the spacing instead. Scoped to the redesign; the classic skin
   keeps its own sizing (samples-classic.css). */
@media (min-width: 1025px) {
	.chicet-samples--redesign .chicet-samples__layout { grid-template-columns: minmax(0, 1fr) 380px; }

	.chicet-samples.chicet-samples--redesign .chicet-samples__kit {
		top: calc(var(--chicet-toolbar-h, 0px) + var(--chicet-pinned-h, 0px) + 24px);
		/* Always the full window less 24px above and below, so the gap under the
		   panel matches the gap over it. A short list leaves the room inside
		   the list area; a long one scrolls there. */
		height: calc(100vh - var(--chicet-toolbar-h, 0px) - var(--chicet-pinned-h, 0px) - 48px);
		gap: 12px;
		padding: 20px 24px;
	}

	.chicet-samples--redesign .chicet-samples__kit-body { flex: 1 1 auto; min-height: 0; gap: 12px; }

	.chicet-samples.chicet-samples--redesign .chicet-samples__kit-title { margin: 0 0 4px; font-size: 24px; line-height: 1.25; }

	/* The list takes whatever height the panel has left and scrolls past it. */
	.chicet-samples.chicet-samples--redesign .chicet-samples__kit-list { flex: 1 1 auto; min-height: 96px; max-height: none; margin-bottom: 0; }

	/* !important: the page template sets every p and li in post content to
	   18px !important (.elementor-widget-theme-post-content p …). */
	.chicet-samples.chicet-samples--redesign .chicet-samples__kit-list li { padding: 3px 0; font-size: 16px !important; line-height: 1.45; }

	.chicet-samples.chicet-samples--redesign .chicet-samples__kit-empty,
	.chicet-samples.chicet-samples--redesign .chicet-samples__kit-ship,
	.chicet-samples.chicet-samples--redesign .chicet-samples__kit-status { margin: 0; font-size: 15px !important; line-height: 1.5; }

	.chicet-samples.chicet-samples--redesign .chicet-samples__kit-foot { gap: 10px; }
}

/* Loading state: until the first cart state arrives after a (re)load, the
   redesign's panel shows a spinner instead of sitting blank and "0 samples".
   The classic skin never shows it. */
.chicet-samples__kit-loading { display: none; }

.chicet-samples--redesign .chicet-samples__kit.is-loading .chicet-samples__kit-loading {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 120px;
}

.chicet-samples--redesign .chicet-samples__kit.is-loading .chicet-samples__kit-list,
.chicet-samples--redesign .chicet-samples__kit.is-loading .chicet-samples__kit-empty,
.chicet-samples--redesign .chicet-samples__kit.is-loading .chicet-samples__kit-ship { display: none; }

.chicet-samples--redesign .chicet-samples__kit.is-loading .chicet-samples__kit-total,
.chicet-samples--redesign .chicet-samples__kit.is-loading [data-kit-total-short] { visibility: hidden; }

.chicet-samples--redesign .chicet-samples__spinner {
	width: 28px;
	height: 28px;
	border: 2px solid var(--s-line);
	border-top-color: var(--s-ink);
	border-radius: 50%;
	animation: chicet-samples-spin 0.8s linear infinite;
}

@keyframes chicet-samples-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.chicet-samples--redesign .chicet-samples__spinner { animation-duration: 2.4s; }
}

