/* Gerland — плитки вариаций */

.gt-cell > *:not(.gt-tiles):not(.reset_variations) {
	display: none !important;
}

.gt-tiles {
	--gt-a: var(--gt-accent, #c9960c);
	--gt-b: var(--gt-border, #4a4a4a);
	--gt-m: var(--gt-muted, #9a9a9a);
	--gt-on-a: var(--gt-badge-color, #1b1b1b);
	--gt-r: var(--gt-radius, 8px);
	--gt-page: var(--gt-bg, #1b1b1b);
	--gt-tint: rgba(201, 150, 12, .12);
	--gt-hover: var(--gt-a);
	--gt-ease: .18s cubic-bezier(.2, .7, .3, 1);

	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--gt-min, 104px), 1fr));
	gap: 10px;
	width: 100%;
	max-width: var(--gt-max, 460px);
	margin: 12px 0 6px;
	box-sizing: border-box;
	font-variant-numeric: tabular-nums;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
	.gt-tiles {
		--gt-tint: color-mix(in srgb, var(--gt-a) 13%, transparent);
		--gt-hover: color-mix(in srgb, var(--gt-a) 55%, var(--gt-b));
	}
}
.gt-tiles *,
.gt-tiles *::before,
.gt-tiles *::after {
	box-sizing: border-box;
}

/* Защита от стилей темы: регистр, шрифт и интервалы задаём сами */
.gt-tiles,
.gt-tiles .gt-tile,
.gt-tiles .gt-tile *,
.gt-tiles .gt-dd-btn,
.gt-tiles .gt-dd-btn * {
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
	text-shadow: none;
}

/* ---------- Общая плитка ---------- */

.gt-tiles .gt-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	margin: 0;
	padding: 11px 13px;
	border: 1px solid var(--gt-b);
	border-radius: var(--gt-r);
	background: transparent;
	color: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	text-align: left;
	min-width: 0;
	min-height: 0;
	box-shadow: none;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: border-color var(--gt-ease), background-color var(--gt-ease), color var(--gt-ease), opacity var(--gt-ease), transform var(--gt-ease), box-shadow var(--gt-ease);
}
.gt-tiles .gt-tile:hover { border-color: var(--gt-hover); }
.gt-tiles .gt-tile:active { transform: scale(.985); }
.gt-tiles .gt-tile:focus { outline: none; }
.gt-tiles .gt-tile:focus-visible,
.gt-tiles .gt-dd-btn:focus-visible {
	outline: 2px solid var(--gt-a);
	outline-offset: 2px;
}
.gt-tiles .gt-tile.gt-on {
	border-color: var(--gt-a);
	box-shadow: inset 0 0 0 1px var(--gt-a);
}
.gt-fill .gt-tile.gt-on { background-color: var(--gt-tint); }

/* Не сочетается с уже выбранным */
.gt-tiles .gt-tile.gt-na {
	opacity: .55;
	border-style: dashed;
}
/* Нет в наличии */
.gt-tiles .gt-tile.gt-out {
	opacity: .38;
	cursor: not-allowed;
}
.gt-tiles .gt-tile.gt-out:hover { border-color: var(--gt-b); }
.gt-tiles .gt-tile.gt-out:active { transform: none; }
.gt-tiles .gt-tile.gt-out .gt-size { text-decoration: line-through; text-decoration-thickness: 1px; }

/* Элементы */
.gt-head  { display: flex; align-items: center; gap: 7px; min-width: 0; }
.gt-size  { font-size: var(--gt-title, 16px); font-weight: 600; line-height: 1.2; }
.gt-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-size: 14px; }
.gt-now   { color: var(--gt-a); font-weight: 600; }
.gt-old   { font-size: 12px; color: var(--gt-m); text-decoration: line-through; }
.gt-meta  { font-size: 12px; color: var(--gt-m); line-height: 1.35; }

.gt-dot {
	flex: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .55);
}

.gt-badge {
	position: absolute;
	top: -9px;
	right: 10px;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--gt-a);
	color: var(--gt-on-a);
	font-size: 10px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	pointer-events: none;
}

