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

$params: (
   "item-gap": 20px,
   "item-padding": global.$gap-width 20px global.$gap-width 8px,
   "item-border-top": global.$border-width solid global.$border-color,

   "title-color": global.$text-dark,
   "title-font-size": global.$font-size-base,
   "title-font-weight": global.$font-weight-base,

   "price-color": global.$text-dark,
   "price-font-size": global.$font-size-h4,
   "price-font-weight": global.$font-weight-bold,
);

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

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

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

   .item {
      display: flex;
      align-items: center;
      gap: map.get($params, "item-gap");
      padding: map.get($params, "item-padding");
      border-top: map.get($params, "item-border-top");
      line-height: global.$line-height-sm;
   }

   .title {
      flex: 1;
      color: map.get($params, "item-title-color");
      font-size: map.get($params, "item-title-font-size");
      font-weight: map.get($params, "item-title-font-weight");
   }

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