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

$params: (
   "title-color": global.$headings-color,
   "title-font-size": global.$font-size-h1,
   "title-font-weight": global.$headings-font-weight,
   "title-align": left,
   "pricebox-wrapper-gap": 20px,
   "pricebox-margin-top": 15px,
   "pricebox-margin-bottom": 50px,
);

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

   $params: map.merge($params, components.$c-account-orderdetail);
}

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

   h1 {
      color: map.get($params, "title-color");
      font-size: map.get($params, "title-font-size");
      font-weight: map.get($params, "title-font-weight");
      text-align: map.get($params, "title-align");
   }

   .discounts-pricebox-wrapper {
      display: grid;
      grid-template-columns: 1fr;
      gap: map.get($params, "pricebox-wrapper-gap");
      margin-top: map.get($params, "pricebox-margin-top");
      margin-bottom: map.get($params, "pricebox-margin-bottom");
   }

   @container (inline-size > 700px) {
      .discounts-pricebox-wrapper {
         grid-template-columns: 1fr 1fr;
      }
   }
}
