@use "sass:map";
@use "sass:math";
@use "@twig/scss/_global" as global;
@use "@twig/scss/variables/_variables-components" as components;

$params: (
   "width": 400px,

   "item-padding": 15px 0,
   "item-border-bottom": global.$border-width solid global.$border-color,

   "link-gap": global.$gap-width,
   "link-text-decoration-mixin": "default",
);

@if global-variable-exists(c-switcher-currency, components) {
   $keys: map.keys(components.$c-switcher-currency);
   @each $name in $keys {
      @if not map.get($params, $name) {
         @warn "Neexistující proměnná '#{$name}' v komponentě '$#{component("Switcher:Currency", "class")}'.";
      }
   }

   $params: map.merge($params, components.$c-switcher-currency);
}

.#{component("Switcher:Currency", "class")} {
   ul {
      @include global.list-unstyled;

      width: map.get($params, "width");
      max-width: 100%;

      li {
         display: flex;
         padding: map.get($params, "item-padding");
         border-bottom: map.get($params, "item-border-bottom");
      }
   }

   a {
      display: inline-flex;
      align-items: center;
      gap: map.get($params, "link-gap");

      @if (map.get($params, "link-text-decoration-mixin") == "default") {
         @include global.underline-default;
      } @else if (map.get($params, "link-text-decoration-mixin") == "hover") {
         @include global.underline-hover;
      }
   }
}
