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

$params: (
   "breakpoint": global.$lg,
   "has-side-filters": 'false',
   "left-side-width": 250px,
   "right-side-width": unset,
   "gap": 30px,
);

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

   $params: map.merge($params, components.$c-search-view);
}

.#{component("Search:View", "class")} {
   container-type: inline-size;

   @if (map.get($params, "has-side-filters") == true) {
      @container (inline-size > #{map.get($params, "breakpoint")}) {
         @include global.container-query-selector(".container") {
            display: flex;
            justify-content: space-between;
            gap: map.get($params, "gap");
         }

         @include global.container-query-selector(".category-left-side") {
            width: map.get($params, "left-side-width");
         }

         @include global.container-query-selector(".category-right-side") {
            width: map.get($params, "right-side-width");
            flex: 1;
         }
      }
   }
}
