/* Калькулятор потребности семян — agromax.pro
 * Разметка и вид как у калькулятора пестицидов (классы ac-*), компактные размеры.
 * Все правила начинаются с #agroseedcalc / #asc-toggle: id перебивает стили темы,
 * поэтому кнопки и поля не «пропадают» из-за глобальных правил для button/input/span. */

#agroseedcalc, #agroseedcalc *, #asc-repl, #asc-repl *, .asc-wrap, .asc-wrap * { box-sizing: border-box; }
.asc-wrap { clear: both; float: none !important; width: 100%; max-width: 100%; margin: 12px 0; text-align: left; }
#agroseedcalc[hidden] { display: none !important; }

/* ---------- Кнопка в колонке покупки ---------- */
#asc-toggle {
	display: flex !important; align-items: center; justify-content: center; gap: 8px;
	width: 100% !important; height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 11px 16px !important;
	background: #fff !important; border: 1px solid #2f6b3a !important; border-radius: 8px !important; box-shadow: none !important;
	color: #2f6b3a !important; font-family: inherit !important; font-size: 15px !important; font-weight: 700 !important; line-height: 1.3 !important;
	text-transform: none !important; letter-spacing: 0 !important; text-shadow: none !important; cursor: pointer; opacity: 1 !important; visibility: visible !important;
}
#asc-toggle:hover, #asc-toggle.is-open { background: #f3f6f1 !important; }
#asc-toggle:before, #asc-toggle:after { display: none !important; content: none !important; }
#asc-toggle span, #asc-toggle svg { display: inline-block !important; color: #2f6b3a !important; background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; font-size: 15px !important; text-transform: none !important; }

/* ---------- Панель ---------- */
#agroseedcalc {
	clear: both; width: 100%; margin: 20px 0; padding: 20px 24px 22px;
	background: #fff; border: 2px solid #2f6b3a; border-radius: 12px;
	color: #222; font-size: 14px; line-height: 1.45; text-align: left;
}
#agroseedcalc .ac-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid #e3e8e0; }
#agroseedcalc .ac-eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #3f4f3f; }
#agroseedcalc .ac-bar-title { margin: 0 0 2px; font-size: 19px; font-weight: 700; line-height: 1.3; color: #1f2a1f; }
#agroseedcalc .ac-hint { font-size: 13px; color: #5f6b5f; }
#agroseedcalc .ac-hint a { color: #2f6b3a; text-decoration: underline; }
#agroseedcalc .ac-hint b { color: #1f2a1f; font-weight: 700; }

#agroseedcalc .ac-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }

/* шаги */
#agroseedcalc .ac-steps { display: grid; gap: 18px; align-content: start; }
#agroseedcalc .ac-step { margin: 0; }
#agroseedcalc .ac-label { display: block; margin: 0 0 8px !important; padding: 0 !important; font-size: 15px !important; font-weight: 700 !important; color: #1f2a1f !important; text-transform: none !important; }
#agroseedcalc .ac-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#agroseedcalc .ac-row .ac-label { margin-bottom: 0 !important; }
#agroseedcalc .ac-rate-out, #agroseedcalc .ac-rate-out output { font-size: 15px; font-weight: 700; color: #1f2a1f !important; white-space: nowrap; }
#agroseedcalc .ac-inline { display: inline-flex; align-items: center; gap: 10px; }
#agroseedcalc .ac-wrap { flex-wrap: wrap; gap: 10px 22px; }
#agroseedcalc .ac-unit { font-size: 14px; color: #5f6b5f; }
#agroseedcalc .ac-meta { padding-top: 12px; border-top: 1px dashed #e3e8e0; }

