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

$params: (
   "font-size": global.$font-size-base,
   "font-weight": global.$font-weight-bold,
   "margin": 0,
);

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

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

.#{component("Product:DeliveryTime:Availability", "class")} {
   .delivery {
      color: global.$delivery-ondemand;
      font-size: map.get($params, "font-size");
      font-weight: map.get($params, "font-weight");
      margin: map.get($params, "margin");
   }

   @each $time, $color in global.$deliveries {
      .delivery-#{$time} {
         color: $color;
      }
   }
}
