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

$params: (
   "margin-bottom": 20px,

   "img-border": global.$border-width solid global.$border-color,
   "img-border-radius": 50%,
   "img-margin": 0 global.$spacer 0 0,
   "img-padding": 5px,

   "title-color": global.$text-dark,
   "title-font-size": global.$font-size-h2,
   "title-font-weight": global.$font-weight-bold,
   "title-margin-bottom": 5px,
);

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

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

.#{component("Product:ModalInfo", "class")} {
   display: flex;
   margin-bottom: map.get($params, "margin-bottom");

   .#{component("Picture", "class")} {
      img {
         border: map.get($params, "img-border");
         border-radius: map.get($params, "img-border-radius");
         margin: map.get($params, "img-margin");
         padding: map.get($params, "img-padding");
      }
   }

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