/* -------------------------------------------------------------------------
   06-tiles.css — Brutalist промо-плитки и сетки
-------------------------------------------------------------------------- */

/* ── Контейнер плиток ───────────────────────────────────────────────────── */
.enclave-tiles {
	display: grid;
	gap: 0;
	grid-auto-flow: row;
	align-items: stretch;
}
.enclave-tiles.enclave-tiles--fluid {
	grid-template-columns: repeat(
		auto-fit,
		minmax(min(100%, var(--enclave-card-min, 200px)), 1fr)
	);
}
.enclave-tiles.enclave-tiles--cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.enclave-tiles.enclave-tiles--cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.enclave-tiles.enclave-tiles--cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
.enclave-tiles.enclave-tiles--cols-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}
.enclave-tiles.enclave-tiles--cols-6 {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}
.enclave-tiles.enclave-tiles--cols-7 {
	grid-template-columns: repeat(7, minmax(0, 1fr));
}
.enclave-tiles.enclave-tiles--cols-8 {
	grid-template-columns: repeat(8, minmax(0, 1fr));
}
.enclave-tiles > .enclave-tile {
	float: none !important;
	position: relative !important;
	width: 100% !important;
	margin: 0 !important;
}
@media (max-width: 1200px) {
	.enclave-tiles.enclave-tiles--cols-4,
	.enclave-tiles.enclave-tiles--cols-5,
	.enclave-tiles.enclave-tiles--cols-6,
	.enclave-tiles.enclave-tiles--cols-7,
	.enclave-tiles.enclave-tiles--cols-8 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 900px) {
	.enclave-tiles.enclave-tiles--cols-4,
	.enclave-tiles.enclave-tiles--cols-5,
	.enclave-tiles.enclave-tiles--cols-6,
	.enclave-tiles.enclave-tiles--cols-7,
	.enclave-tiles.enclave-tiles--cols-8,
	.enclave-tiles.enclave-tiles--cols-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 640px) {
	.enclave-tiles:not(.enclave-tiles--fluid) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ── Brutalist промо-плитка .enclave-tile ───────────────────────────────── */
.enclave-tile {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	min-height: 420px;
	display: block;
	text-decoration: none;
	color: var(--w);
	/* border-top: var(--b); */
	border-bottom: var(--b);
	border-left: var(--b);
	border-radius: 0;
	transition: background 0.12s;
}

.enclave-tile:last-of-type {
	border-right: var(--b);
}

.enclave-tile--1-1 {
	aspect-ratio: 1 / 1;
	min-height: 280px;
}
.enclave-tile--2-3 {
	aspect-ratio: 2 / 3;
	min-height: 420px;
}
.enclave-tile--3-2 {
	aspect-ratio: 3 / 2;
	min-height: 280px;
}
.enclave-tile__img {
	position: absolute;
	inset: 0;
}
.enclave-tile__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.enclave-tile__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.1));
	z-index: 1;
	transition: background 0.15s;
}
.enclave-tile:hover .enclave-tile__shade {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(232, 255, 58, 0.15));
}
.enclave-tile__content {
	position: relative;
	z-index: 2;
	height: 100%;
	padding: 1.25rem;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
}
.enclave-tile__body {
	display: flex;
	flex-direction: column;
}
.enclave-tile__info {
	display: flex;
	align-items: center;
	gap: 10px;
}
.enclave-tile__text {
	font-family: var(--enclave-heading-font);
	font-size: 2.4rem;
	font-weight: 400;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--w);
	line-height: 1;
	transition: color 0.12s;
}
.enclave-tile:hover .enclave-tile__text {
	color: var(--a);
}

/* Tile with icon — matches .home-cats from new design */
.enclave-tile__info .enclave-tile__icon {
	width: 42px;
	height: 42px;
	background: var(--g);
	border: var(--b);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 1;
	font-size: 18px;
}
.enclave-tile__info .enclave-tile__icon i {
	font-size: 18px;
	color: #bbb;
	line-height: 1;
}
.enclave-tile:hover .enclave-tile__info .enclave-tile__icon {
	background: var(--k);
	border-color: var(--k);
}
.enclave-tile:hover .enclave-tile__info .enclave-tile__icon i {
	color: var(--a);
}
.enclave-tile__info .enclave-tile__text {
	font-size: 28px;
	letter-spacing: 0.04em;
	color: var(--w);
}

.enclave-tile__subtitle {
	font-size: 10px;
	color: rgba(255, 255, 255, 0.6);
	margin: 4px 0 0;
	line-height: 1;
}
.enclave-tile:hover .enclave-tile__subtitle {
	color: rgba(255, 255, 255, 0.8);
}

