/*
 * Catalogue — design/Category.dc.html. Below 960 px the filters move into a
 * drawer opened by „Филтри“; below 700 px the grid has two columns and the
 * cards are the phone cards of the home page.
 */

/* 1. Band ------------------------------------------------------------------ */

.cat-band {
	position: relative;
	overflow: hidden;
	overflow: clip;
	background: #eef5ff;
}

/* a watermark, not a picture */
.cat-band__deco {
	position: absolute;
	right: -40px;
	top: -40px;
	width: 420px;
	height: 420px;
	border-radius: var(--r-pill);
	opacity: 0.18;
}

.cat-band__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding-top: 28px;
	padding-bottom: 44px;
}

.crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--muted);
}

.crumbs a {
	color: var(--muted);
}

.crumbs a:hover {
	color: var(--ink);
	text-decoration: underline;
}

.crumbs > :last-child {
	color: var(--ink);
	font-weight: 600;
}

.cat-band__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
}

.cat-band__text {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 640px;
}

.cat-band__title {
	font-size: clamp(36px, 4.4vw, 60px);
	line-height: 1.02;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.cat-band__desc {
	font-size: 17px;
	line-height: 1.55;
	color: var(--ink-2);
}

.cat-band__desc p {
	margin: 0;
}

.cat-band__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cat-band__pills li {
	padding: 10px 14px;
	border-radius: var(--r-pill);
	background: var(--white);
	font-size: 14px;
	font-weight: 600;
}

/* 2. Theme chips ------------------------------------------------------------ */

.cat-chips {
	padding-top: 24px;
}

.chip-row {
	gap: 10px;
	margin: 0;
	padding: 0 0 6px;
	list-style: none;
}

.tchip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--line-2);
	border-radius: var(--r-pill);
	background: var(--white);
	font: 600 14px var(--font-body);
	white-space: nowrap;
}

.tchip:hover {
	border-color: var(--ink);
	color: var(--ink);
}

.tchip.is-on {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--white);
}

.tchip__dot {
	width: 22px;
	height: 22px;
	margin-left: -6px;
	border-radius: var(--r-pill);
	flex-shrink: 0;
}

.tchip__count {
	color: #6b6878;
	font-weight: 500;
}

.tchip.is-on .tchip__count {
	color: #c9c4d6;
}

/* 3. Layout ----------------------------------------------------------------- */

.cat-body {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	align-items: flex-start;
	padding-top: 28px;
}

.cat-main {
	flex: 999 1 560px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* 4. Filters ---------------------------------------------------------------- */

.filters {
	flex: 1 1 260px;
	max-width: 280px;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.filters__title {
	font-size: 18px;
	font-weight: 700;
}

.filters__clear {
	margin-left: auto;
	font-size: 14px;
	color: var(--muted);
	text-decoration: underline;
}

.filters__close,
.filters-open,
.filters__apply {
	display: none;
}

.filters__form {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.filters__group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 20px;
	padding: 20px 0 0;
	border: 0;
	border-top: 1px solid var(--line);
}

.filters__legend {
	float: left; /* lets the legend sit inside the fieldset's padding */
	width: 100%;
	padding: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
}

.check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 36px;
	font-size: 15px;
	cursor: pointer;
}

.check input {
	position: absolute;
	opacity: 0;
	width: 22px;
	height: 22px;
	margin: 0;
}

.check__box {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid var(--field-border);
	border-radius: 7px;
	color: transparent;
}

.check input:checked + .check__box {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--white);
}