#agroseedcalc input.ac-input {
	width: 130px !important; height: 42px !important; margin: 0 !important; padding: 0 12px !important;
	background: #fff !important; border: 1px solid #c9d1c6 !important; border-radius: 6px !important; box-shadow: none !important;
	font-family: inherit !important; font-size: 18px !important; font-weight: 600 !important; color: #1f2a1f !important; line-height: 40px !important;
	-moz-appearance: textfield; appearance: textfield;
}
#agroseedcalc input.ac-input--sm { width: 84px !important; }
#agroseedcalc input.ac-input:focus { border-color: #2f6b3a !important; outline: none !important; }
#agroseedcalc input.ac-input::-webkit-outer-spin-button, #agroseedcalc input.ac-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* междурядья — как кнопки выбора культуры */
#agroseedcalc .ac-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#agroseedcalc .ac-chip { position: relative; display: inline-block; margin: 0 !important; padding: 0 !important; cursor: pointer; text-transform: none !important; font-size: 15px !important; }
#agroseedcalc .ac-chip input[type=radio] { position: absolute !important; opacity: 0 !important; width: 1px !important; height: 1px !important; margin: 0 !important; pointer-events: none; }
#agroseedcalc .ac-chip div.radio, #agroseedcalc .ac-chip div.radio span { display: contents !important; }
#agroseedcalc .ac-chip > span {
	display: inline-flex !important; align-items: center; height: 42px; padding: 0 20px !important;
	background: #fff !important; border: 1px solid #c9d1c6 !important; border-radius: 6px !important;
	color: #1f2a1f !important; font-size: 15px !important; font-weight: 600 !important; text-transform: none !important; transition: background .15s, border-color .15s;
}
#agroseedcalc .ac-chip:hover > span { border-color: #2f6b3a !important; }
#agroseedcalc .ac-chip input:checked + span,
#agroseedcalc .ac-chip:has(input:checked) > span:last-child { background: #2f6b3a !important; border-color: #2f6b3a !important; color: #fff !important; }
#agroseedcalc .ac-chip input:focus-visible + span { outline: 2px solid #2f6b3a; outline-offset: 2px; }

/* ползунок */
#agroseedcalc input.ac-range-input {
	--asc-fill: 50%;
	display: block; width: 100% !important; height: 6px !important; margin: 14px 0 8px !important; padding: 0 !important;
	-webkit-appearance: none; appearance: none; border: 0 !important; border-radius: 3px !important; box-shadow: none !important; outline: none; cursor: pointer;
	background: linear-gradient(90deg, #2f6b3a var(--asc-fill), #dfe5dc var(--asc-fill)) !important;
}
#agroseedcalc input.ac-range-input::-webkit-slider-runnable-track { height: 6px; background: transparent; border: 0; }
#agroseedcalc input.ac-range-input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #2f6b3a; border: 3px solid #fff; box-shadow: 0 0 0 2px #2f6b3a; }
#agroseedcalc input.ac-range-input::-moz-range-track { height: 6px; background: transparent; border: 0; }
#agroseedcalc input.ac-range-input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #2f6b3a; border: 3px solid #fff; box-shadow: 0 0 0 2px #2f6b3a; }
#agroseedcalc .ac-ticks { font-size: 12px; }

/* ---------- Ваш расчёт ---------- */
#agroseedcalc .ac-result { padding: 18px 20px; background: #f3f6f1; border: 1px solid #dfe5dc; border-radius: 10px; }
#agroseedcalc .ac-vol { margin: 2px 0 0; font-size: 34px; font-weight: 700; line-height: 1.1; color: #1f2a1f; }
#agroseedcalc .ac-sub { margin: 2px 0 12px; font-size: 13px; color: #4b5a4b; }
#agroseedcalc .ac-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
#agroseedcalc .ac-tile { padding: 9px 12px; background: #fff; border-radius: 6px; }
#agroseedcalc .ac-tile span { display: block; font-size: 12px; color: #5f6b5f; }
#agroseedcalc .ac-tile b { display: block; font-size: 17px; font-weight: 700; color: #1f2a1f; white-space: nowrap; }
#agroseedcalc .ac-good, #agroseedcalc .ac-warn { margin: 0 0 12px; padding: 9px 12px; border-radius: 6px; font-size: 13px; line-height: 1.4; }
#agroseedcalc .ac-good { background: #e3efe2; color: #1f2a1f; }
#agroseedcalc .ac-warn { background: #fff3d6; color: #6b5214; }
#agroseedcalc .ac-warn[hidden] { display: none !important; }

#agroseedcalc button.ac-btn, #agroseedcalc button.ac-btn-out {
	display: block !important; width: 100% !important; height: auto !important; min-height: 0 !important; margin: 0 0 8px !important; padding: 11px 14px !important;
	border-radius: 6px !important; box-shadow: none !important; text-shadow: none !important; opacity: 1 !important; visibility: visible !important;
	font-family: inherit !important; font-size: 15px !important; font-weight: 700 !important; line-height: 1.3 !important;
	text-transform: none !important; letter-spacing: 0 !important; text-align: center !important; text-indent: 0 !important; cursor: pointer; transition: background .15s;
}
#agroseedcalc button.ac-btn:before, #agroseedcalc button.ac-btn:after,
#agroseedcalc button.ac-btn-out:before, #agroseedcalc button.ac-btn-out:after { display: none !important; content: none !important; }
#agroseedcalc button.ac-btn { background: #2f6b3a !important; border: 1px solid #2f6b3a !important; color: #fff !important; }
#agroseedcalc button.ac-btn:hover { background: #255830 !important; }
#agroseedcalc button.ac-btn-out { background: #fff !important; border: 1px solid #2f6b3a !important; color: #2f6b3a !important; }
#agroseedcalc button.ac-btn-out:hover { background: #eef3ec !important; }
#agroseedcalc button.ac-btn:disabled, #agroseedcalc button.ac-btn-out:disabled { opacity: .5 !important; cursor: not-allowed; }
#agroseedcalc .ac-bar button.ac-open { flex: none; width: auto !important; margin: 0 !important; padding: 9px 36px !important; }

