/* ==========================================================================
   Страница категории (Category.dc.html) — также поиск по изделиям
   ========================================================================== */

/* ---------- Шапка: факты и обложка ---------- */
.oa-catfacts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	max-width: 680px;
}

.oa-catfacts--1 {
	grid-template-columns: minmax(0, 1fr);
}

.oa-catfact {
	padding: 10px 12px;
	gap: 4px;
}

.oa-catfact__label {
	font-size: 12px;
	font-weight: 700;
	color: var(--oa-on-dark-3);
}

.oa-catfact__value {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: #FFFFFF;
}

.oa-catfact__value--accent {
	color: var(--oa-accent-light);
}

/* Третий факт на телефоне — на всю ширину */
.oa-catfacts--3 .oa-catfact:nth-child(3) {
	grid-column: span 2;
}

.oa-phead--category .oa-phead__aside {
	display: none;
}

.oa-catcover__img {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 20px;
	overflow: hidden;
	background: #FFFFFF;
}

.oa-catcover__img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 28px;
}

.oa-catcover__img--dark {
	background: var(--oa-photo);
}

.oa-catcover__img--dark img {
	object-fit: cover;
	padding: 0;
}

.oa-catcover__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	height: 52px;
	padding: 0 5px 0 20px;
	border-radius: var(--oa-r-pill);
	background: var(--oa-accent);
	color: var(--oa-on-accent);
	font-size: 15px;
	font-weight: 700;
	transition: transform 0.2s ease, filter 0.2s ease;
}

.oa-catcover__btn:hover {
	transform: translateY(-2px);
	filter: brightness(1.06);
}

.oa-catcover__btn .oa-btn__circle {
	width: 42px;
	height: 42px;
	background: #FFFFFF;
}

.oa-catcover__btn .oa-btn__circle svg {
	stroke: var(--oa-accent);
}

@media (min-width: 640px) {
	.oa-catfacts,
	.oa-catfacts--3 {
		grid-template-columns: repeat(var(--oa-facts, 3), minmax(0, 1fr));
	}

	.oa-catfacts--1 { --oa-facts: 1; }
	.oa-catfacts--2 { --oa-facts: 2; }
	.oa-catfacts--3 { --oa-facts: 3; }

	.oa-catfacts--3 .oa-catfact:nth-child(3) {
		grid-column: auto;
	}

	.oa-catfact {
		padding: 14px 16px;
	}

	.oa-catfact__value {
		font-size: 15px;
	}
}

@media (min-width: 1024px) {
	.oa-phead--category .oa-phead__aside {
		display: flex;
	}

	.oa-phead--category .oa-phead__main {
		gap: 16px;
	}
}

/* ---------- Тело: левая колонка + изделия ---------- */
.oa-catbody {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--oa-gap);
	align-items: start;
}

.oa-side {
	display: none;
}

