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

$params: (
   "loading-opacity": 60%,
   "item-gap": 2em,
);

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

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

.#{component("Preorders:Products", "class")} {
   display: flex;
   flex-direction: column;
   gap: map.get($params, "item-gap");
   transition: opacity 200ms ease-in-out;

   &.loading {
      opacity: map.get($params, "loading-opacity");
      pointer-events: none;
   }
}
