/* Плашка «В корзине». Абсолютно позиционирована в полосе внизу картинки — размер карточки и сетка каталога не меняются. */
.nfs-cb { display: none; --nfs-h: 40px; }
li.product .product-thumbnail { position: relative; overflow: hidden; }
.nfs-cb.is-on { display: flex; }

/* Синяя кнопка скрыта, пока товар в корзине (и стандартная ссылка «Просмотр корзины» после AJAX) */
li.product:has(> .product-inner .nfs-cb.is-on) .wplb-loop_atc_button,
li.product:has(.nfs-cb.is-on) .wplb-loop_atc_button,
li.product:has(.nfs-cb.is-on) a.add_to_cart_button,
li.product:has(.nfs-cb.is-on) .added_to_cart { display: none !important; }

/* Геометрия и шрифт повторяют синюю кнопку темы: полоса во всю ширину картинки, без скруглений, шрифт сайта */
.nfs-cb {
	box-sizing: border-box; width: 100%; gap: 0; align-items: stretch; font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.2;
	transition: opacity .15s;
}
ul.products li.product .product-thumbnail .nfs-cb, .product-thumbnail .nfs-cb { position: absolute; margin: 0; left: 0; right: 0; bottom: 0; width: auto; z-index: 3; }
.nfs-cb.is-busy { opacity: .75; }
.nfs-cb.is-warn .nfs-cb__step { box-shadow: 0 0 0 2px #f2a33a inset; }

/* Разметка выводит две плашки (как две синие кнопки темы): в картинке и под ценой. Какая видна — решает только CSS по типу экрана. */
li.product .product-summary .nfs-cb { display: none !important; }
.nfs-cb__txt {
	flex: 1 1 28px; min-width: 28px; height: var(--nfs-h,40px); border-radius: 0; background: var(--nfs-green, #4fae3f); color: #fff;
	display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
}
.nfs-cb__t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfs-cb__txt svg { flex: none; }

.nfs-cb__step {
	flex: 0 0 auto; height: var(--nfs-h,40px); border-radius: 0; background: #f1f3f6; display: flex; align-items: center; overflow: hidden;
}
.nfs-cb .nfs-cb__step button {
	all: unset; box-sizing: border-box; width: 34px; min-width: 28px; height: var(--nfs-h,40px); display: flex; align-items: center; justify-content: center;
	color: var(--wplb-color-primary, #2347d4) !important; font-size: 22px; font-weight: 600; line-height: 1; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
	background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; text-transform: none; border-radius: 0 !important;
}
.nfs-cb .nfs-cb__step button:hover { opacity: .7; }
.nfs-cb .nfs-cb__step button:focus-visible { outline: 2px solid var(--wplb-color-primary, #2347d4); outline-offset: -2px; }
.nfs-cb__q { min-width: 26px; text-align: center; font-size: 15px; font-weight: 600; color: #111; font-variant-numeric: tabular-nums; }

/* Телефон / сенсорный экран (то же условие, что у синей кнопки темы): плашка под ценой на всю ширину карточки, в картинке — скрыта */
@media (max-width: 767px), (hover: none) {
	li.product .product-thumbnail .nfs-cb { display: none !important; }
	li.product .product-summary .nfs-cb.is-on { display: flex !important; position: static; width: 100%; margin: 0; --nfs-h: 42px; }
	li.product .product-summary .nfs-cb__txt { font-size: 15px; padding: 0 6px; gap: 0; }
	li.product .product-summary .nfs-cb__txt svg { display: none; }
	li.product .product-summary .nfs-cb__step button { width: 36px; min-width: 28px; }
	li.product .product-summary .nfs-cb__q { min-width: 26px; }
}
/* Карточка без плашки в картинке (карусели, «похожие»): плашка — обычный блок под ценой на любом экране */
li.product:not(:has(.product-thumbnail .nfs-cb)) .product-summary .nfs-cb.is-on { display: flex !important; position: static; width: 100%; margin-top: 8px; }

/* Страница товара: кнопка уже в корзине — зелёная */
.single_add_to_cart_button.nfs-in-cart,
.single_add_to_cart_button.nfs-in-cart:hover { background: var(--nfs-green, #4fae3f) !important; border-color: var(--nfs-green, #4fae3f) !important; color: #fff !important; }


/* Страница товара (собственный блок). Зелёная часть — такая же кнопка темы (.single_add_to_cart_button.button.alt), что и синяя:
   высоту, скругление, шрифт и отступы задаёт тема; здесь меняется только цвет и вёрстка внутри плашки.
   Блок «− N +» растягивается по высоте этой кнопки. */
.nfs-sc, .nfs-sc .nfs-cb { --nfs-h: auto; }
.nfs-sc .nfs-cb { display: none; position: static; width: auto; margin: 0; gap: 0; align-items: stretch; }
.nfs-sc .nfs-cb.is-on { display: flex; }
.nfs-sc.is-in .nfs-sc__add { display: none !important; }
.nfs-sc .nfs-cb a.nfs-cb__txt.single_add_to_cart_button { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: auto; padding: 0 22px; margin-right: 18px; background: var(--nfs-green, #4fae3f) !important; color: #fff !important; text-decoration: none; }
.nfs-sc .nfs-cb a.nfs-cb__txt.single_add_to_cart_button:hover { opacity: .9; }
.nfs-sc .nfs-cb__step { align-items: stretch; margin-right: 18px; border-radius: 5px; }
.nfs-sc .nfs-cb__step button { width: 48px; height: auto !important; align-self: stretch; }
.nfs-sc .nfs-cb__q { display: flex; align-items: center; justify-content: center; min-width: 40px; font-size: 16px; }
/* Липкая панель страницы товара (nfs-st). Размеры — переменные. Панель темы для простых товаров не выводится. */
.nfs-st { --nfs-st-h: 48px; --nfs-st-img: 60px; --nfs-st-gap: 16px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 999; background: #fff; border-top: 1px solid #e5e5e5; box-shadow: 0 -6px 24px rgba(0,0,0,.07); transform: translateY(100%); visibility: hidden; transition: transform .25s, visibility 0s .25s; }
.nfs-st.is-on { transform: none; visibility: visible; transition: transform .25s; }
body.nfs-st-on #merchant-sticky-add-to-cart { display: none !important; }
.nfs-st__in { padding-top: 10px; padding-bottom: 10px; }
.nfs-st__row { display: flex; align-items: center; gap: var(--nfs-st-gap); }
.nfs-st__img { flex: none; width: var(--nfs-st-img); height: var(--nfs-st-img); object-fit: contain; }
.nfs-st__info { flex: 1 1 auto; min-width: 0; }
.nfs-st__title { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nfs-st__price { margin-top: 3px; }
.nfs-st__buy { flex: none; }
.nfs-st__buy { max-width: 62%; }
.nfs-st .nfs-sc { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; margin: 0; }
.nfs-st .nfs-pk { flex: 0 0 100%; width: 100%; margin: 0; gap: 6px; justify-content: flex-end; }
.nfs-st .nfs-pk-t { margin-right: 2px; }
.nfs-st .nfs-pk-b { padding: 5px 12px; font-size: 14px; }
.nfs-st .nfs-sc .stock, .nfs-st p.stock, .nfs-st .wplb-wishlist-button, .nfs-st .product-size-guide, .nfs-st a.added_to_cart { display: none !important; }
.nfs-st .product-button-wrapper { display: contents; }
.nfs-st .nfs-sc__add { height: var(--nfs-st-h); min-width: 170px; padding: 0 25px; margin: 0; border-radius: var(--nfs-radius, 5px); font-size: 16px; font-weight: 500; line-height: 1.2; }
.nfs-st .nfs-cb { margin: 0; }
.nfs-st .nfs-cb a.nfs-cb__txt.single_add_to_cart_button { width: auto; min-width: 170px; height: var(--nfs-st-h); padding: 0 25px; margin: 0 12px 0 0; border-radius: var(--nfs-radius, 5px); box-shadow: none; font-size: 16px; font-weight: 500; line-height: 1.2; justify-content: center; }
.nfs-st .nfs-cb__step { height: var(--nfs-st-h); margin: 0; border-radius: var(--nfs-radius, 5px); }
@media (max-width: 767px) {
	.nfs-st { --nfs-st-h: 44px; --nfs-st-img: 44px; --nfs-st-gap: 10px; }
	.nfs-st__in { padding-top: 8px; padding-bottom: 8px; }
	.nfs-st__row { flex-wrap: wrap; }
	.nfs-st__info { flex: 1 1 0; }
	.nfs-st__title { font-size: 13px; -webkit-line-clamp: 1; }
	.nfs-st__buy { flex: 1 1 100%; max-width: none; }
	.nfs-st .nfs-sc { flex-wrap: wrap; gap: 6px; }
	.nfs-st .nfs-pk { justify-content: flex-start; }
	.nfs-st .nfs-sc__add { flex: 1 1 100%; min-width: 0; }
	.nfs-st .nfs-cb { flex: 1 1 100%; }
	.nfs-st .nfs-cb.is-on { display: flex; width: 100%; }
	.nfs-st .nfs-cb a.nfs-cb__txt.single_add_to_cart_button { flex: 1 1 auto; min-width: 0; margin-right: 10px; padding: 0 12px; }
	.nfs-st .nfs-cb__step { flex: 0 0 auto; }
	.nfs-st .nfs-cb__step button { width: 40px; }
}

/* ── Боковая корзина (nfs-cp). Настройка: --nfs-accent, --nfs-radius, --nfs-panel-w ── */
.nfs-cp{--nfs-accent:var(--wplb-color-primary,#1d4ed8);--nfs-radius:5px;--nfs-panel-w:470px;--nfs-gap:30px;position:fixed;inset:0;z-index:100000;visibility:hidden;pointer-events:none;transition:visibility 0s .5s}
.nfs-cp.is-open{visibility:visible;pointer-events:auto;transition:none}
.nfs-cp__layer{position:absolute;inset:0;background:rgba(14,24,66,.55);background:color-mix(in srgb,var(--nfs-accent) 30%,#050a1e 70%);opacity:0;transition:opacity .5s}
.nfs-cp.is-open .nfs-cp__layer{opacity:.62}
.nfs-cp__panel{position:absolute;top:0;right:0;bottom:0;width:var(--nfs-panel-w);max-width:100%;background:#fff;color:#212121;transform:translateX(100%);transition:transform .5s;display:flex;flex-direction:column;box-shadow:0 0 30px rgba(0,0,0,.15)}
.nfs-cp.is-open .nfs-cp__panel{transform:none}
.nfs-cp__inner{display:flex;flex-direction:column;height:100%;min-height:0}
.nfs-cp__head{display:flex;align-items:center;justify-content:space-between;padding:25px 45px 20px 20px;border-bottom:1px solid #e5e5e5;flex:none}
.nfs-cp__title{font-size:18px;font-weight:500}
.nfs-cp__count{color:#777;font-weight:400}
.nfs-cp__close{background:none;border:0;padding:6px;margin:-6px;cursor:pointer;color:inherit;line-height:0}
.nfs-cp__body{flex:1;overflow:auto;padding:20px}
.nfs-cp__list{list-style:none;margin:0;padding:0}
.nfs-cp__line{display:flex;gap:20px;padding-bottom:var(--nfs-gap);margin-bottom:var(--nfs-gap);border-bottom:1px solid #e5e5e5;transition:opacity .15s}
.nfs-cp__line:last-child{border-bottom:0;margin-bottom:0;padding-bottom:0}
.nfs-cp__line.is-busy{opacity:.6}
.nfs-cp__line.is-gone{opacity:.3}
.nfs-cp__thumb{flex:0 0 100px;max-width:120px}
.nfs-cp__thumb img{display:block;width:100%;height:auto}
.nfs-cp__info{flex:1;min-width:0}
.nfs-cp__name{font-size:15px;font-weight:600;line-height:1.35;margin-bottom:6px}
.nfs-cp__name a{color:inherit;text-decoration:none}
.nfs-cp__price{font-size:15px;margin-bottom:12px}
.nfs-cp__row{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.nfs-cp__step{display:inline-flex;align-items:center;border:1px solid #d8d8d8;border-radius:var(--nfs-radius);overflow:hidden}
.nfs-cp__step button{background:none;border:0;width:34px;height:34px;font-size:18px;line-height:1;cursor:pointer;color:inherit}
.nfs-cp__step button:hover{background:#f3f3f3}
.nfs-cp__q{min-width:30px;text-align:center;font-size:15px}
.nfs-cp__rm{margin-left:auto;display:inline-flex;align-items:center;gap:5px;background:none;border:0;padding:0;font-size:14px;color:#777;cursor:pointer}
.nfs-cp__rm:hover{color:#c0392b}
.nfs-cp__fixed{font-size:14px;color:#777}
.nfs-cp__foot{flex:none;background:#f6f6f6;padding:20px;border-top:1px solid #e5e5e5}
.nfs-cp__total{display:flex;justify-content:space-between;font-size:16px;margin-bottom:16px}
.nfs-cp__btns{display:grid;gap:10px}
.nfs-cp__btn{display:flex;align-items:center;justify-content:center;height:54px;border-radius:var(--nfs-radius);font-size:16px;font-weight:500;text-decoration:none;box-sizing:border-box;border:2px solid var(--nfs-accent)}
.nfs-cp__btn--primary{background:var(--nfs-accent);color:#fff}
.nfs-cp__btn--line{background:#fff;color:var(--nfs-accent)}
.nfs-cp__btn:hover{opacity:.9}
.nfs-cp__empty{text-align:center;padding:60px 0}
.nfs-cp__empty-t{font-size:24px;font-weight:500;margin:0 0 24px}
.nfs-cp__empty .nfs-cp__btn{display:inline-flex;padding:0 30px}
.nfs-cp__free{margin-bottom:16px;font-size:14px}
.nfs-cp__free-bar{height:6px;background:#e0e0e0;border-radius:3px;margin-top:8px;overflow:hidden}
.nfs-cp__free-bar span{display:block;height:100%;background:var(--nfs-green,#4fae3f)}
.nfs-cp__loading{color:#777;padding:30px 0;text-align:center}
html.nfs-cp-lock,html.nfs-cp-lock body{overflow:hidden}
@media(max-width:480px){.nfs-cp__head{padding-left:15px}.nfs-cp__body,.nfs-cp__foot{padding:15px}.nfs-cp__thumb{flex-basis:80px}}
/* Панель самодостаточна: сбрасываем стили кнопок темы */
.nfs-cp button{font:inherit;text-transform:none;letter-spacing:0;box-shadow:none;min-height:0;text-decoration:none}
.nfs-cp .nfs-cp__close,.nfs-cp .nfs-cp__step button,.nfs-cp .nfs-cp__rm{background:none;color:inherit;border:0;border-radius:0;padding:0}
.nfs-cp .nfs-cp__close{padding:6px;margin:-6px}
.nfs-cp .nfs-cp__step button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;font-size:18px}
.nfs-cp .nfs-cp__step button:hover{background:#f3f3f3;color:inherit}
.nfs-cp .nfs-cp__rm{color:#777;font-size:14px;gap:5px}
.nfs-cp .nfs-cp__rm:hover{background:none;color:#c0392b}
.nfs-cp .nfs-cp__close,.nfs-cp .nfs-cp__step button,.nfs-cp .nfs-cp__rm{background:transparent!important;color:inherit!important}
.nfs-cp .nfs-cp__step button:hover{background:#f3f3f3!important}
.nfs-cp .nfs-cp__rm{color:#777!important}.nfs-cp .nfs-cp__rm:hover{color:#c0392b!important}

.nfs-cp__foot.is-busy .nfs-cp__total strong{opacity:.35;transition:opacity .15s}

/* Избранное (плагин wplb-wishlist): в корзине — вместо синей кнопки только зелёная плашка */
.wplb-wishlist-item .product-add-to-cart:has(> .nfs-cb.is-on) > .add_to_cart_button { display: none !important; }
