$width-base: 120px;
$height-base: 36px;

@mixin scale($base, $ratio: 0.25, $scale: 1.5) {
  width: $base;
  height: $base * $ratio;

  &.large {
    width: $base * $scale;
    height: $base * $scale * $ratio;
  }

  @media (max-width: 768px) {
    width: $base * 0.75;
    height: $base * $ratio * 0.75;

    &.large {
      width: $base * $scale * 0.75;
      height: $base * $scale * $ratio * 0.75;
    }
  }
}

.company-logo {
  display: inline-block;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: left top;

  @include scale($width-base);

  &.round {
    width: $height-base !important;
    height: $height-base !important;
  }

  &--SU {
    @include scale($width-base, 0.258);
    background-image: url('./airlines-logo/aeroflot/large/en.png') !important;

    &.ru { background-image: url('./airlines-logo/aeroflot/large/ru.png') !important; }
    &.round { background-image: url('./airlines-logo/aeroflot/round.png') !important; }
  }

  &--HZ {
    @include scale(80px, 0.5556);
    background-image: url('./airlines-logo/aurora/large/en.svg') !important;

    &.ru { background-image: url('./airlines-logo/aurora/large/ru.svg') !important; }
    &.round { background-image: url('./airlines-logo/aurora/round.png') !important; }
  }

  &--F7 {
    @include scale($width-base, 0.258);
    background-image: url('./airlines-logo/aeroflot/large/en.png') !important;

    &.ru { background-image: url('./airlines-logo/aeroflot/large/ru.png') !important; }
    &.round { background-image: url('./airlines-logo/aeroflot/round.png') !important; }
  }

  &--FV {
    @include scale(90px, 0.1667);
    background-image: url('./airlines-logo/rossiya/large/en.svg') !important;

    &.ru { background-image: url('./airlines-logo/rossiya/large/ru.svg') !important; }
    &.round { background-image: url('./airlines-logo/rossiya/round.png') !important; }
  }

  &--RO {
    @include scale($width-base, 0.3334);
    background-image: url('./airlines-logo/tarom/large.png') !important;
    &.round { background-image: url('./airlines-logo/tarom/round.svg') !important; }
  }

  &--DP {
    @include scale($width-base, 0.1889);
    background-image: url('./airlines-logo/pobeda/large.svg') !important;
    &.round { background-image: url('./airlines-logo/pobeda/round.png') !important; }
  }

  &--OM {
    background-image: url('./airlines-logo/miat/large.svg') !important;
    &.round { background-image: url('./airlines-logo/miat/round.svg') !important; }
  }

  &--KL {
    @include scale($width-base, 0.4444);
    background-image: url('./airlines-logo/klm/large.png') !important;
    &.round { background-image: url('./airlines-logo/klm/round.png') !important; }
  }

  &--AY {
    background-image: url('./airlines-logo/finnair/large.svg') !important;
    &.round { background-image: url('./airlines-logo/finnair/round.png') !important; }
  }

  &--DL {
    background-image: url('./airlines-logo/delta/large.svg') !important;
    &.round { background-image: url('./airlines-logo/delta/round.png') !important; }
  }

  &--OK {
    background-image: url('./airlines-logo/czech-airline/large.png') !important;
    &.round { background-image: url('./airlines-logo/czech-airline/round.svg') !important; }
  }

  &--JU {
    background-image: url('./airlines-logo/air-serbia/large.svg') !important;
    &.round { background-image: url('./airlines-logo/air-serbia/round.svg') !important; }
  }

  &--UX {
    background-image: url('./airlines-logo/air-europa/large.svg') !important;
    &.round { background-image: url('./airlines-logo/air-europa/round.svg') !important; }
  }

  &--BT {
    background-image: url('./airlines-logo/air-baltic/large.svg') !important;
    &.round { background-image: url('./airlines-logo/air-baltic/round.svg') !important; }
  }

  &--AM {
    background-image: url('./airlines-logo/aeromexico/large.svg') !important;
    &.round { background-image: url('./airlines-logo/aeromexico/round.svg') !important; }
  }

  &--AR {
    background-image: url('./airlines-logo/aerolineas-argentinas/large.png') !important;
    &.round { background-image: url('./airlines-logo/aerolineas-argentinas/round.svg') !important; }
  }

  &--KM {
    background-image: url('./airlines-logo/airmalta/large.svg') !important;
  }

  &--AF {
    @include scale($width-base, 0.1222);
    background-image: url('./airlines-logo/airfrance/large.svg') !important;
  }

  &--AZ {
    @include scale($width-base, 0.2444);
    background-image: url('./airlines-logo/alitalia/large.svg') !important;
  }

  &--PG {
    background-image: url('./airlines-logo/bangkok-airways/large.png') !important;
  }

  &--SN {
    @include scale($width-base, 0.1667);
    background-image: url('./airlines-logo/brussels-airlines/large.png') !important;
  }

  &--FB {
    @include scale($width-base, 0.296);
    background-image: url('./airlines-logo/bulgaria-air/large.png') !important;
  }

  &--CI {
    @include scale($width-base, 0.1556);
    background-image: url('./airlines-logo/china-airlines/large.png') !important;
  }

  &--MU { background-image: url('./airlines-logo/china-eastern/large.svg') !important; }
  &--CZ { background-image: url('./airlines-logo/china-southern/large.svg') !important; }
  &--GA { background-image: url('./airlines-logo/garuda-indonesia/large.png') !important; }
  &--FI { background-image: url('./airlines-logo/icelandair/large.svg') !important; }
  &--KO { background-image: url('./airlines-logo/kenya-airways/large.svg') !important; }
  &--KE { background-image: url('./airlines-logo/korean-air/large.svg') !important; }
  &--JL { background-image: url('./airlines-logo/japan-airlines/large.svg') !important; }
  &--LO { background-image: url('./airlines-logo/polish-airlines/large.png') !important; }
  &--ME { background-image: url('./airlines-logo/mea/large.png') !important; }

  &--S7 {
    @include scale($width-base, 0.3333);
    background-image: url('./airlines-logo/s7/large.svg') !important;
  }

  &--SV { background-image: url('./airlines-logo/saudi-arabian-airlines/large.png') !important; }
  &--VN { background-image: url('./airlines-logo/vietnam-airlines/large.png') !important; }
  &--MF { background-image: url('./airlines-logo/vietnam-airlines/large.png') !important; }
}

.operator-logo__caption {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}
