/* ==========================================================================
   Kinotheatre — нижняя панель и каталог (только мобильные)
   ========================================================================== */

:root {
	--kt-tabbar-h: 56px;
}

.kt-tabbar,
.kt-catalog {
	display: none;
}

@media (max-width: 767px) {
	.kt-tabbar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 95;
		align-items: stretch;
		justify-content: space-around;
		gap: 0;
		height: calc(var(--kt-tabbar-h) + env(safe-area-inset-bottom, 0px));
		padding-bottom: env(safe-area-inset-bottom, 0px);
		background: #0b0b0f;
		border-top: 1px solid var(--kt-border);
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
	}

	.kt-page {
		padding-bottom: calc(var(--kt-tabbar-h) + env(safe-area-inset-bottom, 0px));
	}

	.kt-tabbar__item {
		display: flex;
		flex: 1 1 0;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-width: 0;
		padding: 6px 4px 4px;
		font: inherit;
		color: var(--kt-text-dim);
		text-decoration: none;
		background: transparent;
		border: none;
		border-radius: 0;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		transition: color 0.2s ease;
	}

	.kt-tabbar__item:hover,
	.kt-tabbar__item:focus-visible {
		color: var(--kt-text-muted);
	}

	.kt-tabbar__item.is-active {
		color: var(--kt-text);
	}

	.kt-tabbar__item.is-active .kt-tabbar__icon {
		color: var(--kt-accent);
	}

	.kt-tabbar__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 24px;
		height: 24px;
		color: inherit;
		transition: color 0.2s ease;
	}

	.kt-tabbar__icon svg {
		display: block;
		width: 24px;
		height: 24px;
	}

	.kt-tabbar__label {
		font-size: 0.625rem;
		font-weight: 500;
		line-height: 1.1;
		letter-spacing: 0.01em;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
	}

	/* --- Каталог (шторка) --- */
	.kt-catalog {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 110;
		pointer-events: none;
	}

	.kt-catalog[hidden] {
		display: none !important;
	}

	.kt-catalog__backdrop {
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, 0.65);
		opacity: 0;
		transition: opacity 0.25s ease;
	}

	.kt-catalog__panel {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		flex-direction: column;
		max-height: min(78vh, 560px);
		padding-bottom: calc(var(--kt-tabbar-h) + env(safe-area-inset-bottom, 0px));
		background: var(--kt-bg-elevated);
		border-radius: var(--kt-radius-lg) var(--kt-radius-lg) 0 0;
		border-top: 1px solid var(--kt-border);
		box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
		transform: translateY(100%);
		transition: transform 0.3s ease;
	}

	body.kt-catalog-open {
		overflow: hidden;
	}

	body.kt-catalog-open .kt-catalog {
		pointer-events: auto;
	}

	body.kt-catalog-open .kt-catalog__backdrop {
		opacity: 1;
	}

	body.kt-catalog-open .kt-catalog__panel {
		transform: translateY(0);
	}

	.kt-catalog__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 16px var(--kt-gap) 12px;
		border-bottom: 1px solid var(--kt-border);
		flex-shrink: 0;
	}

	.kt-catalog__title {
		margin: 0;
		font-size: 1.125rem;
		font-weight: 700;
		color: var(--kt-text);
	}

	.kt-catalog__close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		color: var(--kt-text-muted);
		border-radius: var(--kt-radius-sm);
		transition: color 0.2s ease, background 0.2s ease;
	}

	.kt-catalog__close:hover {
		color: var(--kt-text);
		background: var(--kt-bg-hover);
	}

	.kt-catalog__nav {
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.kt-catalog__list {
		margin: 0;
		padding: 8px 0 12px;
		list-style: none;
	}

	.kt-catalog__link {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 14px var(--kt-gap);
		font-size: 0.9375rem;
		font-weight: 500;
		color: var(--kt-text);
		text-decoration: none;
		transition: background 0.15s ease, color 0.15s ease;
	}

	.kt-catalog__link::after {
		content: "";
		flex-shrink: 0;
		width: 7px;
		height: 7px;
		border-top: 2px solid var(--kt-text-dim);
		border-right: 2px solid var(--kt-text-dim);
		transform: rotate(45deg);
	}

	.kt-catalog__link:hover,
	.kt-catalog__link:focus-visible {
		background: var(--kt-bg-hover);
		color: var(--kt-text);
	}

	.kt-catalog__link:active {
		background: var(--kt-bg-surface);
	}

	/* Упрощённая шапка */
	.kt-burger,
	.kt-nav {
		display: none !important;
	}

	.kt-header__actions {
		display: none !important;
	}

	.kt-header .kt-header__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"logo"
			"search";
	}

	.kt-logo {
		justify-self: start;
	}

	.kt-footer {
		margin-bottom: 0;
	}
}