.enclave-tile:not(.enclave-tile--with-icon) .enclave-tile__icon {
	display: none;
}

/* Tile with icon — matches .home-cats from new design */
.enclave-tile--with-icon {
	aspect-ratio: auto;
	min-height: auto;
	background: var(--w);
	color: var(--k);
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 22px;
	gap: 14px;
	overflow: visible;
}
.enclave-tile--with-icon .enclave-tile__img,
.enclave-tile--with-icon .enclave-tile__shade {
	display: none;
}
.enclave-tile--with-icon .enclave-tile__content {
	position: static;
	padding: 0;
	height: auto;
	flex: 1;
}
.enclave-tile--with-icon .enclave-tile__info {
	gap: 14px;
}
.enclave-tile--with-icon .enclave-tile__icon {
	width: 42px;
	height: 42px;
	background: var(--g);
	border: var(--b);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.enclave-tile--with-icon .enclave-tile__icon i {
	font-size: 18px;
	color: #bbb;
	line-height: 1;
}
.enclave-tile--with-icon:hover .enclave-tile__icon {
	background: var(--k);
	border-color: var(--k);
}
.enclave-tile--with-icon:hover .enclave-tile__icon i {
	color: var(--a);
}
.enclave-tile--with-icon .enclave-tile__text {
	font-family: var(--enclave-heading-font);
	font-size: 22px;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--k);
	line-height: 1;
}
.enclave-tile--with-icon:hover .enclave-tile__text {
	color: var(--k);
}
.enclave-tile--with-icon .enclave-tile__subtitle {
	font-size: 10px;
	color: #aaa;
	margin: 2px 0 0;
	line-height: 1;
}
.enclave-tile--with-icon:hover .enclave-tile__subtitle {
	color: var(--k);
}
.enclave-tile--with-icon:hover {
	background: var(--a);
}