#quantity_wanted.asc-flash { box-shadow: 0 0 0 3px #2f6b3a !important; transition: box-shadow .3s; }

/* ---------- Снятый товар ---------- */
/* отметка в колонке покупки */
.asc-wrap .asc-disc-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 10px; padding: 12px 14px; background: #fff3d6; border-radius: 8px; color: #6b5214; font-size: 14px; }
.asc-wrap .asc-disc-note b { color: #1f2a1f; }
.asc-wrap .asc-disc-note a { color: #2f6b3a; font-weight: 700; text-decoration: underline; }

/* блок аналогов на всю ширину */
#asc-repl { clear: both; width: 100%; margin: 20px 0 0; padding: 0; background: #fff; border: 2px solid #2f6b3a; border-radius: 12px; overflow: hidden; color: #222; font-size: 14px; line-height: 1.45; text-align: left; }
#asc-repl .asc-repl-head { display: flex; align-items: center; gap: 14px; padding: 16px 24px; background: #fff3d6; border-bottom: 1px solid #f1e3b8; }
#asc-repl .asc-repl-ic { flex: none; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #f5c542; color: #fff; font-size: 18px; font-weight: 700; }
#asc-repl .asc-repl-text { flex: 1 1 auto; min-width: 0; }
#asc-repl .asc-repl-text b { display: block; font-size: 17px; font-weight: 700; color: #1f2a1f; }
#asc-repl .asc-repl-text p { margin: 2px 0 0; font-size: 14px; color: #6b5214; }
#asc-repl .asc-repl-text a { color: #2f6b3a; font-weight: 700; text-decoration: underline; }
#asc-repl[hidden] { display: none !important; }
#buy_block #asc-repl-link, .asc-wrap #asc-repl-link,
.asc-wrap button.asc-repl-toggle {
	display: inline !important; width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important;
	background: none !important; border: 0 !important; box-shadow: none !important; cursor: pointer;
	color: #2f6b3a !important; font: inherit !important; font-size: 14px !important; font-weight: 700 !important; text-decoration: underline !important; text-transform: none !important;
}
#asc-repl button.asc-repl-close {
	flex: none; width: auto !important; height: auto !important; margin: 0 !important; padding: 9px 24px !important;
	background: #fff !important; border: 1px solid #2f6b3a !important; border-radius: 6px !important; box-shadow: none !important; cursor: pointer;
	color: #2f6b3a !important; font: inherit !important; font-size: 14px !important; font-weight: 700 !important; text-transform: none !important;
}
#asc-repl button.asc-repl-close:hover { background: #f3f6f1 !important; }
#asc-repl .asc-alt-thumb--empty img { opacity: .8; }
#asc-repl .asc-repl-phone { flex: none; padding: 8px 16px; border: 1px solid #2f6b3a; border-radius: 6px; background: #fff; color: #2f6b3a !important; font-size: 13px; line-height: 1.35; text-align: center; text-decoration: none !important; }
#asc-repl .asc-repl-phone b { font-size: 15px; }
#asc-repl .asc-repl-phone:hover { background: #f3f6f1; }

#asc-repl .asc-alts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 18px 24px 22px; }
#asc-repl .asc-alt { display: flex; flex-direction: column; min-width: 0; padding: 14px; background: #f3f6f1; border: 1px solid #dfe5dc; border-radius: 10px; }
#asc-repl .asc-alt-thumb { display: flex; align-items: center; justify-content: center; height: 140px; margin: 0 0 12px; background: #fff; border-radius: 8px; overflow: hidden; }
#asc-repl .asc-alt-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
#asc-repl .asc-alt-body { flex: 1 1 auto; }
#asc-repl .asc-alt-name { display: block; font-size: 16px; font-weight: 700; color: #1f2a1f !important; text-decoration: none !important; }
#asc-repl .asc-alt-name:hover { color: #2f6b3a !important; }
#asc-repl .asc-alt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
#asc-repl .asc-alt-tags span { padding: 2px 8px; border-radius: 20px; background: #e3efe2; color: #2f6b3a; font-size: 12px; }
#asc-repl .asc-alt-stock { font-size: 13px; color: #2f6b3a; }
#asc-repl .asc-alt-calc { margin: 10px 0 12px; padding: 8px 10px; background: #fff; border-radius: 6px; font-size: 13px; color: #4b5a4b; }
#asc-repl .asc-alt-calc b { display: block; font-size: 16px; color: #1f2a1f; }
#asc-repl .asc-alt-btn { display: block; padding: 10px 14px; background: #2f6b3a; border-radius: 6px; color: #fff !important; font-size: 15px; font-weight: 700; text-align: center; text-decoration: none !important; }
#asc-repl .asc-alt-btn:hover { background: #255830; }
/* одна-две карточки не растягиваем на всю ширину */
#asc-repl .asc-alts:has(> .asc-alt:only-child) { grid-template-columns: minmax(0, 420px); }

/* ---------- Планшет и телефон ---------- */
@media (max-width: 991px) {
	#agroseedcalc .ac-grid { grid-template-columns: 1fr; gap: 20px; }
	#asc-repl .asc-alts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	#asc-repl .asc-alt--desktop { display: none; }
}
@media (max-width: 600px) {
	#agroseedcalc { padding: 16px 14px; border-radius: 10px; }
	#agroseedcalc .ac-bar { flex-direction: column; gap: 10px; }
	#agroseedcalc .ac-bar button.ac-open { width: 100% !important; }
	#agroseedcalc .ac-bar-title { font-size: 17px; }
	#agroseedcalc .ac-vol { font-size: 30px; }
	#agroseedcalc .ac-tile b { font-size: 15px; }
	#asc-repl .asc-repl-head { flex-wrap: wrap; padding: 14px 16px; }
	#asc-repl .asc-repl-ic { display: none; }
	#asc-repl .asc-repl-phone { width: 100%; }
	#asc-repl .asc-alts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 12px 16px; }
	#asc-repl .asc-alt--desktop { display: none; }
	#asc-repl .asc-alt { padding: 10px; }
	#asc-repl .asc-alt-thumb { height: 90px; }
	#asc-repl .asc-alt-name { font-size: 14px; }
	#asc-repl .asc-alt-calc b { font-size: 14px; }
	#asc-repl .asc-alt-btn { padding: 9px 8px; font-size: 14px; }
}

/* ссылка «Аналоги в наличии» — максимальная специфичность против правил темы */
#buy_block #asc-repl-link, .asc-wrap #asc-repl-link, #asc-repl-link:hover, #asc-repl-link:focus, #asc-repl-link:visited {
	display: inline !important; background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important;
	color: #2f6b3a !important; font-size: 14px !important; font-weight: 700 !important; text-decoration: underline !important;
	text-transform: none !important; text-shadow: none !important; opacity: 1 !important; visibility: visible !important; cursor: pointer;
}

