.tyb-product-gallery {
	--ty-gallery-gap: 14px;
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
	grid-template-rows: repeat(2, minmax(0, 1fr));
	gap: var(--ty-gallery-gap);
	width: 100%;
	height: auto;
	aspect-ratio: 8 / 3;
	margin: 0 0 32px;
}

.tyb-product-gallery__item {
	position: relative;
	display: block;
	overflow: hidden;
	min-width: 0;
	min-height: 0;
	border-radius: 20px;
	background: #eaf2f8;
	cursor: zoom-in;
}

.tyb-product-gallery__item:first-child { grid-row: 1 / 3; grid-column: 1; }
.tyb-product-gallery__image { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; transition: transform .42s ease, filter .3s ease; }
.tyb-product-gallery__item:hover .tyb-product-gallery__image { filter: brightness(.94); transform: scale(1.025); }
.tyb-product-gallery__item:focus-visible { outline: 3px solid #3976ba; outline-offset: 3px; }
.tyb-product-gallery__hidden { display: none; }

.tyb-product-gallery__sale {
	position: absolute;
	z-index: 2;
	top: 38px;
	left: 8px;
	padding: 8px 18px;
	border-radius: 0 999px 999px 0;
	color: #fff;
	background: #ed1b2f;
	box-shadow: 0 5px 14px rgba(237, 27, 47, .24);
	font-size: clamp(14px, 1vw, 20px);
	font-weight: 800;
	line-height: 1;
}

.tyb-product-gallery__all {
	position: absolute;
	z-index: 3;
	right: 26px;
	bottom: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 52px;
	padding: 12px 26px;
	border: 1px solid rgba(23, 50, 77, .08);
	border-radius: 999px;
	color: #606060;
	background: rgba(255, 255, 255, .96);
	box-shadow: 0 8px 24px rgba(23, 50, 77, .14);
	backdrop-filter: blur(10px);
	font-size: clamp(14px, 1vw, 19px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: .02em;
	pointer-events: none;
}

.tyb-product-gallery__all svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.tyb-product-gallery--has-1 { display: block; aspect-ratio: 16 / 7; }
.tyb-product-gallery--has-1 .tyb-product-gallery__item { width: 100%; height: 100%; }
.tyb-product-gallery--has-2,
.tyb-product-gallery--has-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.tyb-product-gallery--has-2 .tyb-product-gallery__item:nth-child(2) { grid-row: 1 / 3; }
.tyb-product-gallery--has-4 .tyb-product-gallery__item:nth-child(4) { grid-column: 2 / 4; }

@media (max-width: 849px) {
	.tyb-product-gallery { --ty-gallery-gap: 9px; aspect-ratio: 2 / 1; }
	.tyb-product-gallery__item { border-radius: 14px; }
	.tyb-product-gallery__all { right: 12px; bottom: 12px; min-height: 42px; padding: 9px 14px; font-size: 12px; }
	.tyb-product-gallery__sale { top: 18px; left: 6px; padding: 6px 12px; }
}

@media (max-width: 549px) {
	.tyb-product-gallery {
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 10px;
		height: 300px;
		aspect-ratio: auto;
		margin-bottom: 22px;
		padding: 0 18px 8px 0;
		scroll-behavior: smooth;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.tyb-product-gallery::-webkit-scrollbar { display: none; }
	.tyb-product-gallery__item,
	.tyb-product-gallery__hidden {
		position: relative;
		display: block;
		overflow: hidden;
		width: auto;
		height: 100%;
		min-width: 0;
		flex: 0 0 88%;
		border-radius: 13px;
		background: #eaf2f8;
		box-shadow: 0 6px 18px rgba(23, 50, 77, .1);
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}

	.tyb-product-gallery__item:first-child { grid-row: auto; grid-column: auto; }
	.tyb-product-gallery--has-1 { height: 270px; padding-right: 0; }
	.tyb-product-gallery--has-1 .tyb-product-gallery__item { flex-basis: 100%; }
	.tyb-product-gallery__all { display: none; }
	.tyb-product-gallery__sale { top: 11px; left: 11px; padding: 5px 9px; font-size: 12px; }
}
