/* Cowculator — beef share calculator. */

.cowc {
	--cowc-accent: var(--fs-color-primary, var(--primary-color, #4d5e3f));
	--cowc-ink: #2a2723;
	--cowc-cream: #f5f1ea;
	--cowc-tan: #ddcfb8;
	--cowc-card: #fffdf9;
	--cowc-line: rgba(42, 39, 35, 0.12);
	--cowc-text: #2b2b2b;
	--cowc-muted: #6d675e;
	container-type: inline-size;
	margin: 0 0 1.5em;
	color: var(--cowc-text);
	text-align: left;
}

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

.cowc-inner {
	background: var(--cowc-card);
	border: 1px solid var(--cowc-line);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.18);
}

/* Header band ---------------------------------------------------------- */

.cowc-head {
	position: relative;
	padding: 22px 24px 20px;
	text-align: center;
	color: #f5f1ea;
	background:
		repeating-conic-gradient(from 0deg at 50% 140%, rgba(255, 255, 255, 0.045) 0deg 3deg, transparent 3deg 7deg),
		var(--cowc-ink);
}

.cowc .cowc-title {
	margin: 0;
	color: #f5f1ea;
	font-size: 32px;
	line-height: 1.1;
	font-weight: 400;
	letter-spacing: 0.01em;
}

.cowc .cowc-sub {
	margin: 8px auto 0;
	max-width: 32em;
	color: var(--cowc-tan);
	font-size: 11px;
	line-height: 1.5;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* Layout --------------------------------------------------------------- */

.cowc-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 22px;
	padding: 20px;
}

.cowc-main,
.cowc-side {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

@container (min-width: 640px) {
	.cowc--auto .cowc-body {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
		gap: 32px;
		padding: 28px;
	}
}

@container (min-width: 560px) {
	.cowc--wide .cowc-body {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
		gap: 32px;
		padding: 28px;
	}
	.cowc--wide .cowc-head,
	.cowc--auto .cowc-head {
		padding: 28px 32px 26px;
	}
	.cowc--wide .cowc-title,
	.cowc--auto .cowc-title {
		font-size: 40px;
	}
}

/* Share buttons -------------------------------------------------------- */

.cowc-shares {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
	gap: 4px;
	padding: 4px;
	border-radius: 10px;
	background: var(--cowc-cream);
}

.cowc--tall .cowc-shares {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cowc .cowc-share {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 6px 8px;
	border-radius: 7px;
	color: var(--cowc-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.cowc .cowc-share:hover {
	background: rgba(255, 255, 255, 0.7);
}

.cowc .cowc-share:focus-visible {
	outline: 2px solid var(--cowc-accent);
	outline-offset: 1px;
}

.cowc .cowc-share.is-active {
	background: var(--cowc-accent);
	color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

/* Cow ------------------------------------------------------------------ */

.cowc-cow {
	width: 100%;
	max-width: 360px;
	margin: 0 auto;
}

.cowc-cow svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.cowc-cow-base {
	fill: var(--cowc-tan);
}

.cowc-cow-fill {
	fill: var(--cowc-ink);
}

.cowc-ground {
	stroke: var(--cowc-line);
	stroke-width: 1.5;
	stroke-linecap: round;
}

/* Slider --------------------------------------------------------------- */

.cowc .cowc-slider-label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 10px;
	color: var(--cowc-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.cowc .cowc-weight {
	color: var(--cowc-text);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cowc .cowc-range {
	--pct: 0%;
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	touch-action: pan-y;
}

.cowc .cowc-range:focus {
	outline: none;
}

.cowc .cowc-range::-webkit-slider-runnable-track {
	height: 8px;
	border-radius: 99px;
	background: linear-gradient(to right, var(--cowc-accent) var(--pct), var(--cowc-tan) var(--pct));
}

.cowc .cowc-range::-moz-range-track {
	height: 8px;
	border-radius: 99px;
	background: linear-gradient(to right, var(--cowc-accent) var(--pct), var(--cowc-tan) var(--pct));
}

.cowc .cowc-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 28px;
	height: 28px;
	margin-top: -10px;
	border: 3px solid var(--cowc-accent);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	transition: transform 0.12s;
}

.cowc .cowc-range::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border: 3px solid var(--cowc-accent);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cowc .cowc-range:active::-webkit-slider-thumb {
	transform: scale(1.12);
}

.cowc .cowc-range:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--cowc-accent);
	outline-offset: 3px;
}

.cowc .cowc-range:focus-visible::-moz-range-thumb {
	outline: 2px solid var(--cowc-accent);
	outline-offset: 3px;
}

.cowc-ends {
	display: flex;
	justify-content: space-between;
	margin-top: 4px;
	color: var(--cowc-muted);
	font-size: 12px;
}

/* Hanging weight note -------------------------------------------------- */

.cowc .cowc-hanging {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 14px;
	line-height: 1.55;
}

.cowc .cowc-hanging summary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--cowc-accent);
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.cowc .cowc-hanging summary::-webkit-details-marker {
	display: none;
}

.cowc .cowc-hanging summary::before {
	content: "i";
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	font-family: Georgia, serif;
	font-size: 12px;
	font-style: italic;
	font-weight: 700;
	line-height: 1;
}

.cowc .cowc-hanging p {
	margin: 10px 0 0;
	padding: 12px 14px;
	border-left: 3px solid var(--cowc-accent);
	border-radius: 0 8px 8px 0;
	background: var(--cowc-cream);
	color: var(--cowc-text);
}

/* Price ---------------------------------------------------------------- */

.cowc-price {
	padding: 18px 20px;
	border-radius: 10px;
	background: var(--cowc-cream);
	text-align: center;
}

.cowc-price-label {
	color: var(--cowc-muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.cowc-tier-name {
	color: var(--cowc-text);
}

.cowc-price-total {
	margin: 4px 0 6px;
	color: var(--cowc-accent);
	font-size: 46px;
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
}

.cowc-price-math {
	display: flex;
	flex-direction: column;
	gap: 2px;
	color: var(--cowc-muted);
	font-size: 13px;
	line-height: 1.45;
}

/* Stats ---------------------------------------------------------------- */

.cowc-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

@container (max-width: 230px) {
	.cowc-stats {
		grid-template-columns: minmax(0, 1fr);
	}
}

.cowc-stat {
	position: relative;
	padding: 14px 14px 13px;
	border: 1px solid var(--cowc-line);
	border-radius: 10px;
	background: #fff;
}

.cowc-stat-label {
	color: var(--cowc-muted);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.cowc-stat-value {
	margin: 4px 0 2px;
	color: var(--cowc-text);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cowc-stat-value small {
	color: var(--cowc-muted);
	font-size: 13px;
	font-weight: 600;
}

.cowc-stat-note {
	color: var(--cowc-muted);
	font-size: 12px;
	line-height: 1.35;
}

.cowc-stat--freezer .cowc-stat-note {
	padding-right: 26px;
}

.cowc-freezer {
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 20px;
	height: auto;
}

.cowc-fz-body {
	fill: #eef0f2;
	stroke: #9aa2ab;
	stroke-width: 2;
}

.cowc-fz-fill {
	fill: var(--cowc-tan);
}

.cowc-fz-line {
	stroke: #9aa2ab;
	stroke-width: 1.5;
}

.cowc-fz-handle {
	fill: #9aa2ab;
}

/* CTA + fine print ----------------------------------------------------- */

.cowc a.cowc-cta,
.cowc a.cowc-cta:visited {
	display: block;
	padding: 14px 18px;
	border-radius: 8px;
	background: var(--cowc-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: filter 0.15s, transform 0.15s;
}

.cowc a.cowc-cta:hover {
	color: #fff;
	filter: brightness(1.1);
	transform: translateY(-1px);
}

.cowc .cowc-disclaimer {
	margin: 0;
	padding: 12px 20px 16px;
	border-top: 1px solid var(--cowc-line);
	color: var(--cowc-muted);
	font-size: 12px;
	line-height: 1.5;
	text-align: center;
}

/* Tall / narrow tuning -------------------------------------------------- */

@container (max-width: 360px) {
	.cowc-body {
		gap: 16px;
		padding: 16px;
	}
	.cowc-main,
	.cowc-side {
		gap: 14px;
	}
	.cowc .cowc-title {
		font-size: 26px;
	}
	.cowc-price {
		padding: 14px;
	}
	.cowc-price-total {
		font-size: 38px;
	}
	.cowc-stat {
		padding: 11px 11px 10px;
	}
	.cowc-stat-value {
		font-size: 22px;
	}
	.cowc-freezer {
		right: 10px;
		bottom: 10px;
		width: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cowc *,
	.cowc *::before,
	.cowc *::after {
		transition: none !important;
	}
}
