$footer-flag-up: $icons_caret-up !default;
$footer-flag-down: $icons_caret-down !default;
$footer-border: $border-dark !default;
$footer-flags-color: #919191 !default;

.footer-flags {
   color: $footer-flags-color;
   font-size: 12px;
   letter-spacing: .14em;
   padding: 30px 0 20px;

   ul {
      @include list-unstyled;

      display: flex;
      align-items: center;
      flex-wrap: wrap;
      margin: 0 -10px;
   }

   li {
      display: inline-block;
      padding: 10px 10px;
      width: 195px;
   }

   a {
      @include underline-hover;

      color: inherit;
      display: inline-flex;
      align-items: flex-end;
      line-height: 1.2;
   }

   img {
      display: inline-block;
      margin-right: 15px;
      width: auto;
      height: 17px;
   }

   @media screen and (max-width: 991px) {
      li {
         width: 25%;
      }
   }

   @media screen and (max-width: 767px) {
      li {
         width: 33.333%;
      }
   }

   @media screen and (max-width: 543px) {
      li {
         width: 50%;
      }
   }

   @media screen and (max-width: 419px) {
      padding-top: 0;

      ul {
         border: 1px solid $footer-border;
         margin: 0;
         padding: 6px;
      }

      li {
         padding: 5px 10px;
         width: 100%;
      }

      a {
         padding: 5px;
      }

      .active {
         order: -1;
         display: flex;
         align-items: center;

         a {
            pointer-events: none;
            flex-grow: 1;
         }

         &::after {
            @include fonticon;

            content: $footer-flag-up;
            font-size: 12px;
         }
      }

      &.closed {
         li:not(.active) {
            display: none;
         }

         .active::after {
            content: $footer-flag-down;
         }
      }
   }
}
