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

$params: (
   "margin-bottom": global.$spacer,
   "padding": 0,
   "border-bottom": 0,
   "color": global.$body-color,
   "font-size": global.$font-size-base,
   "font-weight": global.$font-weight-base,

   "name-color": inherit,
   "name-font-size": inherit,
   "name-font-weight": inherit,

   "value-color": inherit,
   "value-font-size": inherit,
   "value-font-weight": inherit,
);

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

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

.#{component("Product:Parameters:Parameter", "class")} {
   margin-bottom: map.get($params, "margin-bottom");
   padding: map.get($params, "padding");
   border-bottom: map.get($params, "border-bottom");
   color: map.get($params, "color");
   font-size: map.get($params, "font-size");
   font-weight: map.get($params, "font-weight");

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

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