/**
 * Главная: блок «Популярные категории» (16 карточек на мобильном, 15 на ПК).
 */

.sm-popcat {
	font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	margin-top: 0;
	margin-bottom: 2rem;
	padding: 0;
	background-color: #faf8f5;
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.sm-popcat {
		margin-bottom: 5.5rem;
	}
}

.sm-popcat__inner {
	min-width: 0;
}

.sm-popcat__bar {
	margin: 0 0 0.75rem;
}

.sm-popcat__title {
	margin: 0;
}

.sm-popcat__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.65rem;
}

@media (min-width: 768px) {
	.sm-popcat__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.875rem;
	}
}

@media (min-width: 768px) {
	/* На планшете и ПК — 15 карточек (16-я только на мобильном). */
	.sm-popcat__item--mobile-only {
		display: none;
	}
}

@media (min-width: 900px) {
	.sm-popcat__grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 1rem;
	}
}

@media (min-width: 1200px) {
	.sm-popcat__grid {
		gap: 1.125rem;
	}
}

.sm-popcat__item {
	margin: 0;
	padding: 0;
	min-width: 0;
}

.sm-popcat__card {
	display: block;
	position: relative;
	width: 100%;
	min-height: 0;
	aspect-ratio: 1.15 / 1;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: #fff;
	background-color: #1e3a52;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sm-popcat__photo {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}

.sm-popcat__card:hover,
.sm-popcat__card:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
	outline: none;
}

.sm-popcat__card:focus-visible {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px #003459;
}

.sm-popcat__card-shade {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0) 0%,
		rgba(0, 0, 0, 0) 58%,
		rgba(0, 0, 0, 0.28) 78%,
		rgba(0, 0, 0, 0.45) 88%,
		rgba(0, 0, 0, 0.62) 100%
	);
	pointer-events: none;
}

.sm-popcat__icon {
	position: absolute;
	top: 0.55rem;
	left: 0.55rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
	pointer-events: none;
}

.sm-popcat__icon img {
	display: block;
	width: 1.35rem;
	height: 1.35rem;
	object-fit: contain;
}

.sm-popcat__card-foot {
	position: absolute;
	inset: auto 0 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 0.65rem 0.7rem;
	pointer-events: none;
}

.sm-popcat__label {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	min-width: 0;
	flex: 1 1 auto;
	font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
}

.sm-popcat__name {
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.sm-popcat__from {
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25;
	color: rgba(255, 255, 255, 0.92);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.sm-popcat__go {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: #fff;
	color: #6b7280;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.sm-popcat__go svg {
	display: block;
}

@media (min-width: 768px) {
	.sm-popcat__bar {
		margin-bottom: 0.75rem;
	}

	.sm-popcat__card {
		border-radius: 14px;
	}

	.sm-popcat__icon {
		top: 0.65rem;
		left: 0.65rem;
		width: 2.5rem;
		height: 2.5rem;
	}

	.sm-popcat__icon img {
		width: 1.5rem;
		height: 1.5rem;
	}

	.sm-popcat__card-foot {
		padding: 0.75rem 0.75rem 0.8rem;
	}

	.sm-popcat__name {
		font-size: 1.125rem;
	}

	.sm-popcat__from {
		font-size: 0.9375rem;
	}

	.sm-popcat__go {
		width: 2rem;
		height: 2rem;
	}
}

@media (max-width: 767px) {
	.sm-popcat {
		--sm-section-title: 1.125rem;
		--sm-hits-navy-deep: #001f3f;
		margin-bottom: 1.25rem;
	}

	.sm-popcat__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sm-popcat__item--mobile-only {
		display: block;
	}

	.sm-popcat__inner {
		display: flex;
		flex-direction: column;
		gap: 0.65rem;
	}

	.sm-popcat__bar {
		margin-bottom: 0;
		flex-wrap: nowrap;
		gap: 0.5rem;
		align-items: center;
	}

	.sm-popcat .sm-popcat__title {
		flex: 1 1 auto;
		min-width: 0;
		font-size: var(--sm-section-title, 1.125rem);
		font-weight: 500;
		text-align: left;
		line-height: 1.25;
	}

	.sm-popcat__all {
		flex-shrink: 0;
		max-width: 48%;
		font-size: 0.8125rem;
		padding: 0.35rem 0;
		text-align: right;
		line-height: 1.25;
	}

	.sm-popcat__grid {
		gap: 0.65rem;
	}

	.sm-popcat__card {
		aspect-ratio: 1 / 1;
		border-radius: 10px;
	}

	.sm-popcat__card:hover,
	.sm-popcat__card:focus-visible {
		transform: none;
	}

	.sm-popcat__icon {
		top: 0.4rem;
		left: 0.4rem;
		width: 1.85rem;
		height: 1.85rem;
	}

	.sm-popcat__icon img {
		width: 1.1rem;
		height: 1.1rem;
	}

	.sm-popcat__card-foot {
		padding: 0.45rem 0.45rem 0.5rem;
		gap: 0.35rem;
	}

	.sm-popcat__label {
		gap: 0.1rem;
	}

	.sm-popcat__name {
		font-size: 0.8125rem;
		line-height: 1.2;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.sm-popcat__from {
		font-size: 0.6875rem;
		line-height: 1.2;
	}

	.sm-popcat__go {
		width: 34px;
		height: 34px;
		min-width: 34px;
		border-radius: 7px;
	}

	.sm-popcat__go svg {
		width: 18px;
		height: 18px;
	}
}

@media (min-width: 768px) {
	.sm-popcat__bar {
		position: relative;
		margin-bottom: 0.75rem;
		min-height: 2.5rem;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.sm-popcat__title {
		width: 100%;
		font-size: 1.45rem;
		font-weight: 500;
		line-height: 1.2;
		color: #001f3f;
		letter-spacing: -0.02em;
		text-align: center;
	}

	.sm-popcat__all {
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.4rem;
		margin: 0;
		padding: 0;
		border: none;
		background: none;
		color: #001f3f;
		font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
		font-size: 1rem;
		font-weight: 500;
		line-height: 1.25;
		text-decoration: none;
		transition: color 0.15s ease;
	}

	.sm-popcat__all:hover,
	.sm-popcat__all:focus-visible {
		color: #4b7b9b;
	}

	.sm-popcat__all:focus-visible {
		outline: 2px solid #003459;
		outline-offset: 3px;
		border-radius: 4px;
	}
}
