@use 'sass:map';
@use 'sass:list';
@use 'sass:string';
@use '../../base/maps/tokens' as *;
@use '../../base/variables/icons' as *;
@use '../../base/variables/logos' as *;

.product-logo {
	display: inline-block;
	height: 4rem;
	font-size: 4rem;
	position: relative;
	transition: transform var(--transition-fast);
	width: 4rem;

	&::before {
		display: block;
		height: 100%;
		position: relative;
		width: 100%;
	}

	@each $logo-key, $logo-list in $product-logos-color-mode {
		&.logo-#{$logo-key} {
			&::before {
				content: url('#{list.nth($logo-list, 1)}');
			}
		}
	}

	&.logo-theme-solid {
		@each $logo-key, $logo-list in $product-logos-color-mode {
			&.logo-#{$logo-key} {
				mask: url('#{list.nth($logo-list, 1)}') 100% no-repeat;

				&::before {
					content: '';
					mask-image: url('#{list.nth($logo-list, 1)}');
					mask-position: center;
					mask-repeat: no-repeat;
					mask-size: contain;
					background-color: currentcolor;
				}
			}
		}
	}
}

@each $device-key, $device-map in $brandui-device-breakpoints-new {
	$device-value: map.get($device-map, 'value');
	$device-prefix: map.get($device-map, 'prefix');

	@media (max-width: string.unquote('#{$device-value}px')) {
		// Device Breakpoints Start

		@each $icon-key, $icon-val in $brandui-icon-size {
			.#{$device-prefix}logo-#{$icon-key} {
				font-size: $icon-val;
				height: $icon-val;
				width: $icon-val;
			}
		}

		// Device Breakpoints End
	}
}
