/// @brand core
/// @access private
/// @param {String} $theme either b2b or b2c
/// @outputs Changes navigation colours based on $theme
@mixin _oHeaderServicesTheme($theme) {
	@if type-of($theme) != 'string' {
		@error 'oHeaderServicesTheme `$theme` must be a string but "#{$theme}" is of type "#{type-of($theme)}".';
	}

	@if _oHeaderServicesSupports($theme) {
		.o-header-services--#{$theme} {
			.o-header-services__product-name {
				color: _oHeaderServicesGet('nav-text', $from: $theme);
			}

			.o-header-services__hamburger {
				background-color: _oHeaderServicesGet('nav-background', $from: $theme);
			}

			.o-header-services__primary-nav {
				background-color: _oHeaderServicesGet('nav-background', $from: $theme);
			}

			.o-header-services__primary-nav--drawer {
				background-color: rgba(0, 0, 0, 0.2);
				.o-header-services__related-content li {
					background-color: _oHeaderServicesGet('nav-background', $from: $theme);
				}

				.o-header-services__related-content li a {
					color: _oHeaderServicesGet('nav-text', $from: $theme);
				}
			}

			// The drawer close button.
			.o-header-services__drawer-close-button,
			.o-header-services__drawer-close-button:hover {
				color: _oHeaderServicesGet('nav-text', $from: $theme);
				&:after {
					@include oPrivateIconsContent('cross', _oHeaderServicesGet('nav-text', $from: $theme),  1.5rem);
					vertical-align: inherit;
				}
			}

			.o-header-services__primary-nav-list {
				background-color: _oHeaderServicesGet('nav-background', $from: $theme);
				> li:not(:last-child) {
					border: 0;
				}
				a {
					color: _oHeaderServicesGet('nav-text', $from: $theme);

					// stylelint-disable-next-line max-nesting-depth
					&:hover,
					&[aria-current] {
						color: _oHeaderServicesGet('nav-text', $from: $theme);
						background-color: _oHeaderServicesGet('nav-hover-background', $from: $theme);
					}
				}
			}
		}
	}
}
