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

$params: (
   "padding": global.$gap-width,
   "background": global.$body-bg,
   "box-shadow": global.$box-shadow-invert,
);

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

   $params: map.merge($params, components.$autocomplete-all-results);
}

.autocomplete-all-results-button {
   padding: map.get($params, "padding");
   text-align: center;
}

@media screen and (max-width: global.$respsearch-breakpoint) {
   .autocomplete-all-results-button {
      position: absolute;
      bottom: 0;
      right: 0;
      left: 0;
      background: map.get($params, "background");
      box-shadow: map.get($params, "box-shadow");

      .btn {
         width: 100%;
      }
   }
}
