/* Окно «Год выпуска по батч-коду» (batch_decoder.js): сайт и мастер товара в админке.
   Шрифт крупный — среди покупателей много людей в возрасте: поля 18px, подписи 16px. */

.bcd {
	--bcd-text: #222;
	--bcd-strong: #111;
	--bcd-muted: #555;
	--bcd-bg: #fff;
	--bcd-soft: #faf7f5;
	--bcd-border: #ddd;
	--bcd-accent: #6b1f2c;
	--bcd-accent-text: #fff;
	--bcd-ok: #2e6b30;
	--bcd-ok-bg: #eef6ee;
	--bcd-warn: #8a5300;
	--bcd-warn-bg: #fff6e5;
	--bcd-bad: #a32a1f;
	--bcd-bad-bg: #fdeeec;
	--bcd-input: #fff;
	color: var(--bcd-text);
	font-size: 16px;
	line-height: 1.45;
}

html.theme-dark .bcd {
	--bcd-text: var(--dt-text);
	--bcd-strong: var(--dt-text-strong);
	--bcd-muted: var(--dt-muted);
	--bcd-bg: var(--dt-surface);
	--bcd-soft: var(--dt-surface-2);
	--bcd-border: var(--dt-border);
	--bcd-accent: var(--dt-accent);
	--bcd-ok: var(--dt-success-text);
	--bcd-ok-bg: var(--dt-success-bg);
	--bcd-warn: var(--dt-warning-text);
	--bcd-warn-bg: var(--dt-warning-bg);
	--bcd-bad: var(--dt-danger-text);
	--bcd-bad-bg: var(--dt-danger-bg);
	--bcd-input: var(--dt-input);
}

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

.bcd.is-busy .bcd-output {
	opacity: .55;
	transition: opacity .15s;
}

/* --- Форма --- */

.bcd-field {
	display: block;
	margin: 0 0 12px;
	font-weight: normal;
}

.bcd-label {
	display: block;
	margin-bottom: 6px;
	font-size: 16px;
	font-weight: 600;
	color: var(--bcd-strong);
}

.bcd .bcd-input {
	width: 100%;
	height: 48px;
	padding: 8px 12px;
	border: 1px solid var(--bcd-border);
	border-radius: 6px;
	background: var(--bcd-input);
	color: var(--bcd-text);
	font-size: 18px;
}

.bcd .bcd-input:focus {
	outline: 2px solid var(--bcd-accent);
	outline-offset: 1px;
}

.bcd .bcd-code {
	font-family: Menlo, Consolas, "Courier New", monospace;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.bcd .bcd-code::placeholder {
	text-transform: none;
	letter-spacing: 0;
	font-family: inherit;
}

.bcd-code-row {
	display: flex;
	gap: 8px;
}

.bcd-code-row .bcd-input {
	flex: 1 1 auto;
	min-width: 0;
}

.bcd-submit {
	flex: 0 0 auto;
	height: 48px;
	padding: 0 20px;
	border: 0;
	border-radius: 6px;
	background: var(--bcd-accent);
	color: var(--bcd-accent-text);
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
}

.bcd-submit:disabled {
	opacity: .7;
	cursor: wait;
}

.bcd-where {
	margin: 0 0 12px;
	font-size: 16px;
}

.bcd-where > summary {
	cursor: pointer;
	color: var(--bcd-accent);
}

.bcd-where > p {
	margin: 8px 0 0;
	padding: 10px 12px;
	border-left: 3px solid var(--bcd-border);
	background: var(--bcd-soft);
	color: var(--bcd-text);
}

.bcd-flags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 20px;
	margin-bottom: 4px;
}

.bcd-switch {
	display: inline-flex;
	border: 1px solid var(--bcd-border);
	border-radius: 6px;
	overflow: hidden;
}

.bcd-switch-item {
	padding: 9px 14px;
	border: 0;
	background: var(--bcd-bg);
	color: var(--bcd-text);
	font-size: 16px;
	cursor: pointer;
}

.bcd-switch-item + .bcd-switch-item {
	border-left: 1px solid var(--bcd-border);
}

.bcd-switch-item.is-active {
	background: var(--bcd-soft);
	color: var(--bcd-strong);
	font-weight: 600;
	box-shadow: inset 0 -3px 0 var(--bcd-accent);
}

.bcd-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 16px;
	font-weight: normal;
	cursor: pointer;
}

.bcd-check input {
	width: 18px;
	height: 18px;
	margin: 0;
}