/* Галочка у выбранной карточки */
.gt-check.gt-d-tiles .gt-tile.gt-on::after,
.gt-check.gt-d-photo .gt-tile.gt-on::after {
	content: "";
	position: absolute;
	top: -8px;
	left: -8px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--gt-a) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
	box-shadow: 0 0 0 2px var(--gt-page);
	animation: gt-pop .22s cubic-bezier(.2, .9, .3, 1.4);
}
@keyframes gt-pop {
	from { transform: scale(.4); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* ---------- Карточки ---------- */

.gt-d-tiles .gt-tile { padding: 12px 14px; gap: 4px; }

/* ---------- Список ---------- */

.gt-d-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.gt-d-list .gt-tile {
	flex-direction: row;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 16px;
}
.gt-radio {
	flex: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 1.5px solid var(--gt-b);
	transition: border var(--gt-ease), background-color var(--gt-ease);
}
.gt-tile:hover .gt-radio { border-color: var(--gt-hover); }
.gt-d-list .gt-tile.gt-on .gt-radio { border: 5.5px solid var(--gt-a); }
.gt-tiles .gt-body {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 8px;
	row-gap: 2px;
	min-width: 0;
}
.gt-d-list .gt-size { font-size: 15px; }
.gt-d-list .gt-badge,
.gt-d-dropdown .gt-badge {
	position: static;
	align-self: center;
}
.gt-d-list .gt-price,
.gt-d-dropdown .gt-price {
	flex: none;
	flex-direction: row-reverse;
	font-size: 15px;
}

/* ---------- Выпадающий список ---------- */

.gt-d-dropdown {
	display: block;
	position: relative;
}
.gt-tiles .gt-dd-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid var(--gt-b);
	border-radius: var(--gt-r);
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	transition: border-color var(--gt-ease), box-shadow var(--gt-ease);
}
.gt-dd-btn:hover { border-color: var(--gt-hover); }
.gt-open .gt-dd-btn { border-color: var(--gt-a); box-shadow: inset 0 0 0 1px var(--gt-a); }
.gt-dd-value { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; }
.gt-dd-value .gt-size { font-size: 15px; }
.gt-dd-value .gt-now { margin-left: auto; font-size: 15px; }
.gt-dd-ph { color: var(--gt-m); }
.gt-dd-arrow {
	flex: none;
	width: 9px;
	height: 9px;
	margin: -4px 2px 0 4px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: .7;
	transition: transform var(--gt-ease), margin var(--gt-ease);
}
.gt-open .gt-dd-arrow { transform: rotate(-135deg); margin-top: 4px; }
.gt-dd-panel {
	position: absolute;
	z-index: 60;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-height: 320px;
	overflow: auto;
	padding: 6px;
	border: 1px solid var(--gt-b);
	border-radius: var(--gt-r);
	background: var(--gt-page);
	box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity var(--gt-ease), transform var(--gt-ease), visibility 0s linear .18s;
}
.gt-open .gt-dd-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity var(--gt-ease), transform var(--gt-ease), visibility 0s;
}
.gt-d-dropdown .gt-tile {
	flex-direction: row;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 12px;
	border-color: transparent;
	border-radius: calc(var(--gt-r) - 2px);
}
.gt-d-dropdown .gt-tile:hover { border-color: transparent; background-color: var(--gt-tint); }
.gt-d-dropdown .gt-tile.gt-on { box-shadow: none; border-color: transparent; background-color: var(--gt-tint); }
.gt-d-dropdown .gt-size { font-size: 15px; }
.gt-tick { flex: none; width: 14px; height: 8px; margin: -4px 2px 0 0; }
.gt-d-dropdown .gt-tile.gt-on .gt-tick {
	border-left: 2px solid var(--gt-a);
	border-bottom: 2px solid var(--gt-a);
	transform: rotate(-45deg);
}

/* ---------- Шкала ---------- */

