/*
 * Bonza PDP quick food calculator dialog (product-page/feed-calculator.php).
 *
 * Config checked: no plugin or Blocksy (WooCommerce Extra) toggle renders a
 * buy-box calculator pop-up; production's is its own theme code
 * (bs-script.js `.feed-popup`), and the standalone /dog-feeding-calculator/
 * page is a separate page, not this in-place dialog. So it is code.
 *
 * editor-friendly-ok: the dialog is printed by PHP in wp_footer, with no
 * block-editor surface to keep in sync, the same exception
 * product-page-marketing.css records. Colours still read the PDP tokens where
 * they exist, with literal fallbacks, because the dialog sits outside the
 * .bppm scope that defines them.
 *
 * Figma draws only the link that opens it, so the panel follows the PDP's
 * existing look: cream background, ink text, green pill button.
 */
.bpp-feed-calc {
	width: min(440px, calc(100% - 32px));
	max-width: none;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--bppm-cream, #F8EDE3);
	color: var(--bppm-ink, #2E2A2A);
	box-shadow: 0 12px 16px -4px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

.bpp-feed-calc::backdrop {
	background: rgba(46, 42, 42, 0.5);
}

.bpp-feed-calc__form {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 32px 24px 24px;
}

.bpp-feed-calc__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

/* Figma's PDP section heading style (Nominee Heavy, uppercase, brand green). */
.bpp-feed-calc__title {
	margin: 0;
	padding-right: 32px;
	font-family: 'Nominee', sans-serif;
	font-weight: 900;
	font-size: 20px;
	line-height: 24px;
	text-transform: uppercase;
	color: var(--bppm-green, #247B4E); /* 4.57:1 on #F8EDE3, large text at 20px heavy */
}

.bpp-feed-calc__entry {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.bpp-feed-calc__entry[hidden],
.bpp-feed-calc__result[hidden] {
	display: none;
}

/* Production's -/+ weight stepper. */
.bpp-feed-calc__number {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.bpp-feed-calc__step {
	width: 44px;
	height: 44px;
	border: 1px solid var(--bppm-green, #247B4E);
	border-radius: 999px;
	background: #FFFFFF;
	color: var(--bppm-green, #247B4E);
	font-family: var(--wp--preset--font-family--inter, "Inter", sans-serif); /* 86eyy8hud: Figma weight stepper '-' '+' is Inter Black 16px (I36250:89926;35253:80399, ...80401) */
	font-weight: 900;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

/* 86eyy8hud: the unit label next to the stepper is Inter Black 12px in Figma (I36250:89926;35253:80404). */
.bpp-feed-calc__number + span {
	font-family: var(--wp--preset--font-family--inter, "Inter", sans-serif);
	font-weight: 900;
	font-size: 12px;
}

.bpp-feed-calc__number input {
	text-align: center;
	-moz-appearance: textfield;
}

.bpp-feed-calc__number input::-webkit-outer-spin-button,
.bpp-feed-calc__number input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.bpp-feed-calc__input {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: 'Kobe1.1', sans-serif;
	font-size: 16px;
}

.bpp-feed-calc__input input {
	width: 96px;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid #D1D5DB;
	border-radius: 8px;
	background: #FFFFFF;
	color: inherit;
	font: inherit;
}

.bpp-feed-calc__input input[aria-invalid="true"] {
	border-color: #B42318;
}

.bpp-feed-calc__error {
	margin: 0;
	color: #B42318; /* 5.9:1 on #F8EDE3 */
	font-size: 14px;
}

/* Figma's primary button, as .bppm-btn--primary on the PDP. */
.bpp-feed-calc__submit {
	align-self: flex-start;
	padding: 16px 32px;
	border: 0;
	border-radius: 999px;
	background: var(--bppm-green, #247B4E);
	color: #FFFFFF; /* 5.23:1 on #247B4E */
	font-family: 'Nominee', sans-serif;
	font-weight: 900;
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.03), 0 12px 16px -4px rgba(0, 0, 0, 0.08);
	cursor: pointer;
}

.bpp-feed-calc__result p {
	margin: 0 0 12px;
	font-family: 'Kobe1.1', sans-serif;
	font-size: 16px;
	line-height: 22px;
}

.bpp-feed-calc__result a {
	color: var(--bppm-green, #247B4E);
	text-decoration: underline;
}

.bpp-feed-calc__close:focus-visible,
.bpp-feed-calc__step:focus-visible,
.bpp-feed-calc__submit:focus-visible,
.bpp-feed-calc__input input:focus-visible,
.bpp-feed-calc__result a:focus-visible {
	outline: 2px solid var(--bppm-ink, #2E2A2A);
	outline-offset: 2px;
}
