/* Еко Няшки — єдина плитка товару (режим перегляду). Тема робить кнопки квадратними з !important,
 * тому в кнопках плитки — подвоєні класи і !important. */

/* Поки дані не прийшли — старі плитки не показуємо (через 4 с показуємо як є, якщо щось пішло не так). */
html.ec-pv:not(.ec-pv-late) ul.products > li.product:not(.ect) > * { visibility: hidden; }
html.ec-pv:not(.ec-pv-late) ul.products > li.product:not(.ect) {
	border-radius: 18px; min-height: 260px;
	background: linear-gradient(100deg, #F3F5EE 40%, #FAFBF7 50%, #F3F5EE 60%) 0 0 / 300% 100%;
	animation: ect-sk 1.2s linear infinite;
}
@keyframes ect-sk { to { background-position: -150% 0; } }

ul.products.ect-grid {
	--ec-ink: #1F2A1A; --ec-muted: #5B6455; --ec-green: #3F7A22; --ec-green-dark: #2C5A16;
	--ec-soft: #F6F8F2; --ec-line: #ECEEE6; --ec-star: #E8A317; --ec-red: #B3243E;
	display: grid !important; gap: 22px 18px !important; margin-left: 0 !important; margin-right: 0 !important;
}
ul.products.ect-grid::before, ul.products.ect-grid::after { display: none !important; }
ul.products.ect-grid.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
ul.products.ect-grid.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
ul.products.ect-grid > li.product { width: auto !important; margin: 0 !important; float: none !important; }

li.product.ect {
	position: relative; display: flex !important; flex-direction: column; padding: 0 !important;
	font-family: Manrope, system-ui, -apple-system, sans-serif; color: var(--ec-ink); text-align: left !important;
	background: none; box-shadow: none !important;
}
li.product.ect *, li.product.ect *::before, li.product.ect *::after { box-sizing: border-box; }
li.product.ect a { text-decoration: none !important; }

.ect__media {
	position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: #F4F5F0;
}
.ect__media img {
	position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; margin: 0 !important;
	border-radius: 0 !important; transition: opacity .25s ease, transform .35s ease;
}
.ect__img2 { opacity: 0; }
@media (hover: hover) {
	li.ect:hover .ect__img2 { opacity: 1; }
	li.ect:hover .ect__img { transform: scale(1.03); }
}
.ect__badge {
	position: absolute; left: 10px; top: 10px; z-index: 1; padding: 4px 10px; border-radius: 999px;
	font-size: 12px; font-weight: 800; line-height: 1.3; letter-spacing: .2px;
}
.ect__badge.is-hit { background: #FFE7A3; color: #6B4A00; }
.ect__badge.is-new { background: #DDF0CF; color: var(--ec-green-dark); }

.ect__body { display: flex; flex-direction: column; flex: 1; padding: 10px 2px 0; }
.ect__meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 18px; font-size: 12px; color: var(--ec-muted); }
.ect__rate { white-space: nowrap; color: var(--ec-ink); font-weight: 700; }
.ect__rate i { font-style: normal; color: var(--ec-star); }
.ect__rate u { text-decoration: none; color: var(--ec-muted); font-weight: 500; }
.ect__name {
	margin: 4px 0 8px; color: var(--ec-ink) !important; font-size: 15px; line-height: 1.3; font-weight: 700;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}
.ect__name:hover { color: var(--ec-green) !important; }
.ect__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; min-height: 44px; }
.ect__price { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ect__price b { font-size: 19px; font-weight: 800; white-space: nowrap; letter-spacing: -.3px; }
.ect__price b small { font-size: 13px; font-weight: 600; color: var(--ec-muted); letter-spacing: 0; }
.ect__price s { font-size: 12px; color: #8A9085; }
.ect__out { font-size: 13px; font-weight: 700; color: var(--ec-red); }
.ect__opt { margin: -4px 0 8px; font-size: 12px; font-weight: 600; color: var(--ec-green-dark); }

/* Кругла «+» і «− N +» */
.ect .ect__plus:not(#_) {
	position: relative; flex: 0 0 auto; width: 44px; height: 44px; min-height: 0; padding: 0 !important; border: 0 !important;
	border-radius: 50% !important; background: var(--ec-green) !important; color: #fff !important; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; font-size: 20px !important; line-height: 1;
	box-shadow: 0 6px 14px rgba(63, 122, 34, .28) !important; transition: transform .12s ease, background-color .15s ease;
}
.ect .ect__plus:not(#_):hover { background: var(--ec-green-dark) !important; }
.ect .ect__plus:not(#_):active { transform: scale(.9); }
.ect .ect__plus.is-off:not(#_) { background: var(--ec-soft) !important; color: var(--ec-muted) !important; box-shadow: none !important; }
.ect__plus svg { width: 22px; height: 22px; }
.ect__cnt {
	position: absolute; right: -4px; top: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
	background: #fff; color: var(--ec-green-dark); border: 2px solid var(--ec-green); font-size: 11px; font-weight: 800; line-height: 16px; text-align: center;
}
.ect__step {
	display: inline-flex; align-items: center; height: 44px; border-radius: 999px; background: var(--ec-green);
	box-shadow: 0 6px 14px rgba(63, 122, 34, .28); animation: ect-pop .18s ease-out;
}
@keyframes ect-pop { from { transform: scale(.8); } to { transform: scale(1); } }
.ect .ect__sb:not(#_) {
	width: 38px; height: 44px; min-height: 0; padding: 0 !important; border: 0 !important; border-radius: 999px !important;
	background: transparent !important; color: #fff !important; font-size: 20px !important; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: none !important;
}
.ect .ect__sb:not(#_):active { background: rgba(255, 255, 255, .18) !important; }
.ect__n { min-width: 18px; text-align: center; color: #fff; font-weight: 800; font-size: 15px; }

/* Розгортання при наведенні (ПК): плитка піднімається білою карткою з тінню й показує більше.
 * Тема фарбує li при наведенні в зелений прямокутник — прибираємо. */
ul.products li.product.ect, ul.products li.product.ect:hover { background: transparent !important; box-shadow: none !important; transform: none !important; }
li.product.ect > .ect__in { position: relative; display: flex; flex-direction: column; flex: 1; border-radius: 24px; }
li.product.ect.is-pop { z-index: 30; }
li.product.ect.is-pop > .ect__in {
	position: absolute; top: -12px; left: -12px; right: -12px; min-height: calc(100% + 26px); padding: 12px 12px 14px; background: #fff;
	box-shadow: 0 22px 50px rgba(31, 42, 26, .18), 0 3px 10px rgba(31, 42, 26, .07); animation: ect-lift .18s ease-out;
}
@keyframes ect-lift { from { box-shadow: 0 0 0 rgba(31, 42, 26, 0); } }
.ect__more { display: none; }
li.ect.is-pop .ect__more { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ec-line); animation: ect-more .2s ease-out; }
@keyframes ect-more { from { opacity: 0; transform: translateY(-6px); } }
.ect__vars { display: flex; flex-wrap: wrap; gap: 6px; }
.ect .ect__v:not(#_) {
	display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 0; padding: 6px 10px !important; border: 1.5px solid var(--ec-line) !important;
	border-radius: 12px !important; background: #fff !important; color: var(--ec-ink) !important; font-size: 13px !important; line-height: 1.2; cursor: pointer; box-shadow: none !important;
	text-transform: none; letter-spacing: normal; transition: border-color .12s, background-color .12s;
}
.ect .ect__v:not(#_):hover { border-color: var(--ec-green) !important; background: #F1F7EB !important; }
.ect__v b { font-weight: 800; font-size: 13px; }
.ect__v span { font-size: 12px; color: var(--ec-muted); font-weight: 600; }
.ect__facts { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.4; }
.ect__facts div { display: flex; gap: 5px; }
.ect__facts dt { flex: none; font-weight: 700; color: var(--ec-ink); }
.ect__facts dd { margin: 0; color: var(--ec-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ect__lead { margin: 0 !important; font-size: 13px; line-height: 1.45; color: var(--ec-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
li.product.ect .ect__link { font-size: 13.5px; font-weight: 800; color: var(--ec-green) !important; }
li.product.ect .ect__link:hover { color: var(--ec-green-dark) !important; }

/* Шторка вибору ваги: знизу на телефоні, по центру на ПК */
.ects { position: fixed; inset: 0; z-index: 2147483000; font-family: Manrope, system-ui, -apple-system, sans-serif; color: #1F2A1A; }
.ects[hidden] { display: none; }
.ects *, .ects *::before, .ects *::after { box-sizing: border-box; }
.ects__bg { position: absolute; inset: 0; background: rgba(20, 26, 16, .45); opacity: 0; transition: opacity .2s ease; }
.ects__panel {
	position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: #fff;
	border-radius: 24px 24px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
	transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.ects.is-open .ects__bg { opacity: 1; }
.ects.is-open .ects__panel { transform: none; }
.ects__panel::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #DADDD4; }
html.ects-lock { overflow: hidden; }
.ects .ects__x:not(#_) {
	position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; min-height: 0; padding: 0 !important; border: 0 !important;
	border-radius: 50% !important; background: #F4F5F0 !important; color: #1F2A1A !important; font-size: 22px !important; line-height: 1; cursor: pointer;
}
.ects__head { display: flex; gap: 12px; align-items: center; padding-right: 40px; margin-bottom: 16px; }
.ects__head img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: #F4F5F0; flex: 0 0 auto; }
.ects__name { font-size: 16px; font-weight: 800; line-height: 1.25; }
.ects__more { display: inline-block; margin-top: 4px; font-size: 13px; color: #3F7A22 !important; }
.ects__lbl { font-size: 13px; font-weight: 700; color: #5B6455; margin-bottom: 8px; }
.ects__vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.ects .ects__v:not(#_) {
	display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; padding: 10px 6px !important;
	border: 1.5px solid #DADDD4 !important; border-radius: 14px !important; background: #fff !important; color: #1F2A1A !important;
	font-family: inherit; line-height: 1.2; cursor: pointer; box-shadow: none !important; text-transform: none; letter-spacing: normal;
}
.ects__v b { font-size: 15px; font-weight: 800; }
.ects__v span { font-size: 13px; color: #5B6455; }
.ects .ects__v.is-on:not(#_) { border-color: #3F7A22 !important; background: #F1F7EB !important; box-shadow: 0 0 0 1px #3F7A22 inset !important; }
.ects .ects__v:disabled { opacity: .45; cursor: default; }
.ects__opt { margin-top: 12px; padding: 9px 12px; border-radius: 12px; background: #F6F8F2; color: #2C5A16; font-size: 13px; font-weight: 600; }
.ects__opt[hidden] { display: none; }
.ects__row { display: flex; gap: 10px; margin-top: 16px; }
.ects__step { display: inline-flex; align-items: center; border: 1.5px solid #DADDD4; border-radius: 999px; height: 52px; flex: 0 0 auto; }
.ects .ects__step button:not(#_) {
	width: 44px; height: 48px; min-height: 0; padding: 0 !important; border: 0 !important; border-radius: 999px !important;
	background: transparent !important; color: #1F2A1A !important; font-size: 22px !important; line-height: 1; cursor: pointer; box-shadow: none !important;
}
.ects__step span { min-width: 26px; text-align: center; font-weight: 800; font-size: 16px; }
.ects .ects__go:not(#_) {
	flex: 1; height: 52px; min-height: 0; padding: 0 16px !important; border: 0 !important; border-radius: 999px !important;
	background: #3F7A22 !important; color: #fff !important; font-family: inherit; font-size: 16px !important; font-weight: 800; cursor: pointer;
	text-transform: none; letter-spacing: normal; box-shadow: 0 8px 18px rgba(63, 122, 34, .3) !important;
}
.ects .ects__go:not(#_):active { transform: scale(.98); }

.ect-note {
	position: fixed; left: 50%; bottom: 24px; z-index: 2147483001; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
	background: #1F2A1A; color: #fff; font: 600 14px/1.35 Manrope, system-ui, sans-serif; transform: translate(-50%, 140%); transition: transform .2s ease;
}
.ect-note.is-on { transform: translate(-50%, 0); }

@media (min-width: 768px) {
	.ects__panel {
		left: 50%; top: 50%; right: auto; bottom: auto; width: 440px; border-radius: 24px; padding: 24px;
		transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .18s ease, opacity .18s ease;
	}
	.ects.is-open .ects__panel { transform: translate(-50%, -50%); opacity: 1; }
	.ects__panel::before { display: none; }
}
@media (max-width: 921px) {
	ul.products.ect-grid.columns-4, ul.products.ect-grid.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 600px) {
	ul.products.ect-grid.columns-4, ul.products.ect-grid.columns-3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px 12px !important; }
	.ect__name { font-size: 14px; }
	.ect__price b { font-size: 17px; }
	.ect .ect__plus:not(#_) { width: 40px; height: 40px; }
	.ect__step { height: 40px; }
	.ect .ect__sb:not(#_) { width: 32px; height: 40px; }
	.ect__media { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.ect__media img, .ects__panel, .ects__bg { transition: none; }
	html.ec-pv ul.products > li.product { animation: none; }
}
/* Шторка ваги: не вища за видиму область, прокрутка всередині, фон не скролиться */
.ects { height: 100vh; height: var(--ec-vh, 100dvh); bottom: auto; }
.ects__bg { touch-action: none; }
.ects__panel { max-height: calc(var(--ec-vh, 100dvh) - 40px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ects { top: 0; bottom: auto; height: 100vh; height: 100lvh; }
.ects__panel { bottom: var(--ec-kb, 0px); }
.ect-note { visibility: hidden; opacity: 0; transition: transform .2s ease, opacity .2s, visibility 0s .2s; }
.ect-note.is-on { visibility: visible; opacity: 1; transition: transform .2s ease, opacity .2s; }
