/**
 * FurniStyle 4.2 — B2B products («цена по запросу»): price label, «Запросить расчёт» in the card and on the
 * product page, the request dialog, B2B direction lists. Retail cards and pages are not affected
 * (every rule is scoped to .fs4-card--b2b, .fs-b2b-*, .fs-price-request or .fs-quote).
 */

/* Price label instead of a price */
.fs-price-request { color: var(--fs4-text); font-weight: 500; white-space: normal; }
.fs4-card__price .fs-price-request { font-size: var(--fs4-fs-base); line-height: 1.3; }
.single-product div.product .summary .price .fs-price-request--single { font-size: 20px; line-height: 1.3; letter-spacing: -.005em; }

/* Card: the price spans the row, «Запросить расчёт» is a full-width row at the bottom */
.fs4-card--b2b .fs4-card__body { grid-template-areas: "price price" "title title" "chips chips" "stock stock" "cart cart"; }
.fs4-card--b2b .fs4-card__actions { align-self: end; margin-top: 12px; }
/* 4.5: «Запросить расчёт» on one level in every row of cards. The card is a flex column stretched by the grid row and
   the body fills it (v4.css); here the last body row («cart») takes the free height and the button sits at its bottom,
   so a two-line title or a missing size chip no longer moves it. Content-sized rows, no fixed heights — nothing is cut.
   Empty areas (no chip, no stock line) collapse to 0. List layout (.is-style-fs4-list) keeps its own rows. */
.fs4-card--b2b .fs4-card__body { grid-template-rows: auto auto auto auto minmax(0, 1fr); }
.is-style-fs4-list .fs4-card--b2b .fs4-card__body { grid-template-rows: none; }
.fs4-card__quote {
	display: flex; align-items: center; justify-content: center; width: 100%; min-height: 38px; margin: 0; padding: 0 14px;
	border: 1px solid var(--fs4-dark); border-radius: var(--fs4-radius-sm); background: #fff; color: var(--fs4-text);
	font-family: var(--fs4-font); font-size: 14px; font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none;
	cursor: pointer; transition: background-color var(--fs4-ease), color var(--fs4-ease);
}
.fs4-card__quote:hover, .fs4-card__quote:focus-visible { background: var(--fs4-dark); color: #fff; }

/* Product page */
.fs-b2b-buy { display: grid; gap: 10px; margin: 18px 0 8px; }
.fs-b2b-buy__btn { width: 100%; justify-content: center; }
.fs-b2b-buy__note { margin: 0; color: var(--fs4-text-2); font-size: var(--fs4-fs-sm); line-height: 1.45; }

/* «Характеристики» of a B2B product: a gap between «Габариты (Ш × Г × В)» and the value on narrow screens */
.single-product div.product.fs4-card--b2b .woocommerce-product-attributes th { padding-right: 16px !important; }

/* Request dialog */
.fs-quote {
	width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0;
	overflow: auto; border: 0; border-radius: var(--fs4-radius); background: #fff; color: var(--fs4-text);
	box-shadow: 0 24px 64px rgba(20, 20, 20, .18); overscroll-behavior: contain;
}
.fs-quote::backdrop { background: rgba(20, 20, 20, .5); }
html:has(.fs-quote[open]) { overflow: hidden; }
.fs-quote [hidden] { display: none !important; } /* .fs-field (display: grid) would otherwise show the empty variant row */
.fs-quote__box { position: relative; padding: 28px 28px 24px; }
.fs-quote__close { position: absolute; top: 10px; right: 10px; }
.fs-quote__eyebrow { margin: 0 0 12px; color: var(--fs4-text-2); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.fs-quote__product { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding-right: 40px; }
.fs-quote__img { flex: none; width: 64px; height: 64px; border-radius: var(--fs4-radius-sm); background: var(--fs4-surface); object-fit: contain; mix-blend-mode: multiply; }
.fs-quote__name { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.fs-quote__sku { margin: 4px 0 0; color: var(--fs4-text-2); font-size: var(--fs4-fs-sm); }
.fs-quote__variant { margin: 0 0 16px; }
.fs-quote__variant select.fs-input {
	padding-right: 44px; cursor: pointer; -webkit-appearance: none; appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23141414' stroke-width='1.6' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
	background-position: right 16px center; background-repeat: no-repeat; background-size: 16px;
}
.fs-quote .fs-field--qty { max-width: 220px; }
@media (max-width: 600px) {
	.fs-quote { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
	.fs-quote__box { padding: 20px 16px 24px; }
	.fs-quote .fs-form__row { grid-template-columns: 1fr; }
	.fs-quote__name { font-size: 18px; }
}

/* B2B direction lists (furnistyle/b2b-products, «Модели для учреждений», hub section): 4.4 — by collection */
.fs-b2b-products__filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.fs-b2b-products__filter .fs-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fs-b2b-products__n { color: var(--fs4-text-3); font-size: 13px; }
/* 4.4: one block per B2B collection (линейка): heading, description, category chips, one grid */
.fs-b2b-collection + .fs-b2b-collection { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--fs4-line); }
.fs-b2b-collection__head { max-width: 760px; margin: 0 0 20px; }
.fs-b2b-collection__title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.fs-b2b-collection__desc { margin-top: 8px; color: var(--fs4-text-2); font-size: var(--fs4-fs-base); line-height: 1.5; }
.fs-b2b-collection__desc p { margin: 0; }
.fs-b2b-collection__desc p + p { margin-top: 6px; }
.fs-b2b-collection li.product[hidden] { display: none !important; }
@media (max-width: 767px) {
	.fs-b2b-products__filter { flex-wrap: nowrap; margin-right: calc(-1 * var(--fs-gutter, 16px)); padding-right: var(--fs-gutter, 16px); overflow-x: auto; scrollbar-width: none; }
	.fs-b2b-collection + .fs-b2b-collection { margin-top: 40px; padding-top: 28px; }
	.fs-b2b-collection__title { font-size: 20px; }
}

/* 4.8.2: B2B catalogue (/catalog-b2b/, furnistyle/b2b-products «Все B2B-товары»): direction switch (links — the active
   one in the dark FurniStyle «selected» look, so it reads as a level above the category chips of a collection),
   counter, «продолжение» of a collection split between pages, pagination (v4.css .woocommerce-pagination). */
.fs-b2b-catalog { scroll-margin-top: 96px; }
.fs-b2b-catalog__dirs { margin-bottom: 12px; }
.fs-b2b-catalog__dirs .fs-chip { text-decoration: none; white-space: nowrap; }
.fs-b2b-catalog__dirs .fs-chip.is-active { border-color: var(--fs4-dark); background: var(--fs4-dark); color: #fff; }
.fs-b2b-catalog__dirs .fs-chip.is-active .fs-b2b-products__n { color: rgba(255, 255, 255, .7); }
.fs-b2b-catalog__count { margin: 0 0 32px; color: var(--fs4-text-2); font-size: var(--fs4-fs-sm); }
.fs-b2b-catalog__empty { margin: 8px 0 0; color: var(--fs4-text-2); font-size: var(--fs4-fs-base); }
.fs-b2b-collection__cont { margin: 6px 0 0; color: var(--fs4-text-3); font-size: var(--fs4-fs-sm); }
@media (max-width: 767px) {
	.fs-b2b-catalog { scroll-margin-top: 72px; }
	.fs-b2b-catalog__count { margin-bottom: 24px; }
}
