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

$params: (
   "container-size": true,
   "background-color": global.$body-bg-alt,
   "padding": 8px 0,
   "font-size": global.$font-size-base,
   "color": global.$body-color,
   "hide-breakpoint": global.$lg - 1,
);

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

   $params: map.merge($params, components.$c-header-topbar);
}

.#{component("Header:TopBar", "class")} {
   background-color: map.get($params, "background-color");
   padding: map.get($params, "padding");
   font-size: map.get($params, "font-size");
   color: map.get($params, "color");

   > .container {
      display: flex;
      align-items: center;
      justify-content: space-between;

      @if not (map.get($params, "container-size")) {
         max-width: global.$unset-max;
      }
   }

   @media screen and (max-width: map.get($params, "hide-breakpoint")) {
      display: none;
   }
}
