/**
 * Product Information block — packaged-food declarations.
 *
 * Loads only on single product pages that actually have declarations to show.
 * Colours are taken from the Nirsha child-theme tokens where they exist, with
 * literal fallbacks so the block still looks deliberate if the theme changes —
 * which is the reason this module lives in the plugin rather than the theme.
 */

.nirsha-food-info {
	/* Ink deliberately resolves to the ESPRESSO heading token, not the body
	   token: packaged-food declarations are the block a customer squints at, so
	   this table runs one step darker than ordinary body copy. */
	--nfi-ink: var(--nirsha-espresso, #201713);
	--nfi-muted: var(--nirsha-muted-ink, #7d6d60);
	--nfi-line: var(--nirsha-border, #e8ddcd);
	--nfi-line-soft: var(--nrs-line-2, #f0e7da);
	--nfi-surface: var(--nirsha-card, #fffdf8);
	--nfi-band: var(--nirsha-sand, #f2e8d8);
	--nfi-accent: var(--nirsha-cocoa, #3b241b);

	margin: 48px 0 8px;
	padding: 0;
	color: var(--nfi-ink);
	font-size: 15px;
	line-height: 1.65;
}

.nirsha-food-info__title {
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--nfi-line);
	font-size: 22px;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------- facts grid */

/* Flex rather than grid on purpose: auto-fit tracks would put all six facts on
   one row at desktop widths, and an explicit repeat() would leave empty tracks
   showing through the 1px separator background when a product declares fewer
   facts. Flex basis caps the row at four and never creates an empty cell. */
.nirsha-food-info__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 1px;
	margin: 0 0 28px;
	padding: 0;
	background: var(--nfi-line-soft);
	border: 1px solid var(--nfi-line-soft);
	border-radius: 8px;
	overflow: hidden;
}

.nirsha-food-info__fact {
	flex: 1 1 calc(25% - 1px);
	min-width: 170px;
	margin: 0;
	padding: 14px 16px;
	background: var(--nfi-surface);
}

.nirsha-food-info__fact dt {
	margin: 0 0 3px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--nfi-muted);
}

.nirsha-food-info__fact dd {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--nfi-ink);
}

/* ----------------------------------------------------- veg / non-veg wording */

/* The dot is decoration only: the word beside it always carries the meaning,
   and the dot is aria-hidden, so nothing depends on colour alone. */
.nirsha-food-info__veg {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.nirsha-food-info__veg-dot {
	width: 11px;
	height: 11px;
	flex: 0 0 auto;
	border: 1.5px solid currentColor;
	border-radius: 2px;
	position: relative;
}

.nirsha-food-info__veg-dot::after {
	content: "";
	position: absolute;
	inset: 2px;
	border-radius: 50%;
	background: currentColor;
}

/* REGULATED SYMBOL — DO NOT REBRAND.
   The green square-and-dot is the FSSAI vegetarian mark and the brown one is
   the non-vegetarian mark. Their colours are prescribed by the Food Safety and
   Standards (Packaging and Labelling) Regulations, not chosen by Nirsha, so
   they are deliberately excluded from the cocoa/gold palette and must stay as
   they are. This is the ONE place green survives outside a success state. */
.nirsha-food-info__veg--veg {
	color: #3f7a12;
}

.nirsha-food-info__veg--non-veg {
	color: #9a3412;
}

/* ------------------------------------------------------------------ sections */

.nirsha-food-info__section {
	margin: 0 0 26px;
}

.nirsha-food-info__section:last-child {
	margin-bottom: 0;
}

.nirsha-food-info__section h3 {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.3;
	letter-spacing: -0.005em;
}

.nirsha-food-info__section p {
	margin: 0 0 8px;
	max-width: 68ch;
}

.nirsha-food-info__section p:last-child {
	margin-bottom: 0;
}

.nirsha-food-info__basis,
.nirsha-food-info__advisory {
	color: var(--nfi-muted);
	font-size: 14px;
}

/* -------------------------------------------------------------------- tables */

/* Wide content scrolls inside its own container so the page body never does. */
.nirsha-food-info__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--nfi-line-soft);
	border-radius: 8px;
	background: var(--nfi-surface);
}

.nirsha-food-info__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: 14.5px;
}

.nirsha-food-info__table th,
.nirsha-food-info__table td {
	padding: 9px 16px;
	text-align: left;
	border: 0;
	border-bottom: 1px solid var(--nfi-line-soft);
	vertical-align: top;
}

.nirsha-food-info__table thead th {
	background: var(--nfi-band);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--nfi-muted);
	white-space: nowrap;
}

.nirsha-food-info__table tbody th {
	font-weight: 500;
	color: var(--nfi-ink);
}

.nirsha-food-info__table tbody tr:last-child th,
.nirsha-food-info__table tbody tr:last-child td {
	border-bottom: 0;
}

.nirsha-food-info__table td {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Nutrition fills its container like the pack-sizes table: an inner cap would
   leave an empty strip inside the bordered box on wide screens. */

/* ------------------------------------------------ manufacturer / packer list */

.nirsha-food-info__entities {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
}

.nirsha-food-info__entity {
	margin: 0;
}

.nirsha-food-info__entity dt {
	margin: 0 0 3px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--nfi-muted);
}

.nirsha-food-info__entity dd {
	margin: 0;
}

.nirsha-food-info__entity-name {
	display: block;
	font-weight: 600;
}

.nirsha-food-info__entity-addr {
	display: block;
	color: var(--nfi-muted);
	font-size: 14px;
}

/* ------------------------------------------------------------ customer care */

.nirsha-food-info__care {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 4px;
}

.nirsha-food-info__care li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nirsha-food-info__care-label {
	display: inline-block;
	min-width: 74px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--nfi-muted);
}

.nirsha-food-info__care a {
	color: var(--nfi-accent);
	text-underline-offset: 2px;
}

.nirsha-food-info__care a:focus-visible {
	outline: 2px solid var(--nfi-accent);
	outline-offset: 3px;
	border-radius: 2px;
}

/* -------------------------------------------------------------- narrow view */

@media (max-width: 600px) {
	.nirsha-food-info {
		margin-top: 36px;
	}

	.nirsha-food-info__title {
		font-size: 20px;
	}

	/* Two columns keeps the short facts readable without a tall single stack. */
	.nirsha-food-info__fact {
		flex-basis: calc(50% - 1px);
		min-width: 0;
		padding: 12px 13px;
	}

	.nirsha-food-info__fact dd {
		font-size: 15px;
	}

	.nirsha-food-info__table th,
	.nirsha-food-info__table td {
		padding: 8px 12px;
	}
}

@media (max-width: 380px) {
	/* At the narrowest widths a single column beats a cramped pair. */
	.nirsha-food-info__fact {
		flex-basis: 100%;
	}
}