/* ── Вертикальная иконочная плитка (как .cat-tabs из референса) ────────── */
.enclave-tile--with-icon-vertical {
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: 22px 14px;
	text-align: center;
	background: var(--w);
	min-height: 130px;
}
.enclave-tile--with-icon-vertical .enclave-tile__content {
	justify-content: center;
}
.enclave-tile--with-icon-vertical .enclave-tile__info {
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.enclave-tile--with-icon-vertical .enclave-tile__icon,
.enclave-tile.enclave-tile--with-icon-vertical .enclave-tile__info .enclave-tile__icon {
	width: 48px;
	height: 48px;
	background: transparent;
	border: none;
}
.enclave-tile--with-icon-vertical .enclave-tile__icon i,
.enclave-tile.enclave-tile--with-icon-vertical .enclave-tile__info .enclave-tile__icon i {
	font-size: 22px;
	color: #bbb;
}
.enclave-tile--with-icon-vertical .enclave-tile__body {
	align-items: center;
	gap: 4px;
}
.enclave-tile--with-icon-vertical .enclave-tile__text {
	font-size: 16px;
	color: var(--k);
}
.enclave-tile--with-icon-vertical .enclave-tile__subtitle {
	font-size: 9px;
	color: #aaa;
	margin: 0;
}
.enclave-tile--with-icon-vertical:hover {
	background: var(--g);
}
.enclave-tile.enclave-tile--with-icon-vertical:hover .enclave-tile__info .enclave-tile__icon,
.enclave-tile--with-icon-vertical:hover .enclave-tile__icon {
	background: transparent;
	border: none;
}
.enclave-tile.enclave-tile--with-icon-vertical:hover .enclave-tile__info .enclave-tile__icon i,
.enclave-tile--with-icon-vertical:hover .enclave-tile__icon i {
	color: var(--k);
}

.enclave-tile--current {
	background: var(--k) !important;
}
.enclave-tile--current .enclave-tile__text {
	color: var(--w) !important;
}
.enclave-tile--current .enclave-tile__subtitle {
	color: rgba(255, 255, 255, .35) !important;
}
.enclave-tile--current .enclave-tile__icon i {
	color: var(--a) !important;
}

/* Плитки категорий: мобиль */
@media (max-width: 640px) {
	.enclave-section--tile-grid .enclave-tile__text {
		font-size: 1.0rem;
	}
	.enclave-tile {
		min-height: auto;
	}
	/* Горизонтальные иконочные плитки (--with-icon): компактнее в 2 колонки.
	   Вертикальные вкладки каталога (--with-icon-vertical) не трогаем. */
	.enclave-section--tile-grid .enclave-tile.enclave-tile--with-icon:not(.enclave-tile--with-icon-vertical) {
		padding: 14px 12px;
		gap: 10px;
	}
	.enclave-section--tile-grid .enclave-tile.enclave-tile--with-icon:not(.enclave-tile--with-icon-vertical) .enclave-tile__icon {
		width: 34px;
		height: 34px;
	}
	.enclave-section--tile-grid .enclave-tile.enclave-tile--with-icon:not(.enclave-tile--with-icon-vertical) .enclave-tile__icon i {
		font-size: 15px;
	}
}

/* Секции Enclave: во всю ширину окна по флагу блока */
/* Enclave section viewport */
.enclave-section.enclave-section--viewport {
	width: 100vw;
	max-width: 100vw;
	/* margin-left: calc(50% - 49.4vw);
	margin-right: calc(50% - 49.4vw); */
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	box-sizing: border-box;
}

/* Упрощённый вывод: только изображение + круглая кнопка корзины */
.enclave-tiles > .enclave-simplified-card {
	float: none !important;
	position: relative !important;
	width: 100% !important;
	margin: 0 !important;
}
.enclave-simplified-card {
	position: relative;
	border-radius: 4px;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	min-height: 280px;
}
.enclave-simplified-card__media {
	position: absolute;
	inset: 0;
}
.enclave-simplified-card__media-link {
	display: block;
	position: absolute;
	inset: 0;
	text-decoration: none;
	color: inherit;
}
.enclave-simplified-card__media-link img,
.enclave-simplified-card__img-el {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.enclave-simplified-card__cart-btn {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
	text-decoration: none;
	line-height: 0;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.enclave-simplified-card__cart-btn:hover,
.enclave-simplified-card__cart-btn:focus {
	transform: scale(1.05);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	outline: none;
}
.enclave-simplified-cart-svg {
	display: block;
	flex-shrink: 0;
}
.enclave-tile.enclave-tile--simplified:not(.enclave-tile--simplified-archive) {
	text-decoration: none;
	color: inherit;
	cursor: default;
}
.enclave-tile.enclave-tile--simplified-archive .enclave-tile__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.enclave-slider--simplified .enclave-slider-slide--simplified {
	min-height: min(56vh, 448px);
}
.enclave-slider-slide--simplified .enclave-simplified-card__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}
.enclave-slider-slide--simplified .enclave-slider-simplified-archive-link {
	display: block;
	position: absolute;
	inset: 0;
}
.enclave-slider-slide--simplified .enclave-slider-simplified-archive-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.enclave-single-slide.enclave-slider--simplified .enclave-slider-slide--simplified {
	min-height: min(56vh, 448px);
}

/* -------------------------------------------------------------------------
   Размеры картинок (пропорции) для упрощённых карточек товаров
-------------------------------------------------------------------------- */
.enclave-simplified-card--1-1,
.enclave-simplified-card--1-1 .enclave-simplified-card__media--1-1 {
	aspect-ratio: 1 / 1;
}
.enclave-simplified-card--2-3,
.enclave-simplified-card--2-3 .enclave-simplified-card__media--2-3 {
	aspect-ratio: 2 / 3;
}
.enclave-simplified-card--3-2,
.enclave-simplified-card--3-2 .enclave-simplified-card__media--3-2 {
	aspect-ratio: 3 / 2;
}

/* Editor: в iframe 100vw заменяем на 100%, чтобы не ломался скролл */
.editor-styles-wrapper .enclave-section.enclave-section--viewport {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Editor: iframe узкий — явно задаём сетку плиток, чтобы медиа-запросы не схлопывали в 1 колонку */
.editor-styles-wrapper .enclave-tiles.enclave-tiles--cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.editor-styles-wrapper .enclave-tiles.enclave-tiles--cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.editor-styles-wrapper .enclave-tiles.enclave-tiles--cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ── Иконочные вкладки-плитки (.enclave-ctabs) ──────────────────────────── */
.enclave-ctabs {
	display: flex;
	border-bottom: var(--b);
}
.enclave-ctab {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 8px;
	border-right: var(--b);
	text-decoration: none;
	color: inherit;
	background: var(--w);
	transition: background 0.12s;
}
.enclave-ctab:last-child {
	border-right: none;
}
.enclave-ctab:hover {
	background: var(--g);
}
.enclave-ctab i {
	font-size: 20px;
	color: #bbb;
	transition: color 0.12s;
}
.enclave-ctab:hover i {
	color: var(--k);
}
.enclave-ctab__nm {
	font-family: var(--enclave-heading-font);
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--k);
}
