/**
 * Ingredient links, the tap-for-info sheet and the dictionary search (inc/ingredients.php,
 * assets/js/ingredients.js). Loaded on products, articles, the homepage and dictionary pages.
 */

/* An ingredient name that opens its info: green, dotted underline, small "i" after it. */
.sc-term {
	color: var(--sc-petrol, #0f5c5a) !important;
	background: var(--sc-petrol-soft, #e3eeec);
	border-radius: 6px;
	padding: 0 4px 1px;
	font-weight: 600;
	text-decoration: underline dotted !important;
	text-decoration-thickness: 1.5px !important;
	text-underline-offset: 5px;
	cursor: pointer;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	transition: background-color .15s, color .15s;
}

.sc-term::after,
.sc-term-demo::after {
	content: "";
	display: inline-block;
	width: .9em;
	height: .9em;
	margin-inline-start: 3px;
	vertical-align: -.1em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 4.6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm1.4 11h-2.8v-6.4h2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 4.6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm1.4 11h-2.8v-6.4h2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: .85;
}

.sc-term:hover,
.sc-term:focus-visible {
	background: var(--sc-petrol, #0f5c5a);
	color: #fff !important;
}

.sc-term:focus-visible {
	outline: 2px solid var(--sc-petrol, #0f5c5a);
	outline-offset: 2px;
}

/* One-line hint above a product's key ingredients. */
.sc-terms-hint {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px !important;
	padding: 8px 12px;
	border-radius: var(--sc-r-sm, 12px);
	background: var(--sc-bg, #faf8f5);
	border: 1px dashed var(--sc-petrol, #0f5c5a);
	color: var(--sc-ink, #1f2a2e);
	font-size: .8125rem;
	line-height: 1.8;
}

.sc-terms-hint > .sc-i {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--sc-petrol, #0f5c5a);
}

.sc-term-demo {
	color: var(--sc-petrol, #0f5c5a);
	background: var(--sc-petrol-soft, #e3eeec);
	border-radius: 6px;
	padding: 0 4px 1px;
	font-weight: 600;
	text-decoration: underline dotted;
	text-underline-offset: 5px;
}

/* Safety badges (sheet, entry page, checker). Gold stays reserved for authenticity. */
.sc-flag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 600;
	line-height: 1.9;
}

.sc-flag::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.sc-flag--ok {
	background: #e6f0ec;
	color: #2c6a59;
}

.sc-flag--care {
	background: var(--sc-coral-soft, #fbe9e1);
	color: var(--sc-coral-ink, #8a3e1f);
}

.sc-flag--no {
	background: #f8e4e1;
	color: #9b2c22;
}

.sc-flag--info {
	background: #fff;
	color: var(--sc-muted, #5c676b);
	border: 1px solid var(--sc-line, #e4dfd8);
}

/* Info sheet: bottom sheet on phones, small card on wider screens. */
.sc-sheet {
	position: fixed;
	inset: auto 0 0 0;
	width: 100%;
	max-width: none;
	max-height: 85vh;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 20px 20px 0 0;
	background: #fff;
	color: var(--sc-ink, #1f2a2e);
	font-family: var(--sc-font, inherit);
	box-shadow: 0 -10px 30px rgba(20, 30, 32, .18);
	overflow: auto;
	overscroll-behavior: contain;
}

.sc-sheet::backdrop {
	background: rgba(20, 30, 32, .45);
}

.sc-sheet[open] {
	animation: sc-sheet-up .22s ease-out;
}

@keyframes sc-sheet-up {
	from {
		transform: translateY(24px);
		opacity: .6;
	}
	to {
		transform: none;
		opacity: 1;
	}
}

.sc-sheet__in {
	display: grid;
	gap: 12px;
	padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
	direction: rtl;
	text-align: right;
}

.sc-sheet__grab {
	width: 40px;
	height: 4px;
	margin: 0 auto 2px;
	border-radius: 4px;
	background: var(--sc-line, #e4dfd8);
}

.sc-sheet__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.sc-sheet__eyebrow {
	color: var(--sc-petrol, #0f5c5a);
	font-size: .75rem;
	font-weight: 600;
}

.sc-sheet__title {
	margin: 2px 0 0;
	color: var(--sc-ink, #1f2a2e);
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.5;
}

.sc-sheet__en {
	display: block;
	color: var(--sc-muted, #5c676b);
	font-size: .875rem;
	font-weight: 500;
	text-align: right;
}

.sc-sheet__close {
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sc-bg, #faf8f5);
	color: var(--sc-ink, #1f2a2e);
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

/* Astra's button:hover/:focus colours must not reach the close button (the sheet focuses it on open). */
.sc-sheet .sc-sheet__close,
.sc-sheet .sc-sheet__close:hover,
.sc-sheet .sc-sheet__close:focus,
.sc-sheet .sc-sheet__close:active {
	background: var(--sc-bg, #faf8f5);
	color: var(--sc-ink, #1f2a2e);
	border: 0;
	box-shadow: none;
}
.sc-sheet .sc-sheet__close:focus-visible {
	outline: 2px solid var(--sc-petrol, #0f5c5a);
	outline-offset: 2px;
}

.sc-sheet__role {
	justify-self: start;
	padding: 3px 12px;
	border-radius: 999px;
	background: var(--sc-petrol-soft, #e3eeec);
	color: var(--sc-petrol, #0f5c5a);
	font-size: .8125rem;
	font-weight: 600;
}

.sc-sheet__sum {
	margin: 0;
	font-size: .9375rem;
	line-height: 2;
}

.sc-sheet__flags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.sc-sheet__more {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 16px;
	border-radius: var(--sc-r, 14px);
	background: var(--sc-petrol, #0f5c5a);
	color: #fff !important;
	font-weight: 700;
	text-decoration: none !important;
}

.sc-sheet__foot {
	margin: 0;
	color: var(--sc-muted, #5c676b);
	font-size: .75rem;
	text-align: center;
}

@media (min-width: 768px) {
	.sc-sheet {
		inset: 50% auto auto 50%;
		width: min(440px, 92vw);
		border-radius: 20px;
		transform: translate(-50%, -50%);
		box-shadow: 0 20px 50px rgba(20, 30, 32, .25);
	}

	.sc-sheet[open] {
		animation: none;
	}

	.sc-sheet__grab {
		display: none;
	}

	.sc-sheet__in {
		padding-top: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sc-sheet[open] {
		animation: none;
	}
}

/* Dictionary search with suggestions. 16px text so phones do not zoom in. */
.sc-isearch {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
	padding: 4px;
	border: 1px solid var(--sc-line, #e4dfd8);
	border-radius: var(--sc-r, 14px);
	background: var(--sc-bg, #faf8f5);
}

.sc-isearch:focus-within {
	border-color: var(--sc-petrol, #0f5c5a);
	box-shadow: 0 0 0 3px rgba(15, 92, 90, .15);
}

.sc-isearch__input {
	flex: 1;
	min-width: 0;
	height: 44px;
	margin: 0 !important;
	padding: 0 12px !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none;
	color: var(--sc-ink, #1f2a2e);
	font: inherit;
	font-size: 1rem !important;
}

.sc-isearch__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.sc-isearch__btn {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 11px;
	background: var(--sc-petrol, #0f5c5a);
	color: #fff;
	cursor: pointer;
}

.sc-isearch__btn .sc-i {
	width: 20px;
	height: 20px;
}

.sc-isearch__list {
	position: absolute;
	z-index: 60;
	top: calc(100% + 6px);
	right: 0;
	left: 0;
	max-height: 60vh;
	margin: 0;
	padding: 6px;
	overflow: auto;
	list-style: none;
	border: 1px solid var(--sc-line, #e4dfd8);
	border-radius: var(--sc-r, 14px);
	background: #fff;
	box-shadow: 0 14px 32px rgba(20, 30, 32, .14);
}

.sc-isearch__list[hidden] {
	display: none;
}

.sc-isearch__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 10px;
	cursor: pointer;
}

.sc-isearch__opt[aria-selected="true"],
.sc-isearch__opt:hover {
	background: var(--sc-petrol-soft, #e3eeec);
}

.sc-isearch__letter {
	flex: none;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--sc-petrol-soft, #e3eeec);
	color: var(--sc-petrol, #0f5c5a);
	font-weight: 800;
}

.sc-isearch__opt--hair .sc-isearch__letter {
	background: var(--sc-coral-soft, #fbe9e1);
	color: var(--sc-coral-ink, #8a3e1f);
}

.sc-isearch__txt {
	display: grid;
	min-width: 0;
	line-height: 1.6;
}

.sc-isearch__fa {
	color: var(--sc-ink, #1f2a2e);
	font-weight: 700;
}

.sc-isearch__en {
	color: var(--sc-muted, #5c676b);
	font-size: .8125rem;
	text-align: right;
}

.sc-isearch__role {
	color: var(--sc-muted, #5c676b);
	font-size: .75rem;
}

.sc-isearch__list mark {
	padding: 0;
	background: none;
	color: var(--sc-petrol, #0f5c5a);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sc-isearch__empty {
	padding: 10px;
	color: var(--sc-muted, #5c676b);
	font-size: .875rem;
	line-height: 1.9;
}

.sc-isearch__empty a,
.sc-isearch__all {
	color: var(--sc-petrol, #0f5c5a);
	font-weight: 600;
}

.sc-isearch__all {
	display: block;
	margin-top: 4px;
	padding: 10px;
	border-top: 1px solid var(--sc-line, #e4dfd8);
	font-size: .8125rem;
	text-decoration: none;
}

/* ---------- v2 (0.3.49): calmer ingredient links and a fuller info sheet ---------- */
.sc-term {
	background: none;
	padding: 0;
	border-radius: 3px;
	text-decoration: underline dotted !important;
	text-decoration-color: rgba(15, 92, 90, .55) !important;
	text-decoration-thickness: 1.5px !important;
	text-underline-offset: 6px;
}
.sc-term::after {
	content: none;
}
.sc-term:hover,
.sc-term:focus-visible {
	background: var(--sc-petrol-soft, #e3eeec);
	color: var(--sc-petrol, #0f5c5a) !important;
	text-decoration-style: solid !important;
}
.sc-terms-hint {
	gap: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--sc-muted, #5c676b);
	font-size: max(.89rem, 13.5px);
}
.sc-terms-hint > .sc-i {
	width: 16px;
	height: 16px;
}
.sc-dots {
	display: inline-flex;
	gap: 4px;
	direction: rtl;
}
.sc-dots i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sc-line, #e4dfd8);
}
.sc-dots i.is-on {
	background: var(--sc-petrol, #0f5c5a);
}
/* webapp.css also has a .sc-sheet (inset: 0) that pinned this sheet to the top of the screen
   on phones and half off-screen on desktop; dialog.sc-sheet is stronger. */
dialog.sc-sheet {
	inset: auto 0 0 0;
	max-height: 88vh;
	border-radius: 24px 24px 0 0;
}
.sc-sheet__in {
	gap: 16px;
	padding-inline: 20px;
}
.sc-sheet__top {
	align-items: center;
}
.sc-sheet__head {
	flex: 1;
	min-width: 0;
}
.sc-sheet__eyebrow {
	font-size: max(.82rem, 12.5px);
}
.sc-sheet__title {
	font-size: max(1.375rem, 20px);
	line-height: 1.45;
	outline: none;
}
.sc-sheet__en {
	display: inline-block;
	font-size: max(.89rem, 13.5px);
}
.sc-sheet__back,
.sc-sheet .sc-sheet__back:hover,
.sc-sheet .sc-sheet__back:focus {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sc-bg, #faf8f5);
	color: var(--sc-ink, #1f2a2e);
	box-shadow: none;
	cursor: pointer;
}
.sc-sheet__back .sc-i {
	width: 20px;
	height: 20px;
}
.sc-sheet .sc-sheet__back:focus-visible {
	outline: 2px solid var(--sc-petrol, #0f5c5a);
	outline-offset: 2px;
}
.sc-sheet__role {
	margin: -8px 0 0;
	padding: 0;
	background: none;
	border-radius: 0;
	justify-self: stretch;
	color: var(--sc-petrol, #0f5c5a);
	font-size: max(1rem, 15px);
	font-weight: 700;
	line-height: 1.8;
}
.sc-sheet__ev {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 8px;
}
.sc-ev {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 10px 12px;
	border: 1px solid var(--sc-line, #e4dfd8);
	border-radius: 14px;
	background: var(--sc-bg, #faf8f5);
}
.sc-ev__g {
	color: var(--sc-muted, #5c676b);
	font-size: max(.82rem, 12.5px);
}
.sc-ev__l {
	color: var(--sc-ink, #1f2a2e);
	font-size: max(.89rem, 13.5px);
	font-weight: 700;
}
.sc-sheet__sum {
	font-size: max(1rem, 15px);
	line-height: 1.95;
}
.sc-sheet__wait {
	display: grid;
	gap: 8px;
}
.sc-sheet__wait i {
	height: 46px;
	border-radius: 14px;
	background: #f1eeea;
	animation: sc-sheet-wait 1s ease-in-out infinite alternate;
}
@keyframes sc-sheet-wait {
	to {
		opacity: .45;
	}
}
.sc-sheet__facts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin: 0;
}
.sc-sheet__facts div {
	padding: 10px 12px;
	border-radius: 14px;
	background: var(--sc-petrol-soft, #e3eeec);
}
.sc-sheet__facts dt {
	color: var(--sc-muted, #5c676b);
	font-size: max(.82rem, 12.5px);
	font-weight: 500;
}
.sc-sheet__facts dd {
	margin: 2px 0 0;
	color: var(--sc-ink, #1f2a2e);
	font-size: max(.89rem, 13.5px);
	font-weight: 700;
	line-height: 1.7;
}
.sc-sheet__myth {
	border: 1px solid var(--sc-line, #e4dfd8);
	border-radius: 16px;
	background: #fff;
}
.sc-sheet__myth summary {
	display: grid;
	gap: 4px;
	padding: 14px 16px;
	list-style: none;
	cursor: pointer;
}
.sc-sheet__myth summary::-webkit-details-marker {
	display: none;
}
.sc-sheet__myth-k {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sc-coral-ink, #8a3e1f);
	font-size: max(.82rem, 12.5px);
	font-weight: 700;
}
.sc-sheet__myth-k .sc-i {
	width: 16px;
	height: 16px;
}
.sc-sheet__myth-q {
	font-size: max(1rem, 15px);
	font-weight: 700;
	line-height: 1.8;
}
.sc-sheet__myth-btn {
	justify-self: start;
	min-height: 32px;
	display: inline-flex;
	align-items: center;
	color: var(--sc-petrol, #0f5c5a);
	font-size: max(.89rem, 13.5px);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 4px;
}
.sc-sheet__myth[open] .sc-sheet__myth-btn {
	display: none;
}
.sc-sheet__myth p {
	margin: 0;
	padding: 0 16px 14px;
	font-size: max(1rem, 15px);
	line-height: 1.95;
}
.sc-sheet__myth p::before {
	content: "واقعیت: ";
	color: var(--sc-petrol, #0f5c5a);
	font-weight: 800;
}
.sc-sheet__sec h3 {
	margin: 0 0 8px;
	color: var(--sc-ink, #1f2a2e);
	font-size: max(1rem, 15px);
	font-weight: 800;
}
.sc-sheet__pairs,
.sc-sheet__care,
.sc-sheet__prods {
	margin: 0;
	padding: 0;
	list-style: none;
}
.sc-sheet__pairs {
	display: grid;
	gap: 6px;
}
.sc-sheet__pairs li {
	margin: 0;
}
.sc-sheet .sc-sheet__pairs button,
.sc-sheet .sc-sheet__pairs li > div {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	border: 1px solid var(--sc-line, #e4dfd8);
	border-radius: 14px;
	background: #fff;
	color: var(--sc-ink, #1f2a2e);
	font: inherit;
	text-align: right;
	box-shadow: none;
	cursor: pointer;
}
.sc-sheet .sc-sheet__pairs li > div {
	cursor: default;
}
.sc-sheet .sc-sheet__pairs button:hover,
.sc-sheet .sc-sheet__pairs button:focus {
	background: #fff;
	color: var(--sc-ink, #1f2a2e);
	border-color: var(--sc-petrol, #0f5c5a);
}
.sc-sheet .sc-sheet__pairs button:focus-visible {
	outline: 2px solid var(--sc-petrol, #0f5c5a);
	outline-offset: 2px;
}
.sc-sheet__pairs .sc-i {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--sc-petrol, #0f5c5a);
}
.sc-sheet__pair-t {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.sc-sheet__pair-t strong {
	color: var(--sc-petrol, #0f5c5a);
	font-size: max(1rem, 15px);
	font-weight: 700;
	line-height: 1.7;
}
.sc-sheet__pair-t span {
	color: var(--sc-muted, #5c676b);
	font-size: max(.89rem, 13.5px);
	line-height: 1.75;
}
.sc-sheet__care {
	display: grid;
	gap: 6px;
	margin-top: 8px;
}
.sc-sheet__care li {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 10px 12px;
	border-radius: 14px;
	background: var(--sc-coral-soft, #fbe9e1);
	color: var(--sc-ink, #1f2a2e);
	font-size: max(.89rem, 13.5px);
	line-height: 1.8;
}
.sc-sheet__care .sc-i {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 3px;
	color: var(--sc-coral-ink, #8a3e1f);
}
.sc-sheet__care strong {
	color: var(--sc-coral-ink, #8a3e1f);
}
.sc-sheet__prods {
	display: grid;
	gap: 8px;
}
.sc-sheet__prods li {
	margin: 0;
	min-width: 0;
}
.sc-sheet__prods a {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	grid-template-areas: "img name" "img price";
	column-gap: 12px;
	align-items: center;
	padding: 8px;
	border: 1px solid var(--sc-line, #e4dfd8);
	border-radius: 14px;
	background: #fff;
	color: var(--sc-ink, #1f2a2e) !important;
	text-decoration: none !important;
}
.sc-sheet__prods a:hover {
	border-color: var(--sc-petrol, #0f5c5a);
}
.sc-sheet__prod-img {
	grid-area: img;
	display: block;
	width: 56px;
	height: 56px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--sc-bg, #faf8f5);
}
.sc-sheet__prod-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.sc-sheet__prod-name {
	grid-area: name;
	align-self: end;
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: max(.89rem, 13.5px);
	font-weight: 600;
	line-height: 1.7;
}
.sc-sheet__prod-price {
	grid-area: price;
	align-self: start;
	font-size: max(.89rem, 13.5px);
	font-weight: 800;
}
.sc-sheet__cta {
	display: grid;
	gap: 4px;
}
.sc-sheet__guide {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	color: var(--sc-petrol, #0f5c5a) !important;
	font-weight: 700;
	text-decoration: none !important;
}
.sc-sheet__foot {
	font-size: max(.82rem, 12.5px);
}
@media (min-width: 768px) {
	dialog.sc-sheet {
		inset: 50% auto auto 50%;
		width: min(480px, 92vw);
		max-height: 86vh;
		border-radius: 24px;
	}
}
/* v2.1: never scroll sideways; the header (title + close) stays on top while the sheet scrolls. */
dialog.sc-sheet {
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
}
.sc-sheet__in,
.sc-sheet__in > * {
	min-width: 0;
	max-width: 100%;
}
.sc-sheet__in .sc-sheet__top {
	position: sticky;
	top: 0;
	z-index: 3;
	margin-inline: -20px;
	padding: 8px 20px;
	background: #fff;
	border-bottom: 1px solid transparent;
	transition: border-color .15s;
}
.sc-sheet.is-scrolled .sc-sheet__top {
	border-bottom-color: var(--sc-line, #e4dfd8);
}
.sc-sheet__title,
.sc-sheet__sum,
.sc-sheet__role,
.sc-sheet__facts dd,
.sc-sheet__myth-q,
.sc-sheet__pair-t span {
	overflow-wrap: anywhere;
}