.check input:focus-visible + .check__box {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.check__count {
	margin-left: auto;
	font-size: 13px;
	color: var(--muted);
}

/* Price: two range inputs over one track */
.range {
	position: relative;
	height: 24px;
	margin-top: 4px;
}

.range__track {
	position: absolute;
	left: 0;
	right: 0;
	top: 10px;
	height: 4px;
	border-radius: 4px;
	background: linear-gradient(90deg, #e5e1ea 0 var(--lo), var(--ink) var(--lo) var(--hi), #e5e1ea var(--hi) 100%);
}

.range input[type="range"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 24px;
	margin: 0;
	background: transparent;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.range input[type="range"]::-webkit-slider-runnable-track {
	background: transparent;
	height: 24px;
}

.range input[type="range"]::-moz-range-track {
	background: transparent;
	height: 24px;
}

.range input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border: 2px solid var(--ink);
	border-radius: var(--r-pill);
	background: var(--white);
	pointer-events: auto;
	cursor: pointer;
}

.range input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border: 2px solid var(--ink);
	border-radius: var(--r-pill);
	background: var(--white);
	pointer-events: auto;
	cursor: pointer;
}

.range input[type="range"]:focus-visible::-webkit-slider-thumb {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.range input[type="range"]:focus-visible::-moz-range-thumb {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.range__values {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	color: var(--ink-2);
}

/* „Само налични“ switch */
.switch {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 36px;
	font-size: 15px;
	cursor: pointer;
}

.switch input {
	position: absolute;
	right: 0;
	width: 44px;
	height: 26px;
	margin: 0;
	opacity: 0;
}

.switch__track {
	position: relative;
	width: 44px;
	height: 26px;
	flex-shrink: 0;
	border-radius: var(--r-pill);
	background: var(--field-border);
	transition: background 0.2s;
}

.switch__track::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 3px;
	width: 20px;
	height: 20px;
	border-radius: var(--r-pill);
	background: var(--white);
	transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch__track {
	background: var(--ink);
}

.switch input:checked + .switch__track::after {
	transform: translateX(18px);
}

.switch input:focus-visible + .switch__track {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

/* „Липсва любимият ти герой?“ */
.suggest {
	border-radius: 20px;
	background: var(--b2b-pill);
	padding: 20px;
}

.suggest summary {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	cursor: pointer;
}

.suggest summary::-webkit-details-marker {
	display: none;
}

.suggest__title {
	font-size: 15px;
	color: #2e1c8f;
}

.suggest__text {
	font-size: 14px;
	line-height: 1.5;
	color: #3d2e8a;
}

.suggest__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	color: var(--b2b-ink);
}

.suggest[open] .suggest__link {
	display: none;
}

.suggest__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 14px;
}

.suggest__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #3d2e8a;
}

.suggest__field input {
	height: 44px;
	padding: 0 12px;
	border: 1.5px solid var(--field-border);
	border-radius: 12px;
	background: var(--white);
	font: 500 15px var(--font-body);
	color: var(--ink);
}

.suggest__field input:focus {
	border-color: var(--b2b);
}

.btn--b2b {
	background: var(--b2b);
	color: var(--white);
}

.btn--b2b:hover {
	background: var(--b2b-ink);
	color: var(--white);
}

.suggest__note {
	font-size: 12px;
	line-height: 1.4;
	color: #3d2e8a;
}

.suggest__note a {
	text-decoration: underline;
}

/* 5. Toolbar ---------------------------------------------------------------- */

.cat-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.cat-toolbar__left {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.cat-count {
	margin-right: 6px;
	font-size: 14px;
	color: var(--muted);
}

.active-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 4px 0 14px;
	border-radius: var(--r-pill);
	background: var(--soft-3);
	font-size: 14px;
	font-weight: 600;
}

.active-chip a {
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--r-pill);
}

.active-chip a:hover {
	background: var(--white);
	color: var(--ink);
}

.sort__label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: var(--muted);
}

.sort select {
	height: 44px;
	padding: 0 40px 0 16px;
	border: 1.5px solid var(--field-border);
	border-radius: var(--r-pill);
	background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2315131c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
	font: 600 14px var(--font-body);
	color: var(--ink);
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

/* 6. Grid ------------------------------------------------------------------- */

.cat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 32px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cat-grid__item {
	display: flex;
	min-width: 0;
}

.cat-grid__item .card {
	width: 100%;
}

.b2b-tile {
	position: relative;
	overflow: hidden;
	overflow: clip;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 28px;
	width: 100%;
	min-height: 420px;
	padding: 28px;
	border-radius: var(--r-card);
	background: var(--b2b);
	color: var(--white);
}

.b2b-tile:hover {
	color: var(--white);
}

/* The rainbow stays in the top corner, above the title at every width: its
   lowest point is ~80 px down, the title starts below 85 px. Until 1.0.5 it
   reached ~170 px and ran through „Хавлии за целия отбор“ whenever the tile
   was short (phones, and ~894 px wide tablets). */
.b2b-tile__stripe {
	position: absolute;
	right: -70px;
	top: -36px;
	width: 240px;
	height: 60px;
	transform: rotate(-30deg);
}

.b2b-tile__badge {
	position: relative;
	align-self: flex-start;
	padding: 7px 12px;
	border-radius: var(--r-pill);
	background: rgba(255, 255, 255, 0.16);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.b2b-tile__body {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.b2b-tile__title {
	font-size: 28px;
	line-height: 1.1;
	font-weight: 700;
}

.b2b-tile__text {
	font-size: 15px;
	line-height: 1.5;
	color: var(--b2b-soft);
}

.b2b-tile__cta {
	align-self: flex-start;
	margin-top: 6px;
}

.b2b-tile:hover .b2b-tile__cta {
	background: var(--soft-3);
}

/* 7. Load more, empty, SEO text -------------------------------------------- */

.more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding-top: 32px;
}

.more__text {
	font-size: 14px;
	color: var(--muted);
}

.more__bar {
	width: 240px;
	height: 4px;
	border-radius: 4px;
	background: #e5e1ea;
	overflow: hidden;
}

.more__bar span {
	display: block;
	height: 100%;
	background: var(--ink);
	transition: width 0.3s var(--ease);
}

.more__btn {
	height: 52px;
	padding: 0 28px;
	border: 1.5px solid var(--ink);
	background: var(--white);
	color: var(--ink);
	font-weight: 700;
}

.more__btn:hover {
	background: var(--ink);
	color: var(--white);
}

.more__btn.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.cat-empty {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	padding: 40px 0;
	font-size: 17px;
	color: var(--ink-2);
}

.cat-empty p {
	margin: 0;
}

.cat-empty__title {
	color: var(--ink);
	font-size: clamp(22px, 2.4vw, 28px);
	font-weight: 700;
	line-height: 1.2;
}

.cat-empty__themes {
	display: flex;
	flex-wrap: wrap;
}

.cat-empty__more {
	margin: 8px 0 18px;
	font-size: clamp(20px, 2vw, 24px);
	font-weight: 700;
}

.cat-seo {
	padding-top: 96px;
}

.cat-seo__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	padding-top: 48px;
	border-top: 1px solid var(--line);
}

.cat-seo__title {
	flex: 1 1 300px;
	font-size: 26px;
	line-height: 1.2;
	font-weight: 700;
}

.cat-seo__text {
	flex: 2 1 480px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--ink-2);
}