/* ---------- Ссылка «Рассчитать потребность семян» под количеством ---------- */
#buy_block #asc-toggle, a#asc-toggle {
	display: inline-flex !important; align-items: center !important; gap: 8px !important; width: auto !important; height: auto !important; min-height: 0 !important;
	margin: 4px 0 14px !important; padding: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
	color: #2f6b3a !important; font-size: 15px !important; font-weight: 700 !important; line-height: 1.3 !important;
	text-decoration: none !important; text-transform: none !important; text-shadow: none !important; opacity: 1 !important; visibility: visible !important; cursor: pointer;
}
#buy_block #asc-toggle span, a#asc-toggle span {
	color: #2f6b3a !important; font-size: 15px !important; font-weight: 700 !important;
	border-bottom: 1px dashed #2f6b3a !important; padding: 0 !important; margin: 0 !important; background: none !important;
}
#buy_block #asc-toggle:hover span, a#asc-toggle:hover span { border-bottom-style: solid !important; }
#buy_block #asc-toggle svg, a#asc-toggle svg { flex: none; color: #2f6b3a !important; }
#buy_block #asc-toggle.is-open span:after, a#asc-toggle.is-open span:after { content: " ↑"; }

/* панель видна только после нажатия ссылки (класс ставит JS) — даже если тема переопределяет [hidden] */
/* Закрыт, пока стоит атрибут hidden (его снимает скрипт по клику).
 * Правило не зависит от версии скрипта: старый скрипт снимает hidden, новый — ещё и ставит класс. */
#agroseedcalc[hidden]:not(.asc-is-open) { display: none !important; }
#agroseedcalc.asc-is-open, #agroseedcalc:not([hidden]) { display: block !important; }