.bcd-message {
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 6px;
	background: var(--bcd-warn-bg);
	color: var(--bcd-warn);
}

/* --- Итог --- */

.bcd-output:not(:empty) {
	margin-top: 18px;
}

.bcd-result {
	padding: 14px 16px;
	border: 1px solid var(--bcd-border);
	border-left: 5px solid var(--bcd-muted);
	border-radius: 6px;
	background: var(--bcd-bg);
}

.bcd-result.is-exact,
.bcd-result.is-likely {
	border-left-color: var(--bcd-ok);
}

.bcd-result.is-ambiguous,
.bcd-result.is-range {
	border-left-color: var(--bcd-warn);
}

.bcd-result.is-conflict {
	border-left-color: var(--bcd-bad);
	background: var(--bcd-bad-bg);
}

.bcd-result-title {
	font-size: 16px;
	color: var(--bcd-muted);
}

.bcd-result-value {
	margin-top: 2px;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--bcd-strong);
}

.bcd-result-sub {
	margin-top: 6px;
	font-size: 16px;
	color: var(--bcd-muted);
}

.bcd-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.bcd-chip {
	padding: 4px 10px;
	border: 1px solid var(--bcd-border);
	border-radius: 14px;
	font-size: 15px;
	white-space: nowrap;
	cursor: default;
}

.bcd-chip.is-main {
	border-color: var(--bcd-ok);
	background: var(--bcd-ok-bg);
	color: var(--bcd-strong);
	font-weight: 600;
}

.bcd-chip.is-weak {
	color: var(--bcd-muted);
}

.bcd-chip.is-out {
	color: var(--bcd-muted);
	text-decoration: line-through;
	opacity: .65;
}

.bcd-note {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 6px;
	background: var(--bcd-warn-bg);
	color: var(--bcd-warn);
	font-size: 16px;
}

.bcd-note.is-muted {
	background: var(--bcd-soft);
	color: var(--bcd-muted);
}

.bcd-apply {
	margin-top: 12px;
	padding: 10px 16px;
	border: 1px solid var(--bcd-ok);
	border-radius: 6px;
	background: var(--bcd-ok-bg);
	color: var(--bcd-ok);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

/* --- Вопрос --- */

.bcd-question {
	margin-top: 14px;
	padding: 14px 16px;
	border: 1px solid var(--bcd-border);
	border-radius: 6px;
	background: var(--bcd-soft);
}

.bcd-question-kicker {
	font-size: 15px;
	color: var(--bcd-muted);
}

.bcd-question-text {
	margin-top: 2px;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--bcd-strong);
}

.bcd-question-hint {
	margin-top: 6px;
	font-size: 16px;
	color: var(--bcd-muted);
}

.bcd-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.bcd-option {
	min-height: 46px;
	padding: 8px 16px;
	border: 1px solid var(--bcd-border);
	border-radius: 6px;
	background: var(--bcd-bg);
	color: var(--bcd-strong);
	font-size: 17px;
	text-align: left;
	cursor: pointer;
}

.bcd-option:hover,
.bcd-option:focus-visible {
	border-color: var(--bcd-accent);
	box-shadow: inset 0 0 0 1px var(--bcd-accent);
}

.bcd-option.is-unknown {
	color: var(--bcd-muted);
}

/* Варианты со значками — плитки: картинка сверху, подпись снизу; лупа в углу — отдельная кнопка */
.bcd-tile {
	position: relative;
	display: flex;
	flex: 1 1 170px;
	max-width: 320px;
}

.bcd-tile > .bcd-option {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	width: 100%;
	padding: 10px;
	text-align: center;
}

.bcd-tile > .bcd-option.is-unknown,
.bcd-tile > .bcd-option.is-text {
	justify-content: center;
}

/* Широкая вырезка (состав) — плитка шире, чтобы мелкий текст читался */
.bcd-tile.is-wide {
	flex: 1 1 340px;
	max-width: 400px;
}

.bcd-option-img {
	display: block;
	max-width: 100%;
	max-height: 80px;
	border-radius: 4px;
}

.bcd-tile.is-wide .bcd-option-img {
	max-height: 120px;
}

.bcd-tile-zoom {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--bcd-border);
	border-radius: 50%;
	background: var(--bcd-bg);
	color: var(--bcd-accent);
	font-size: 16px;
	line-height: 32px;
	text-align: center;
	cursor: zoom-in;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.bcd-tile-zoom:hover,