.gt-d-scale {
	display: flex;
	gap: 0;
	position: relative;
	padding: 4px 0 0;
}
.gt-d-scale::before,
.gt-d-scale::after {
	content: "";
	position: absolute;
	top: 13.5px;
	height: 3px;
	border-radius: 2px;
	left: calc(50% / var(--gt-n, 3));
}
.gt-d-scale::before {
	right: calc(50% / var(--gt-n, 3));
	background: var(--gt-b);
}
.gt-d-scale::after {
	width: calc((100% - 100% / var(--gt-n, 3)) * var(--gt-progress, 0));
	background: var(--gt-a);
	transition: width .3s cubic-bezier(.2, .7, .3, 1);
}
.gt-d-scale .gt-tile,
.gt-d-scale .gt-tile:hover,
.gt-d-scale .gt-tile.gt-on {
	flex: 1 1 0;
	align-items: center;
	text-align: center;
	gap: 4px;
	padding: 0 2px 4px;
	border: 0;
	box-shadow: none;
	background: transparent;
	z-index: 1;
}
.gt-stop {
	width: 22px;
	height: 22px;
	margin-bottom: 4px;
	border-radius: 50%;
	border: 2px solid var(--gt-b);
	background: var(--gt-page);
	transition: border-color var(--gt-ease), background-color var(--gt-ease), transform var(--gt-ease), box-shadow var(--gt-ease);
}
.gt-d-scale .gt-tile:hover .gt-stop { border-color: var(--gt-hover); }
.gt-d-scale .gt-tile.gt-past .gt-stop { border-color: var(--gt-a); background: var(--gt-a); transform: scale(.55); }
.gt-d-scale .gt-tile.gt-on .gt-stop {
	border: 6px solid var(--gt-a);
	background: var(--gt-page);
	transform: scale(1.08);
	box-shadow: 0 0 0 4px var(--gt-tint);
}
.gt-d-scale .gt-size { font-size: 14px; font-weight: 500; opacity: .8; }
.gt-d-scale .gt-tile.gt-on .gt-size { opacity: 1; font-weight: 700; }
.gt-d-scale .gt-price { font-size: 12px; justify-content: center; }
.gt-d-scale .gt-tile:not(.gt-on) .gt-now { color: var(--gt-m); font-weight: 500; }
.gt-d-scale .gt-badge { position: static; margin-top: 2px; }
.gt-d-scale .gt-tile.gt-out .gt-stop { border-style: dashed; }

/* ---------- Сегменты ---------- */

.gt-d-segments {
	display: inline-flex;
	flex-wrap: nowrap;
	gap: 0;
	width: auto;
	max-width: 100%;
	padding: 3px;
	border: 1px solid var(--gt-b);
	border-radius: calc(var(--gt-r) + 3px);
}
.gt-d-segments .gt-tile {
	flex: 0 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-width: 60px;
	padding: 8px 18px;
	border: 0;
	border-radius: var(--gt-r);
}
.gt-d-segments .gt-tile:hover { background-color: var(--gt-tint); }
.gt-d-segments .gt-tile.gt-on,
.gt-fill.gt-d-segments .gt-tile.gt-on {
	background: var(--gt-a);
	color: var(--gt-on-a);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.gt-d-segments .gt-tile.gt-on .gt-now { color: inherit; }
.gt-d-segments .gt-size { font-size: 14px; font-weight: 600; }
.gt-d-segments .gt-price { font-size: 12px; justify-content: center; }
.gt-d-segments .gt-tile.gt-na { border: 0; }
.gt-d-segments .gt-badge { right: 50%; transform: translateX(50%); top: -13px; }

/* ---------- Чипсы ---------- */

.gt-d-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gt-d-chips .gt-tile {
	flex-direction: row;
	align-items: center;
	gap: 7px;
	padding: 7px 15px;
	border-radius: 999px;
}
.gt-d-chips .gt-size { font-size: 14px; font-weight: 500; }
.gt-d-chips .gt-price { font-size: 13px; }
.gt-d-chips .gt-tile.gt-on,
.gt-fill.gt-d-chips .gt-tile.gt-on {
	background: var(--gt-a);
	color: var(--gt-on-a);
	box-shadow: none;
}
.gt-d-chips .gt-tile.gt-on .gt-now { color: inherit; }
.gt-d-chips .gt-tile.gt-on .gt-dot { box-shadow: 0 0 0 1.5px var(--gt-on-a); }
.gt-d-chips .gt-badge { top: -10px; right: 6px; }

/* ---------- Кнопки ---------- */

.gt-d-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.gt-d-buttons .gt-tile {
	flex-direction: row;
	align-items: center;
	gap: 9px;
	padding: 8px 14px 8px 10px;
}
.gt-d-buttons .gt-size { font-size: 14px; font-weight: 500; }
.gt-d-buttons .gt-price { font-size: 13px; }
.gt-d-buttons .gt-dot { width: 20px; height: 20px; }
.gt-d-buttons .gt-tile:not(:has(.gt-dot)) { padding-left: 14px; }

/* ---------- Кружки ---------- */

.gt-d-swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.gt-d-swatches .gt-tile,
.gt-d-swatches .gt-tile:hover,
.gt-d-swatches .gt-tile.gt-on {
	align-items: center;
	text-align: center;
	gap: 6px;
	padding: 0;
	border: 0;
	box-shadow: none;
	background: transparent;
	width: calc(var(--gt-sw, 36px) + 30px);
}
.gt-sw,
.gt-sq {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #777;
	background-size: cover;
	background-position: center;
	box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5), 0 0 0 2px var(--gt-page), 0 0 0 3.5px transparent;
	transition: box-shadow var(--gt-ease), transform var(--gt-ease);
}
.gt-sw {
	width: var(--gt-sw, 36px);
	height: var(--gt-sw, 36px);
	border-radius: 50%;
}
.gt-tile:hover .gt-sw,
.gt-tile:hover .gt-sq { box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5), 0 0 0 2px var(--gt-page), 0 0 0 3.5px var(--gt-hover); }
.gt-tile.gt-on .gt-sw,
.gt-tile.gt-on .gt-sq { box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .5), 0 0 0 2.5px var(--gt-page), 0 0 0 4.5px var(--gt-a); }
.gt-d-swatches .gt-tile.gt-on .gt-size,
.gt-d-palette .gt-tile.gt-on .gt-size { color: var(--gt-a); }
.gt-d-swatches .gt-size { font-size: 12px; font-weight: 500; line-height: 1.25; }
.gt-d-swatches .gt-price { font-size: 11px; justify-content: center; }
.gt-d-swatches .gt-badge { right: -2px; }
.gt-sw-empty {
	background: transparent;
	font-size: 12px;
	font-weight: 700;
	opacity: .85;
}
/* Нет в наличии — зачёркнутый кружок */
.gt-tile.gt-out .gt-sw::after,
.gt-tile.gt-out .gt-sq::after {
	content: "";
	position: absolute;
	left: 50%;
	top: -8%;
	width: 1.5px;
	height: 116%;
	background: var(--gt-m);
	transform: rotate(45deg);
}