.oa-catmain {
	border-radius: var(--oa-r-section);
	background: #FFFFFF;
	padding: 14px 10px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

@media (min-width: 640px) {
	.oa-catmain {
		padding: 22px;
		gap: 18px;
	}
}

@media (min-width: 1024px) {
	.oa-catbody {
		grid-template-columns: 320px minmax(0, 1fr);
	}

	.oa-side {
		position: sticky;
		top: 84px; /* под закреплённой шапкой (v2.1) */
		display: flex;
		flex-direction: column;
		gap: 16px;
	}

	.oa-catmain {
		padding: 28px;
		gap: 20px;
	}

	.oa-catmain__mobile {
		display: none !important;
	}
}

.oa-side__card {
	border-radius: 32px;
	background: #FFFFFF;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.oa-side__list {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.oa-side__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 6px 8px;
}

.oa-side__all {
	font-size: 13px;
	font-weight: 700;
	color: var(--oa-accent-ink);
}

.oa-side__all:hover {
	text-decoration: underline;
}

/* Кнопка категории (левое меню и нижняя панель) */
.oa-catbtn {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 48px;
	padding: 6px 8px 6px 6px;
	border-radius: 16px;
	color: var(--oa-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	transition: background 0.18s ease, color 0.18s ease;
}

.oa-catbtn__icon {
	width: 36px;
	height: 36px;
	border-radius: 11px;
	background: var(--oa-card-2);
	color: var(--oa-accent-ink);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.18s ease;
}

.oa-catbtn:not([aria-current]):hover {
	background: var(--oa-card-2);
}

.oa-catbtn:not([aria-current]):hover .oa-catbtn__icon {
	background: #FFFFFF;
}

.oa-catbtn[aria-current="page"] {
	background: var(--oa-ink);
	color: #FFFFFF;
}

.oa-catbtn[aria-current="page"] .oa-catbtn__icon {
	background: var(--oa-accent);
	color: var(--oa-on-accent);
}

.oa-catbtn[aria-current="page"] .oa-count {
	background: var(--oa-accent);
	color: var(--oa-on-accent);
}

.oa-side__consult {
	border-radius: 32px;
	background: var(--oa-dark-grad);
	color: #FFFFFF;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.oa-side__consult-title {
	font-family: var(--oa-font-head);
	font-size: 18px;
	line-height: 1.25;
	font-weight: 500;
}

.oa-side__consult-text {
	font-size: 14px;
	line-height: 1.55;
	color: var(--oa-on-dark-5);
}

.oa-side__consult-phone {
	font-family: var(--oa-font-head);
	font-size: 17px;
	font-weight: 500;
	color: #FFFFFF;
}

/* ---------- Телефон: поиск и лента чипов ---------- */
.oa-catmain__mobile {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.oa-catmain__mobile .oa-lsearch__input {
	font-size: 16px;
}

.oa-chiprow {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	margin: 0 -10px;
	padding: 0 10px 2px;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.oa-chiprow::-webkit-scrollbar {
	display: none;
}

.oa-chiprow__all {
	flex-shrink: 0;
	scroll-snap-align: start;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 16px 0 12px;
	border-radius: var(--oa-r-pill);
	background: var(--oa-accent);
	color: var(--oa-on-accent);
	font-size: 14px;
	font-weight: 700;
}

.oa-chiprow__chip {
	flex-shrink: 0;
	scroll-snap-align: start;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 6px 0 16px;
	border: 1px solid var(--oa-line);
	border-radius: var(--oa-r-pill);
	background: transparent;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.oa-chiprow__chip .oa-count {
	min-width: 26px;
	height: 26px;
	padding: 0 7px;
}

.oa-chiprow__chip[aria-current="page"] {
	border-color: var(--oa-ink);
	background: var(--oa-ink);
	color: #FFFFFF;
}

.oa-chiprow__chip[aria-current="page"] .oa-count {
	background: var(--oa-accent);
	color: var(--oa-on-accent);
}

@media (min-width: 640px) {
	.oa-chiprow {
		margin: 0 -22px;
		padding: 0 22px 2px;
	}
}

/* ---------- Панель: количество, сортировка, вид ---------- */
.oa-catbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	padding-bottom: 12px;
	border-bottom: 1px solid #EFEDE6;
}

.oa-catbar__info {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	min-width: 0;
}

.oa-catbar__title {
	font-size: 16px;
	font-weight: 700;
}

.oa-catbar__count {
	font-size: 14px;
	font-weight: 700;
	color: var(--oa-muted);
}

.oa-catbar__tools {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 100%;
}

.oa-sort {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
	font-size: 13px;
	font-weight: 700;
	color: var(--oa-muted);
}

.oa-sort__label {
	display: none;
}

.oa-sort__select {
	flex: 1 1 auto;
	height: 44px;
	padding: 0 34px 0 14px;
	border-radius: var(--oa-r-pill);
	font-size: 14px;
	font-weight: 700;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23121412' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}

.oa-views {
	flex-shrink: 0;
	display: flex;
	gap: 2px;
	padding: 3px;
	border-radius: var(--oa-r-pill);
	background: var(--oa-card-2);
}

.oa-views__btn {
	width: 40px;
	height: 38px;
	border-radius: var(--oa-r-pill);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--oa-text);
	transition: background 0.2s ease;
}

.oa-views__btn:hover {
	background: #FFFFFF;
}

.oa-views__btn[aria-pressed="true"] {
	background: var(--oa-ink);
	color: var(--oa-accent-light);
}

/* Вид «авто» без выбора: подсветка по ширине экрана */
.oa-views--auto .oa-views__btn[data-view="rows"] {
	background: var(--oa-ink);
	color: var(--oa-accent-light);
}

@media (min-width: 640px) {
	.oa-views--auto .oa-views__btn[data-view="rows"] {
		background: transparent;
		color: var(--oa-text);
	}

	.oa-views--auto .oa-views__btn[data-view="grid"] {
		background: var(--oa-ink);
		color: var(--oa-accent-light);
	}
}

@media (min-width: 640px) {
	.oa-catbar {
		padding-bottom: 16px;
	}

	.oa-catbar__title {
		font-size: 18px;
	}

	.oa-catbar__tools {
		flex: 0 0 auto;
	}

	.oa-sort__label {
		display: inline;
	}
}

/* ---------- Показать ещё + страницы ---------- */
.oa-more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding-top: 6px;
}

.oa-more__btn {
	min-height: 52px;
	padding: 0 26px;
	gap: 10px;
	font-size: 15px;
}

.oa-more__btn[aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

/* ---------- О категории ---------- */
.oa-catabout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.oa-catabout__text {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.oa-catabout__text p {
	max-width: 760px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--oa-text);
	text-wrap: pretty;
}

/* Правая колонка (v2.3): подпись «Как заказать» и 3 шага в одну колонку (планшет — в 2) */
.oa-catabout__order {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.oa-catabout__caption {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--oa-muted);
}

.oa-catsteps {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}

.oa-catsteps__item {
	border-radius: 22px;
	background: var(--oa-card-2);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.oa-catsteps__num {
	width: 40px;
	height: 40px;
	border-radius: var(--oa-r-pill);
	background: var(--oa-ink);
	color: var(--oa-accent-light);
	font-family: var(--oa-font-head);
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: center;
}

.oa-catsteps__title {
	font-size: 16px;
	font-weight: 700;
}

.oa-catsteps__text {
	font-size: 14px;
	line-height: 1.55;
	color: var(--oa-text);
}

@media (min-width: 640px) and (max-width: 1023px) {
	.oa-catsteps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.oa-catabout {
		grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
		gap: 48px;
	}
}

/* ---------- Нижняя панель категорий (телефон) ---------- */
.oa-sheet {
	width: 100%;
	max-width: 100%;
	max-height: 82vh;
	margin: auto 0 0;
	padding: 10px 14px 20px;
	border: 0;
	border-radius: 28px 28px 0 0;
	background: #FFFFFF;
	color: var(--oa-ink);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.oa-sheet[open] {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.oa-sheet::backdrop {
	background: rgba(16, 19, 22, 0.55);
}

.oa-sheet__handle {
	align-self: center;
	width: 44px;
	height: 5px;
	border-radius: var(--oa-r-pill);
	background: var(--oa-line);
	margin-bottom: 6px;
}

.oa-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 0 4px 8px;
}

.oa-sheet__title {
	font-family: var(--oa-font-head);
	font-size: 18px;
	font-weight: 500;
}

.oa-sheet__list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.oa-catbtn--sheet {
	grid-template-columns: 38px minmax(0, 1fr) auto;
	gap: 12px;
	min-height: 52px;
	padding: 6px 10px 6px 6px;
	font-size: 15px;
}

.oa-catbtn--sheet .oa-catbtn__icon {
	width: 38px;
	height: 38px;
	border-radius: 12px;
}

.oa-catbtn--sheet .oa-count {
	min-width: 30px;
	height: 26px;
}

.oa-sheet__all {
	margin-top: 6px;
	min-height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--oa-r-pill);
	background: var(--oa-ink);
	color: #FFFFFF;
	font-size: 15px;
	font-weight: 700;
}

@media (min-width: 640px) {
	.oa-sheet {
		width: 480px;
		margin: auto;
		border-radius: 28px;
	}
}

/* ---------- Ячейка «Не нашли нужное изделие?» в последнем ряду плиток (v2.1) ---------- */
/* Без JS — на всю ширину ряда; JS задаёт остаток последнего ряда */
.oa-hint {
	grid-column: 1 / -1;
	min-width: 0;
	border-radius: 20px;
	background: linear-gradient(150deg, #1F231E 0%, #121412 58%, #151814 100%);
	color: #FFFFFF;
	padding: 14px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 18px;
}

.oa-hint[hidden] {
	display: none;
}

.oa-hint__text {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.oa-hint__icon {
	width: 46px;
	height: 46px;
	border-radius: 14px;
	background: rgba(110, 196, 164, 0.14);
	display: flex;
	align-items: center;
	justify-content: center;
}

.oa-hint__title {
	font-family: var(--oa-font-head);
	font-size: 15px;
	line-height: 1.25;
	font-weight: 500;
}

.oa-hint__desc {
	max-width: 440px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--oa-on-dark-5);
}

.oa-hint__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.oa-hint__phone {
	display: none;
	min-height: 46px;
	padding: 0 18px;
	font-size: 14px;
}

.oa-hint.is-wide .oa-hint__phone {
	display: inline-flex;
}

/* Узкая ячейка (одна колонка): кнопка на всю ширину */
.oa-hint:not(.is-wide) .oa-hint__actions .oa-btn {
	width: 100%;
	justify-content: space-between;
	padding-left: 14px;
	font-size: 13px;
}

.oa-hint:not(.is-wide) .oa-hint__actions .oa-btn__circle {
	width: 32px;
	height: 32px;
}

@media (min-width: 640px) {
	.oa-hint {
		border-radius: 24px;
	}
}

@media (min-width: 1024px) {
	.oa-hint {
		padding: 26px;
	}

	.oa-hint__title {
		font-size: 20px;
	}
}
