.product-gallery__controls {
	display: none;

	.atelierd-product-gallery-ready & {
		position: absolute;
		z-index: 2;
		inset-block-end: -8px;
		inset-inline-start: 50%;
		transform: translateX(-50%);
		display: flex;
		align-items: center;
		gap: 2px;
		padding: 2px;
		border: 1px solid #e6e2e2;
		border-radius: 5px;
		background: #fff;
		color: #1a1a1a;
	}

	& button[data-gallery-step] {
		display: grid;
		place-items: center;
		inline-size: 32px;
		block-size: 28px;
		padding: 0;
		border: 0;
		border-radius: 4px;
		background: transparent;
		color: inherit;
		cursor: pointer;

		&::before {
			content: '';
			inline-size: 7px;
			block-size: 7px;
			border-right: 2px solid currentColor;
			border-bottom: 2px solid currentColor;
			transform: rotate(-45deg);
		}

		&[data-gallery-step="-1"]::before {
			transform: rotate(135deg);
		}

		&:hover {
			background: #f4f1f1;
		}

		&:focus-visible {
			outline: 2px solid currentColor;
			outline-offset: -2px;
		}

		@media (pointer: coarse) {
			inline-size: 44px;
			block-size: 44px;
		}
	}

	& .product-gallery__count {
		font-size: 12px;
		line-height: 1;
		font-variant-numeric: tabular-nums;
		white-space: nowrap;
	}
}

.product-image:has(> [data-product-gallery]) {
	& > :is(.outofstock, .overlay) {
		pointer-events: none;
	}

	&:has(> [data-product-gallery] > .product-gallery__controls:is(:hover, :focus-within)) {
		& > .overlay {
			visibility: hidden;
		}
	}
}