/* ---------- Палитра ---------- */

.gt-d-palette {
	grid-template-columns: repeat(auto-fill, minmax(calc(var(--gt-sw, 36px) + 30px), 1fr));
	gap: 14px 10px;
}
.gt-d-palette .gt-tile,
.gt-d-palette .gt-tile:hover,
.gt-d-palette .gt-tile.gt-on {
	align-items: center;
	text-align: center;
	gap: 7px;
	padding: 0;
	border: 0;
	box-shadow: none;
	background: transparent;
}
.gt-sq {
	width: calc(var(--gt-sw, 36px) + 16px);
	height: calc(var(--gt-sw, 36px) + 16px);
	border-radius: var(--gt-r);
}
.gt-d-palette .gt-size { font-size: 12px; font-weight: 500; line-height: 1.25; }
.gt-d-palette .gt-price { font-size: 11px; justify-content: center; }
.gt-d-palette .gt-badge { right: 0; }

/* ---------- Фото-карточки ---------- */

.gt-d-photo {
	grid-template-columns: repeat(auto-fill, minmax(max(var(--gt-min, 104px), 128px), 1fr));
	gap: 12px;
}
.gt-d-photo .gt-tile {
	padding: 0;
	gap: 0;
	overflow: visible;
}
.gt-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: calc(var(--gt-r) - 1px) calc(var(--gt-r) - 1px) 0 0;
	background-color: rgba(128, 128, 128, .15);
	background-size: cover;
	background-position: center;
	font-size: 20px;
	font-weight: 700;
	opacity: .95;
	transition: opacity var(--gt-ease);
}
.gt-photo-empty { opacity: .5; }
.gt-d-photo .gt-tile:hover .gt-photo { opacity: 1; }
.gt-d-photo .gt-body {
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	width: 100%;
	padding: 10px 12px 12px;
}
.gt-d-photo .gt-size { font-size: 15px; }

/* ---------- Телефон ---------- */

@media (max-width: 600px) {
	table.variations tr:has(.gt-cell) {
		display: flex;
		flex-direction: column;
	}
	table.variations tr:has(.gt-cell) > th,
	table.variations tr:has(.gt-cell) > td {
		display: block;
		width: 100%;
		padding-left: 0;
		padding-right: 0;
	}
	.gt-tiles { max-width: none; }
	.gt-d-tiles { grid-template-columns: repeat(auto-fill, minmax(min(var(--gt-min, 104px), 30%), 1fr)); }
	.gt-d-tiles .gt-tile { padding: 10px 11px; }
	.gt-d-photo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.gt-d-segments { display: flex; }
	.gt-d-segments .gt-tile { flex: 1 1 0; padding: 8px 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.gt-tiles *,
	.gt-tiles *::before,
	.gt-tiles *::after { transition: none !important; animation: none !important; }
}
