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

$params: (
   "background-color": global.$brand-primary,
   "color": global.$text-dark,
);

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

   $params: map.merge($params, components.$c-preorders-submitbutton);
}

.#{component("Preorders:SubmitButton", "class")} {
   color: map.get($params, "color");
   position: relative;
   display: inline-flex;
   align-items: center;
   background-color: map.get($params, "background-color");
   min-width: 200px;

   .#{component("Spinner", "class")} {
      position: absolute;
      left: 40px;
      display: flex;
      align-items: center;
      height: 100%;
   }

   &.loading {
      cursor: not-allowed;
   }
}
