/* ======================================================================== *
 * Copyright 2025 HCL America Inc.                                          *
 * Licensed under the Apache License, Version 2.0 (the "License");          *
 * you may not use this file except in compliance with the License.         *
 * You may obtain a copy of the License at                                  *
 *                                                                          *
 * http://www.apache.org/licenses/LICENSE-2.0                               *
 *                                                                          *
 * Unless required by applicable law or agreed to in writing, software      *
 * distributed under the License is distributed on an "AS IS" BASIS,        *
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
 * See the License for the specific language governing permissions and      *
 * limitations under the License.                                           *
 * ======================================================================== */

@use "sass:map";
@use "../../common";
@use "../../common/themeMap.module";

@mixin enchanted-breadcrumbs-base-styles {
  &::part(breadcrumbs-container) {
    list-style-type: none;
    display: flex;
  }

  &::part(breadcrumbs-list) {
    @include common.reset-margin-padding;
    display: inline-flex;
    list-style-type: none !important;
  }

  &::part(breadcrumbs-item) {
    list-style-type: none;
    color: map.get(themeMap.$enchantedPalette, BLACK60P);
    border-radius: 2px;
    &:hover {
      text-decoration: underline !important;
      background-color: map.get(themeMap.$enchantedPalette, BLACK8P);
    }
  }

  &::part(breadcrumbs-item-last) {
    list-style-type: none;
  }

  &::part(breadcrumbs-item-list) {
    list-style-type: none;
  }

  &::part(breadcrumbs-item-last-icon) {
    margin: 0 4px 0 2px;
    --icon-theme-color: #{map.get(themeMap.$enchantedPalette, BLACK100P)};
    --icon-theme-size: 16px;
  }

  &::part(breadcrumbs-separator) {
    @include common.toggle-button-icon;
    list-style-type: none;
    display: inline-block;
    padding: 2px;
    --icon-theme-color: #{map.get(themeMap.$enchantedPalette, BLACK60P)};
    --icon-theme-size: 16px;
  }

  &::part(breadcrumbs-link-last) {
    text-decoration: none;
    display: inline-flex;
    color: map.get(themeMap.$enchantedPalette, $key: BLACK87P);
    cursor: default;
    &:focus {
      @include common.breadcrumbs-focus;
    }
  }

  &::part(breadcrumbs-link) {
    @include common.reset-margin-padding;
    list-style-type: none;
    text-decoration: inherit;
    color: inherit;
    display: inline-flex;
    &:hover {
      text-decoration: underline !important;
    }
    &:focus {
      @include common.breadcrumbs-focus;
    }
  }

  &::part(disabled) {
    cursor: default !important;
    color: map.get(themeMap.$enchantedPalette, BLACK43P) !important;
    pointer-events: none;
  }
  
  &::part(breadcrumbs-content) {
    display: inline-flex;
    text-decoration: inherit;
    padding: 2px;
  }

  &::part(breadcrumbs-icon) {
    @include common.toggle-button-icon;
    margin: 0 4px 0 2px;
    --icon-theme-color: #{map.get(themeMap.$enchantedPalette, BLACK60P)};
    --icon-theme-size: 16px;
  }

  &::part(breadcrumbs-text) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 2px;
  }
}