.cat-seo__text p {
	margin: 0;
}

.cat-seo__more summary {
	display: inline;
	font-weight: 600;
	color: var(--ink);
	text-decoration: underline;
	cursor: pointer;
	list-style: none;
}

.cat-seo__more summary::-webkit-details-marker {
	display: none;
}

.cat-seo__more[open] summary {
	display: none;
}

.cat-seo__more > *:not(summary) + * {
	margin-top: 14px;
}

/* 8. Tablets: the filters become a drawer ----------------------------------- */

@media (max-width: 960px) {
	.filters {
		display: none;
	}

	.filters.is-open {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 90;
		display: flex;
		width: min(380px, 92vw);
		max-width: none;
		padding: 16px 20px 28px;
		overflow-y: auto;
		background: var(--white);
		border-radius: 0 28px 28px 0;
		animation: drawer-in 0.24s var(--ease);
	}

	.filters-backdrop {
		position: fixed;
		inset: 0;
		z-index: 89;
		background: rgba(21, 19, 28, 0.5);
	}

	.filters__close {
		display: inline-flex;
	}

	.filters__apply {
		display: inline-flex;
		width: 100%;
		margin-top: 4px;
	}

	.filters-open {
		display: inline-flex;
		height: 44px;
		padding: 0 16px;
		border: 1.5px solid var(--ink);
		background: var(--white);
		color: var(--ink);
		font-size: 14px;
	}

	.filters-open__n {
		min-width: 20px;
		height: 20px;
		padding: 0 6px;
		border-radius: var(--r-pill);
		background: var(--ink);
		color: var(--white);
		font-size: 12px;
		line-height: 20px;
		text-align: center;
	}

	/* without JavaScript the drawer cannot open: show the filters inline */
	.no-js .filters {
		display: flex;
		max-width: none;
		flex-basis: 100%;
	}

	.no-js .filters-open {
		display: none;
	}
}

/* 9. Phones ----------------------------------------------------------------- */

@media (max-width: 700px) {
	.cat-band__deco {
		width: 240px;
		height: 240px;
		right: -60px;
		top: -60px;
	}

	.cat-band__inner {
		gap: 12px;
		padding-top: 16px;
		padding-bottom: 24px;
	}

	.cat-band__title {
		font-size: 32px;
	}

	.cat-band__desc {
		font-size: 15px;
	}

	.cat-band__row {
		gap: 14px;
	}

	.cat-band__pills li {
		padding: 8px 12px;
		font-size: 13px;
	}

	.cat-chips {
		padding-top: 16px;
	}

	.chip-row {
		margin: 0 calc(-1 * var(--gutter));
		padding: 0 var(--gutter) 4px;
		scroll-padding: 0 var(--gutter); /* snap the first chip to the gutter, not the edge */
	}

	.cat-body {
		padding-top: 16px;
		gap: 16px;
	}

	.cat-main {
		gap: 16px;
	}

	.cat-toolbar {
		gap: 10px;
	}

	.cat-count {
		margin-right: 0;
	}

	.sort__label {
		font-size: 0; /* the select says it */
	}

	.sort select {
		height: 44px;
		font-size: 14px;
	}

	.cat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 10px;
	}

	.cat-grid__item--b2b {
		grid-column: 1 / -1;
	}

	.b2b-tile {
		min-height: 0;
		gap: 36px;
		padding: 22px;
		border-radius: 22px;
	}

	.b2b-tile__title {
		font-size: 24px;
	}

	.more {
		padding-top: 16px;
	}

	.cat-seo {
		padding-top: 44px;
	}

	.cat-seo__inner {
		gap: 16px;
		padding-top: 28px;
	}

	.cat-seo__title {
		font-size: 22px;
	}

	.cat-seo__text {
		font-size: 15px;
	}
}

/* Touch screens (main.css, „Touch screens“): „Прочети още“ is 44 px high,
   the price slider a 44 px strip, its handles 28 px. */
@media (pointer: coarse) {
	.cat-seo__more summary {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	.range,
	.range input[type="range"],
	.range input[type="range"]::-webkit-slider-runnable-track {
		height: 44px;
	}

	.range__track {
		top: 20px;
	}

	.range input[type="range"]::-webkit-slider-thumb {
		width: 28px;
		height: 28px;
		margin-top: 8px;
	}

	.range input[type="range"]::-moz-range-thumb {
		width: 24px;
		height: 24px;
	}
}

