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

$params: (
   "header-display": flex,
   "margin-bottom": global.$spacer,
   "gap": global.$gap-width,
   "width": 100%,
   "max-width": unset,

   "title-margin": 0,
   "title-color": global.$headings-color,
   "title-font-size": global.$title-default-font-size,
   "title-font-weight": global.$headings-font-weight,
);

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

   $params: map.merge($params, components.$c-product-variations);
}

.#{component("Product:Variations", "class")} {
   display: flex;
   flex-direction: column;
   width: map.get($params, "width");
   max-width: map.get($params, "max-width");
   margin-bottom: map.get($params, "margin-bottom");
   gap: map.get($params, "gap");

   .variations-header {
      display: map.get($params, "header-display");
      gap: map.get($params, "gap");
      justify-content: space-between;
   }

   .title-default {
      margin: map.get($params, "title-margin");
      color: map.get($params, "title-color");
      font-size: map.get($params, "title-font-size");
      font-weight: map.get($params, "title-font-weight");
   }
}