.bcd-tile-zoom:focus-visible {
	border-color: var(--bcd-accent);
}

/* Миниатюра со значком лупы (под вопросом, «Где искать код») */
.bcd-zoomable {
	position: relative;
	display: inline-block;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	line-height: 0;
}

.bcd-zoomable img {
	display: block;
	border-radius: 4px;
}

.bcd-zoom-badge {
	position: absolute;
	right: 4px;
	bottom: 4px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #6b1f2c;
	font-size: 14px;
	line-height: 26px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.bcd-question-img {
	margin-top: 10px;
}

.bcd-question-img img {
	max-width: 200px;
	max-height: 110px;
}

/* Фото крупно — поверх страницы (вне .bcd, поэтому цвета свои) */
.bcd-zoom {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 12, 13, .94);
	cursor: zoom-out;
}

.bcd-zoom-figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
}

.bcd-zoom-img {
	display: block;
	max-width: min(1000px, 100%);
	max-height: calc(100vh - 110px);
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
}

.bcd-zoom-img[src] {
	cursor: zoom-in;
}

.bcd-zoom-tip {
	margin-top: 6px;
	color: rgba(255, 255, 255, .75);
	font-size: 15px;
	text-align: center;
}

/* Полный размер — с прокруткой */
.bcd-zoom.is-full {
	align-items: flex-start;
	justify-content: flex-start;
	overflow: auto;
	cursor: zoom-out;
}

.bcd-zoom.is-full .bcd-zoom-figure {
	max-width: none;
	max-height: none;
	margin: auto;
}

.bcd-zoom.is-full .bcd-zoom-img {
	max-width: none;
	max-height: none;
	cursor: zoom-out;
}

.bcd-zoom-caption {
	max-width: 800px;
	margin-top: 10px;
	color: #fff;
	font-size: 17px;
	line-height: 1.4;
	text-align: center;
}

.bcd-zoom-close {
	position: fixed;
	top: 10px;
	right: 14px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .15);
	color: #fff;
	font-size: 32px;
	line-height: 44px;
	cursor: pointer;
}

/* «Где искать код» — фото с подписями */
.bcd-photos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin-top: 10px;
}

.bcd-photo {
	margin: 0;
}

.bcd-photo-zoom {
	display: block;
	width: 100%;
}

.bcd-photo img {
	display: block;
	width: 100%;
	height: 150px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--bcd-border);
}

.bcd-photo figcaption {
	margin-top: 4px;
	font-size: 15px;
	line-height: 1.35;
	color: var(--bcd-muted);
}

/* --- Ответы и пояснение --- */

.bcd-answers {
	margin-top: 14px;
	font-size: 16px;
}

.bcd-answers-title {
	margin-bottom: 4px;
	font-weight: 600;
	color: var(--bcd-strong);
}

.bcd-answer {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	padding: 4px 0;
	border-bottom: 1px dashed var(--bcd-border);
}

.bcd-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--bcd-accent);
	font-size: 16px;
	text-decoration: underline;
	cursor: pointer;
}

.bcd-steps {
	margin-top: 14px;
	font-size: 16px;
}

.bcd-steps > summary {
	cursor: pointer;
	color: var(--bcd-accent);
}

.bcd-steps ol {
	margin: 8px 0 0;
	padding-left: 22px;
}

.bcd-steps li {
	margin-bottom: 6px;
}

.bcd-article {
	margin: 8px 0 0;
}

.bcd-article a {
	color: var(--bcd-accent);
}

@media (max-width: 480px) {
	.bcd-code-row {
		flex-direction: column;
	}

	.bcd-submit {
		width: 100%;
	}

	.bcd-option {
		flex: 1 1 100%;
	}

	.bcd-tile {
		flex: 1 1 calc(50% - 4px);
		max-width: none;
	}

	.bcd-tile.is-wide {
		flex-basis: 100%;
		max-width: none;
	}

	.bcd-photos {
		grid-template-columns: 1fr 1fr;
	}

	.bcd-photo img {
		height: 120px;
	}

	.bcd-result-value {
		font-size: 22px;
	}
}

/* Вопрос «какой аромат» — поиск по названию */
.bcd-aroma {
	margin-top: 12px;
}

.bcd-aroma-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.bcd-aroma-option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}

.bcd-aroma-year {
	font-size: 14px;
	color: var(--bcd-muted);
}

.bcd-aroma-empty {
	font-size: 16px;
	color: var(--bcd-muted);
}
